How it works...
This recipe actually performs two tasks. First, we enable stats socket in the global section in admin mode so we can retrieve information from HAProxy and send commands if necessary. We will be using this capability later, so it's a good time to do this since we're modifying the configuration anyway.
The next thing we do essentially converts HAProxy into more of a stateful connection arbitrator. We actually add only two things to the bk_db configuration to accomplish this. The first is an IP-based stick-table that stores the HAProxy dst (destination) field.
HAProxy stick tables determine where new connections will be directed when they are established. The reason we used the destination rather than the source is that the source ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access