Peers

It is possible to propagate entries of any data-types in stick-tables between
several haproxy instances over TCP connections in a multi-master fashion. Each
instance pushes its local updates and insertions to remote peers. The pushed
values overwrite remote ones without aggregation. Interrupted exchanges are
automatically detected and recovered from the last known point.
In addition, during a soft restart, the old process connects to the new one
using such a TCP connection to push all its entries before the new process
tries to connect to other peers. That ensures very fast replication during a
reload, it typically takes a fraction of a second even for large tables.
Note that Server IDs are used to identify servers remotely, so it is important
that configurations look similar or at least that the same IDs are forced on
each server on all participants.

peers Creates a new peer list with name . It is an independent section, which is referenced by one or more stick-tables. disabled Disables a peers section. It disables both listening and any synchronization related to this section. This is provided to disable synchronization of stick tables without having to comment out all "peers" references. enable This re-enables a disabled peers section which was previously disabled. peer : Defines a peer inside a peers section. If is set to the local peer name (by default hostname, or forced using "-L" command line option), haproxy will listen for incoming remote peer connection on :. Otherwise, : defines where to connect to to join the remote peer, and is used at the protocol level to identify and validate the remote peer on the server side.

During a soft restart, local peer : is used by the old instance to connect the new one and initiate a complete replication (teaching process).

It is strongly recommended to have the exact same peers declaration on all peers and to only rely on the "-L" command line argument to change the local peer name. This makes it easier to maintain coherent configuration files across all peers.

You may want to reference some environment variables in the address parameter, see section 2.3 about environment variables. Example: peers mypeers peer haproxy1 192.168.0.1:1024 peer haproxy2 192.168.0.2:1024 peer haproxy3 10.2.0.1:1024

backend mybackend mode tcp balance roundrobin stick-table type ip size 20k peers mypeers stick on src

server srv1 192.168.0.30:80
server srv2 192.168.0.31:80

results matching ""

    No results matching ""