Installing and configuring HAProxy

To configure and install HAProxy, the user account must have superuser rights.

Installing the HAProxy load balancer on the same server with the Worker server is not recommended because HAProxy and the Worker server use the same port (1344) for interacting with other LAN servers.

To install and configure HAProxy:

  1. Open access to port 1344 on the Worker server. To do so, on the server hosting the Worker server, run the following commands depending on the operating system:
    • CentOS or Red Hat Enterprise Linux:

      firewall-cmd --add-port=1344/tcp --permanent

      firewall-cmd --reload

    • Ubuntu:

      ufw allow 1344

    • Debian:

      apt-get install iptables-persistent

      iptables -A INPUT -p tcp --dport 1344 -j ACCEPT

    • If you use SUSE Linux Enterprise Server, in the /etc/sysconfig/SuSEfirewall2 file, add port 1344: FW_SERVICES_EXT_TCP="3128 9046 705 1344".
  2. On the server that you want to use for ICAP balancing, install the HAProxy package. To do so, run one of the following commands depending on the utilized operating system:
    • CentOS or Red Hat Enterprise Linux:

      yum install haproxy

    • SUSE Linux Enterprise Server:

      zypper install haproxy

    • Ubuntu and Debian:

      apt-get install haproxy

  3. On the server that you want to use for ICAP balancing, add the following blocks of settings to the /etc/haproxy/haproxy.cfg file:

    frontend ICAP

    bind 0.0.0.0:1344

    mode tcp

    default_backend icap_pool

    backend icap_pool

    balance <balancing scheme, roundrobin is recommended>

    mode tcp

    server <name of ICAP server 1> <IP address of the Worker server>:<ICAP server port> check

    server <name of ICAP server 2> <IP address of the Worker server>:<ICAP server port> check

    server <name of ICAP server 3> <IP address of the Worker server>:<ICAP server port> check

  4. On the server that you want to use for ICAP balancing, restart the HAProxy service. To do so, execute the command:

    service haproxy restart

HAProxy load balancing will be configured.

Page top