BRIX On-Premises > Prepare infrastructure > Load balancer / Install HAProxy 

Install HAProxy

HAProxy is a tool for ensuring high availability and load balancing. In the BRIX system, HAProxy is employed to build a resilient architecture for organizing a highly available BRIX cluster. The necessary HAProxy configuration is chosen based on the architecture being established. This article divides the HAProxy configuration into a basic setup (the HAProxy service config) and configurations for balancing BRIX components, which can be added to the HAProxy config alongside the basic section.

The installation consists of 3 steps:

  1. Install HAProxy.
  2. Configure basic HAProxy settings.
  3. Add configurations for balancing BRIX components.

Step 1: Install HAProxy

  1. Install HAProxy using the following command:

sudo apt install haproxy -y

  1. Start the HAProxy service and enable it at boot:

sudo systemctl enable --now haproxy

Step 2: Configure basic HAProxy settings

  1. Move the default configuration file:

sudo mv /etc/haproxy/haproxy.cfg{,.original}

  1. Create and open a new configuration file for editing:

sudo nano /etc/haproxy/haproxy.cfg

The basic section of the configuration file describes the parameters of the HAProxy server, such as the operating mode, timeouts, connection counts, enabling the web interface, and more. The provided example includes the necessary configuration for the HAProxy server to function. For more details about the parameters used, refer to the official HAProxy documentation.

Example basic HAProxy configuration for the haproxy.cfg file

  1. Restart HAProxy:

sudo systemctl restart haproxy

Step 3: Add configurations for balancing BRIX components

Configurations for BRIX components are added to the haproxy.cfg file as needed.

Depending on the architecture being built, you can add the following configurations: