High Availability is a group of computer that ensures the availability of backup server with no down-time. It can reduces the load on a single server which means lots of hits are coming on a single server to access any application, website and other applications on the server.
We can reduce the load on a server by configuring HA act as load balancer. It can be configured using Nginx or HA Proxy Server.
Start the Service
As you can see there is no log file for haproxy
By default, haproxy does not make any log until you configure it with rsyslog server.
Step 1: You can see haproxy sends the message to rsyslog on 127.0.0.1 By Default, rsyslog server does not listen on any address.
Edit this file /etc/rsyslog.conf and uncomment these lines
These will tell rsyslog server to listen on udp 514 port for all Ip address and optionally you can these line to listen on localhost.
Step2: Now you will have to make a file under rsyslog directory
I have made a file with ha.conf under the directory rsyslog and add these line to this file
Step3: additional task if you want separate log file then you can add these line in ha.conf file which was created under directory /etc/rsyslog.d/ha.conf
Step 4: restart the service of rsyslog server and haproxy
I configured it on localhost
Now check the location there you will see there will be a log file of haproxy.log will be generated .
Path is /var/log/haproxy.log