Search code examples
ssl-certificatehaproxy

HAproxy fails to start after changing ssl certificates


I've been struggling with this issue for 2 days now and it's starting to be a big problem.

we have 2 LB on which HAproxy is installed, I've tried to change the certificats on the first one and it fell down and couldn't restart it even when getting back the old haproxy.cfg file. after a while I tried to restart the server and it did the job. I had my Haproxy running on the failed node. and I successfully changed the ssl certificats on that one.

Then, I tried to do the same on the second, and then it went down and nothing seem to be correcting the problem; not restarting haproxy on the old haproxy.cfg file nor restarting the whole server.

the error I get is like this : Starting frontend PAGEMAINTENANC_GUN: cannot bind socket [10.168.10.16:80]

Can you please give me some little help?

thank you all in advance.


Solution

  • It seems that I've been trying to bind to an IP address that is not local. That's why the HAproxy fails to start. The solution was to set ip_nonlocal_bind to 1.

    1. To get info:
      sysctl net.ipv4.ip_nonlocal_bind
      
    2. Set net.ipv4.ip_nonlocal_bind to 1
      sysctl -w net.ipv4.ip_nonlocal_bind=1
      
    3. Restart HAproxy works