I have two nodes in a cluster. Node1 initially servers requests. Loadbalancer redirects the request to node 2 if the first node fails. I would like to know if there is a way for the Node 2 to detect if it is getting the request that was supposed for the node 1 or in other words to know if the node1 just failed.

I am using Tomcat 6 with session replication.


"Detect" as in you want your own code to realize that the session was failed over? Why do you need your code to be aware of failover?

If you have set jvmRoute for the appropriate Tomcat Engine, Tomcat should automatically append .<jvmRoute> to the JSESSIONID cookie value. Therefore looking at the incoming JSESSIONID cookie is one way to detect failover I suppose.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.