HAProxy is a server application for providing high availability and load balancing for TCP and HTTP applications by distributing incoming requests to several serving servers. Available for Linux, FreeBSD, OpenBSD, Solaris (8/9/10), AIX (5.1–5.3), macOS, Cygwin.
Pre-setting
HAProxy and cluster servers must be on the same network.
The firewall must be configured to work with PAM and PAM Core Gateway, or disabled.
Configure HAproxy to start automatically after server reboot. Open the configuration file with the command:
$ sudo nano /etc/default/haproxy
then append to the end of file ENABLED=1:
содержимое файла /etc/default/haproxy
# Defaults file for HAProxy
#
# This is sourced by both, the initscript and the systemd unit file, so do not
# treat it as a shell script fragment.
# Change the config file location if needed
#CONFIG="/etc/haproxy/haproxy.cfg"
# Add extra flags here, see haproxy(1) for a few options
#EXTRAOPTS="-de -m 16"
ENABLED=1
Save a backup copy of the configuration file HAProxy with the command: