Sales Creatio, enterprise edition
PDF
This documentation is valid for Creatio version 7.16.0. We recommend using the newest version of Creatio documentation.

Set up HAProxy balancer

To set up HAProxy, modify the haproxy.cfg file. You can find the file under the following path:

.../etc/haproxy/haproxy.cfg

Primary setup (required)

Add two sections necessary for HAProxy operation: frontend and backend.

The frontend section

Add two settings to the frontend section: bind and default_backend.

  • In the bind setting, specify the address and the port that will receive requests distributed by HAProxy.

  • In the default_backend option, specify the name that will match the name of the backend section.

As a result, the setup will look as follows:

frontend front
maxconn 10000
#Using these ports for binding
bind *:80
bind *:443
#Convert cookies to be secure
rspirep ^(set-cookie:.*) \1;\ Secure
default_backend creatio

The backend section

Add 2 required settings to the backend section:

  • In the balance parameter, specify the type of balancing, e.g., roundrobin. More information about different types of balancing is available in HAProxy documentation.

  • Use the server parameter to specify all servers (or “nodes”) for distributing the load.

Add a separate “server” parameter for each server (i.e. the deployed Creatio application instance) and specify the server/port addresses and weight. The server weight allows the balancer to distribute the load based on the physical capabilities of the servers. The more weight is specified for the server, the more requests it receives. For example, if you need to distribute the load between 2 Creatio application servers, add 2 “server” parameters to backend:

server node_1 [server address]:[port] weight
server node_2 [server address]:[port] weight

As a result, the setup will look as follows:

backend creatio
#set balance type
balance roundrobin
            
server node_1 nodeserver1:80 check inter 10000 weight 2
server node_2 nodeserver2:80/sitename check inter 10000 weight 1

The new settings will be applied as soon as you restart HAProxy. To restart HAProxy, use the following command:

service haproxy restart

Check server status

The HAProxy balancer works with the following server statuses:

Status name

Status details

UP

The server is operational.

UP - transitionally DOWN

The server registers as treated as operational at the moment, but the last health check has failed. As a result, the server is currently switching to the DOWN status.

DOWN - transitionally UP

The server registers as treated as not operational at the moment, but the last health check has succeeded. As a result, the server is currently switching to the UP status.

DOWN

The server is not operational.

Health checks initiate changes in a server’s operational status. The simplest health check requires adding the “check” keyword in the server setup string. Running the health check requires the server’s IP and TCP port. Health check example:

server node1 ... check
option httpchk GET /Login/NuiLogin.aspx
option httpchk GET /0/ping

Set up web statistics (optional)

To enable web-statistics, add a new “listen” section with the following parameters: bind, mode http, stats enable, stats uri. The syntax is as follows:

listen stats # Define a listen section called "stats»
         bind :9000 # Listen on localhost:9000
         mode http
         stats enable  # Enable stats page
         stats uri /haproxy_stats  # Stats URI

As a result, the web statistics of Creatio load balancing will be available for viewing in the browser.

Fig. 1 Example of a load balancer web statistics

load_balancer_stats.png 

To view the statistics, follow the path: [balancer address]:9000/haproxy_stats.

See also

Server-side system requirements

Installing Creatio

Set up secure access to the portal

Did you find this information useful?

How can we improve it?