HAProxy Enterprise Documentation 2.1r1
Peers
The peers
section enables the replication of stick table data between two or more HAProxy Enterprise instances.
peers mycluster
# peers list
This feature works well for one-way replication of data because when the data replicates to the peer, it overwrites existing data on that peer. This makes it ideal for an active-standby cluster where the active instance pushes data to the standby instance.
In an active-active cluster where both instances receive traffic, use the Stick Table Aggregator module to combine the data captured by all nodes in the cluster.
Persist data at reload
A useful side effect of using a peers
section is that HAProxy Enterprise will persist stick table data after a reload. This is because during a reload the old process connects to the new one and shares all of its stick table entries with it.
To use this feature only, you can define a peers
section with only the local host address:
peers mycluster
peer local 127.0.0.1:10000
Without this, stick table data is lost during a reload.
Alternative syntax
Instead of writing peer
lines, you can use server
lines. This allows the same functionality of a server as seen in a backend
section, such as the ability to connect to the remote peer using SSL. You can also use a default-server
line to set defaults for the server lines that follow.
peers mycluster
# peers will receive sync traffic over the bound port
# optional: enable SSL
bind :10000 ssl crt /etc/ssl/certs/site.pem
# define defaults for 'server' lines
# e.g. 'ssl', peers will send sync traffic using SSL
default-server ssl
# do not set an IP address and port for the local peer
server loadbalancer1
server loadbalancer2 192.168.1.11:10000
Next up
Aggregations