HAProxy Active/Passive and Sticky Sessions

Hey all,

we want to setup a Active/Passive HAProxy load balancer with sticky sessions enabled. My question is how these sessions can be replicated between both HAProxy Servers, so if one fails, the other one knows which user belongs to which backend. We have a floating IP via VRRP on both servers.

Unfortunately we can not use the cookies option for sticky sessions, since our application does not use cookies.

Is it right to use the peers feature (http://www.haproxy.org/download/1.5/doc/configuration.txt)? If yes, does someone has a config example? I did not find more information.

Correct, you would use stick tables and then use the peer feature to sync the tables between different haproxy nodes.

You can find a config example in the peer documentation.

You can read more about stick tables and peers here:

1 Like