I am using apache as LB with sticky session handling (using 2 tomcats as balancer member).
Below are config. done by me at apache level -
<Proxy balancer://mycluster>
(...)
ProxySet stickysession=JSESSIONID
BalancerMember http://{ip/hostname of tomcat1 backed:port} route=tomcat1
BalancerMember http://{ip/hostname of tomcat2 backed:port} route=tomcat2
</Proxy>
ProxyPass / “balancer://mycluster”
PorxyPassReverse / “balancer://mycluster”
Defining jvm route at tomcat level -
(...)
<Engine name="Catalina" defaultHost="localhost" jvmRoute="tomcat1"> ##where the jvmroute should be the route value set at apache config.
(...)
same is been defined for tomcat 2 also
(...)
<Engine name="Catalina" defaultHost="localhost" jvmRoute="tomcat2"> ##where the jvmroute should be the route value set at apache config.
(...)
Everything works fine, but the main drawback of this setup is if tomcat1 goes down then session sticked to tomcat1 also dies and doesn't route to tomcat2.
Is there any way to replicate sticky session to tomcat2 also, or simply if tomcat1 dies then session is been transferred to tomcat2 & vice-versa?