I'm having a situation where I've to maintain session stickiness in case of a node's failure. The configuration is:
- three nodes (as1, as2, as3) running our enterprise application on JBoss 4.2.3 (homogeneous cluster)
- HAProxy doing roundrobin (one TCP server and one Tomcat) for each nodes
- replicated tomcat sessions (for SSO on failover)
- stick sessions enabled (appsession directive)
My problem is when I put down one of the nodes (ie. as3) the session stickiness breaks immediately: the session fails over without reauthentication (Tomcat shared sessions), but from now on every request get served from different servers (as1 as2 as1 as2 as1 as2 ...).
How can I ensure that the failed over request will stick to the first available server on failover?