3
votes

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?

1
@willy-tarreau can you please shed me some light on this? - dgyimesi
I can't understand what you'd like to achieve unfortunately. What I understand here is that once a server fails, the sessions assigned to that server are redistributed across the remaining servers, which is the normal and expected behaviour. But I don't understand what you would like instead. - Willy Tarreau
Thanks for the response! I'd like to stick the now orphaned session to another available host just like when everything is okay. - dgyimesi
I am also in similar situation and wants to know your approach to tackle this unexpected situation. Thanks. - Azim
Did you find any solution for this? - rahulb

1 Answers

0
votes

Check out the peers section (3.5) of the HAProxy 1.5 manual: http://haproxy.1wt.eu/download/1.5/doc/configuration.txt

It's only available in 1.5 though..