0

I am using apache server as a front end load balancer with tomcat6 servers. I am using lbmethod configuration for making all the requests from one client going to same tomcat always.

<VirtualHost *:1000>
ServerAdmin [email protected]
#DocumentRoot /www/docs/dummy-host.example.com
ServerName dummy-host.example.com
ErrorLog logs/dummy-host.example.com-error_log
CustomLog logs/dummy-host.example.com-access_log common

ProxyPass /balancer-manager  !
ProxyPass / balancer://mycluster/ lbmethod=byrequests nofailover=On
ProxyPassReverse / balancer://mycluster/

<Proxy balancer://mycluster>;
BalancerMember ajp://localhost:8101/ route=NodeA1000 retry=10
BalancerMember ajp://localhost:8102/ route=NodeB1000 retry=10
BalancerMember ajp://localhost:8103/ route=NodeC1000 retry=10
BalancerMember ajp://localhost:8104/ route=NodeD1000 retry=10
BalancerMember ajp://localhost:8105/ route=NodeE1000 retry=10
</Proxy>

I have 5 tomcats in the back-end. But instead of all requests from the same client going to same tomcat, the requests are load-balanced. Am I missing anything here?

0

1 Answer 1

1

I agree this belongs on serverfault.com however, this might be helpful.

What you're getting is indeed standard behaviour. However, you're probably struggling with sessions. Read up on session clustering here: http://tomcat.apache.org/tomcat-6.0-doc/cluster-howto.html

This makes sure sessions are shared amongst your tomcat instances.

Be sure to add distributable="true" to your context.xml files in the application you're deploying like so:

<Context path="/" debug="5" reloadable="true" crossContext="true" distributable="true">
1
  • Thanks. I think this approach will share the sessions to all the nodes. But i would like to have the same node to receive all the requests for one client
    – shk
    Jun 7, 2011 at 18:47

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .