tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thiago Locatelli da Silva <thiago.si...@digitro.com.br>
Subject Tomcat load balancing question x problem
Date Fri, 27 Aug 2010 12:17:54 GMT
Hello list! :)

Here at work I was asked to give a try on load balancing two tomcat 
servers running tomcat 6.0.29. The problem is that I was given only two 
servers to do this, what gave me only one option: run the apache in one 
of these servers. So I decided to put the apache httpd server which is 
going to balance the load among the two tomcat server in the Server A 
(suppousing I have server A and B running linux). My application which 
needs to be balanced has "/agent" context.

Everytime I access the URL http://servera/agent my request is redirect 
either to http://servera:8080/agent or http://serverb:8080/agent. To my 
understanding, with load balancing, my url would remain 
http://servera/agent and the redirect would take place behing the scene 
and I would never see any redirect to tomcat connector port (8080). By 
the way, i am running the load balancing with mod_proxy in the apache 
server and my configuration is as follow:

=============================================================

ProxyPass /balancer-manager !
ProxyPass /status !
ProxyStatus On
ProxyRequests Off

<Location /balancer-manager>
    SetHandler balancer-manager
    Order Deny,Allow
    Deny from all
    Allow from localhost   
</Location>

<Location /status>
    SetHandler server-status
    Order Deny,Allow
    Deny from all
    Allow from all
</Location>

<Proxy *>
    Order deny,allow
    Allow from all
</Proxy>

<Proxy balancer://cluster>
    BalancerMember http://servera:8080/agent/ route=worker0 keepalive=On 
loadfactor=1
    BalancerMember http://serverb:8080/agent/ route=worker1 keepalive=On 
loadfactor=1
    ProxySet lbmethod=byrequests maxattempts=3 
stickysession=JSESSIONID|jsessionid
</Proxy>

<Location /agent>
    ProxyPass balancer://cluster/ stickysession=JSESSIONID
    ProxyPassReverse balancer://cluster/
</Location>

=============================================================

Not happy with this scenario, i decided to install the apache httpd 
server in my laptop and made it as my load balancer instead of using 
servera to load balance. For my surprise, it worked out of the box with 
no extra configuration other than the one set up in my servera. I see no 
redirects to 8080 tomcat's port, due to my overall tests i could see 
only my desired url: http//localhost/agent (since i was running my tests 
with apache installed locally).

So my question is: does it make sense to have the load balancer in the 
same server as one of the balanced server/application? Does mod_proxy 
support this?

Many thanks for all the attention

Thiago

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


Mime
View raw message