For a school project I had to set up a load balancer by setting and installing a HA proxy. I was naive enough to think that just by following the instructions this would be done. Soon enough I was regretting my hubris.
After what I thought had been a successful installation I tried to check my server address in a random web browser just to discover it did not respond. After trying not to panic and then panicking a lot I started to look for the reason behind this in my HA proxy configuration. This issue lasted 7 hours and I was the only user affected since it was my own server.
Firstly I removed the HA installation and I reinstalled it a couple of times which did not solve the issue. By asking my peers as well as the Internet we found the solution lying in the dark depths of the haproxy.cfg file since the HAproxy service did not have any available backend servers.
I was advised to check /usr/local/sbin/haproxy — help where I found the error and I modified it with the correct information. After doing this everything was OK and I was able to breathe again.
Corrective and preventive measures
In order to prevent this issue in the future I would follow ancient wisdom summarized in the acronym “RTFM” and check the help section first.
/usr/local/sbin/haproxy — help
As well as the haproxy.cfg file which can be accessed in two ways.
/usr/local/sbin/haproxy -c -V -f /etc/haproxy/haproxy.cfg
sudo service haproxy configtest