Apache + Tomcat - Problems with sticky sessions and load balancing Apache + Tomcat - Problems with sticky sessions and load balancing apache apache

Apache + Tomcat - Problems with sticky sessions and load balancing


I don't see a jvmRoute suffix on your JSESSIONID. mod_proxy uses jvmRoute to correctly route sticky sessions to your Tomcat instances. jvmRoute is declared in your tomcat server configuration (where each server instance has its own unique jvmRoute identifier.


Maybe tis will help. This is my config on a web server:

<Proxy balancer://hybriscluster>BalancerMember ajp://tomcatServer1:8009 route=tomcat1 keepalive=On ping=5 max=200 ttl=120BalancerMember ajp://tomcatServer2:8009 route=tomcat2 keepalive=On ping=5 max=200 ttl=120ProxySet stickysession=JSESSIONID|jsessionid lbmethod=byrequests timeout=60</Proxy>

Config in server.xml of tomcat Server 1:

<Engine name="Catalina" defaultHost="localhost" jvmRoute="tomcat1"}">


I was facing the same issue and solved it by modifying the below line -

ProxyPass /test balancer://mycluster stickysession=JSESSIONID|jsessionid scolonpathdelim=On<Proxy balancer://mycluster>BalancerMember http://192.168.1.2:80 route=node1BalancerMember http://192.168.1.3:80 route=node2</Proxy>

Please note the configuration scolonpathdelim=OnReference - http://httpd.apache.org/docs/2.2/mod/mod_proxy_balancer.html