January 5, 2021 / Eternal Team
HAProxy is a free, extremely quick and well-known toon offering high accessibility, load adjusting, and proxying for TCP and HTTP-based applications. It is especially appropriate for extremely high traffic sites and powers a lot of the world’s most visited ones. Through its consistent and overwhelming service, it has become the true standard open-source load balancer, is presently delivered with most standard Linux distributions.
Installation steps for centos8 server
$sudo yum update
$sudo yum install haproxy
An HAProxy essential setup advises the heap adjusting framework on what sort of associations it ought to tune in for and which workers it should hand-off the associations with.
Now we are going to create configuration file /etc/haproxy/haproxy.cfg
sudo nano /etc/haproxy/haproxy.cfg
And add the following text,
global log /dev/log local0 log /dev/log local1 notice chroot /var/lib/haproxy stats socket /run/haproxy/admin.sock mode 660 level admin stats timeout 30s user haproxy group haproxy daemon defaults log global mode http option httplog option dontlognull timeout connect 5000 timeout client 50000 timeout server 50000 frontend http_front bind *:80 stats uri /haproxy?stats default_backend http_back backend http_back balance roundrobin server my_server private_IP:80 check server my_server private_IP:80 check
And save it using:wq!
Restart HAproxy using the command below
$sudo systemctl restart haproxy $sudo systemctl enable haproxy
To learn more visit to the official HAProxy site: http://www.haproxy.org