Harsimranjit singh Kler wrote:
Hi

Here is details:

*Tomcat version*: 5.5.27
*OS*:Window XP
*JDK*:1.6
*Environment Trying to Create* :Load balancing and Clustering on single
Machine using tomcat instances only(balancer Feature) .

*What i have Achieved*:i am running 4 instances of tomcat on ports
8080,9080,10080,11080.So port 8080 tomcat work as balancer and other works
as cluster.(Using Multicasting IP and Port {check server.xml} it works
fine).
attached find server.xml,web.xml,rule.xml of balancer tomcat(8080).

So using  balancer feature in tomcat and rule.xml and some customized
classes requests are successfully redirected to one of cluster ie 9080,10080
or 11080 instance.

*Issue*:when request redirected from tomcat balancer(on 8080 port) to any
cluster (tomcat instance on 9080,10080 or 11080 port) URL in address bar
also changed. i dont want to display cluster URL.So how i can achive this?.

i think "org.apache.webapp.balancer.BalancerFilter"  class internally use
SendRedirect() method .

I tried with requestDispatcher..Forward() but it accept only realtive
address.



I believe that David already gave you the basic answer.



From what I read in the message, it appears the balancer is sending the
browser a redirect (one of the 30x responses) which in turn changes the
url in the browser's address bar.  The OP (if I understand correctly)
would like the url in the browser's address bar not to change at all (no
30x redirect response).  The only way I can imagine that working is if
the balancer acts as a reverse proxy, sending each request back to a
different back-end worker.

I don't think that what you want to achieve can be done (yet) with Tomcat alone.

As a bit of an outsider's answer, I'll add this : from browsing the Tomcat cluster on-line documentation, it looks to me as a very impresive piece of work, but also as quite a complex setup.

If your main purpose is to balance the load between a number of back-end Tomcat engines, I believe that using an Apache httpd front-end with either of the mod_proxy_ajp or the mod_jk connector, would be much easier to set up, and would provide exactly what you want : a single hostname:port for the clients, and load-balancing, and fail-over capabilities.

It does that, because it would act like David indicates above, as a "reverse proxy". In this kind of configuration, the clients (browsers e.g.) always talk to the same front-end server, and receive the responses from that front-end server. The front-end server in turn passes the requests to one of several back-end servers, and gets the response from them, which they then send back to the client. The clients always talk to the front-end server, and see only that one; they never even know that there are back-end servers, and never see the hostname:port of these back-end servers.

Maybe the Tomcat cluster configuration does additional things which the front-end balancer setup cannot do. But that is an area that I really don't know, and maybe someone else can comment on that.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to