0

I am trying to implement a sticky session based load balancing across two Tomcat instances using the Hazelcast Tomcat Web Session Replication. For testing purposes, I have deployed the application on two different Tomcat instances and the load balancing is handled through Apache HTTPD. The jvmroute parameters and the mod-proxy settings are fine and the load balancing has no issues.

The problem is with the session replication across the two instances. When the first server (currently serving the request) goes down the request is sent to the second server. The Hazelcast cluster identifies that the session is through fail-over and is copying the session with the new session id (suffixed with the jvmroute parameter of the second server) - as described in the Hazelcast documentation https://github.com/hazelcast/hazelcast-tomcat-sessionmanager#sticky-sessions-and-tomcat) . However for the failed-over request, the session attributes are getting updated in the older session(failed over jvmroute) and not getting replicated resulting in the failure of the subsequent request.

I have gone through the documentation but unable to find a resolution at this point. I am sure I am missing some setting as this would be a basic setting for a fail over scenario.

Can someone help me out? Please let me know if you need any additional details.

[UPDATE] After tracing the flow, able to determine that the handleTomcatSessionChange in com.hazelcast.session.HazelcastSessionChangeValve is being called correctly. The request.changeSessionId(newSessionId) call happens and post this if I display the value of the requestedsession id, the value is updated. However, the session id by itself is not updated and this is resulting in the older id in a request.getSession().getId() call.

Aravind
  • 311
  • 3
  • 14
  • Which version do you use? – Bilal Yasar Oct 24 '16 at 19:51
  • Hazelcast version: 3.7.1 Tomcat Session Manager Plugin- 1.0.2 Tomcat Version - 7.0.70 – Aravind Oct 25 '16 at 08:47
  • Aravind, i am trying to reproduce your case. by the way can you try with non-sticky config? is it working when the config is non-sticky? – Bilal Yasar Oct 26 '16 at 07:42
  • Hi Bilal Yasar, Unfortunately not too confident about my applications' non-sticky ability :( Will try nevertheless and let you know. – Aravind Oct 26 '16 at 07:50
  • Hi Bilal, I did try with stateless configuration, even here the some session variables are missing out which is resulting in error. We will trace it out and provide any updates. – Aravind Oct 31 '16 at 06:44

0 Answers0