1

When im starting HAProxy it says:

Starting haproxy: [ALERT] 038/154339 (770) : Starting proxy proxy1: cannot bind socket [FAILED] 

My config:

global daemon log /dev/log local4 maxconn 400000 ulimit-n 810000 defaults log global contimeout 4000 clitimeout 42000 srvtimeout 43000 listen proxy1 31.***.50.247:8217 mode tcp balance leastconn server proxy1_1 198.**.**0.70:25565 

A bit of my IPs are hidden from serverfault.

6
  • Is that actually your IP address? Commented Feb 8, 2014 at 21:14
  • No, a bit of the ip adress is hidden. Commented Feb 8, 2014 at 21:19
  • 1
    How was this resolved ? Commented Feb 8, 2014 at 22:12
  • The host was not able to run HAProxy. Commented Feb 8, 2014 at 22:32
  • @xCoderTV: What does that mean ? Commented Feb 9, 2014 at 11:00

2 Answers 2

2

Assuming this is RHEL or some derivative, if you have SELinux on it probably wouldn't appreciate you running haproxy on a port the policy is not familiar with.

Try restarting the process, let it fail. Then run ausearch -ts recent -m avc. If its coming back with results (text), then try doing these two commands.

semanage port -a -p tcp -t commplex_port_t 8217 semanage port -a -p tcp -t commplex_port_t 25565 

This will ammend the SELinux policy to be aware that haproxy is is listening on these ports.

The strange label "commplex_port_t" is the type definition of port 5000 which (I assume) haproxy defaults to if you dont choose a port. In /etc/services port 5000 claims is registered to the commplex-main service, hence the name of the label being out of place.

1
cannot bind socket [FAILED] 

That typically means one of two things:

  1. There is already another daemon listening on that port.
  2. You're using a port below 1024 and you're running haproxy as a non-privileged user.

Since it looks like you're using port 8217 and 25565, #2 isn't the case.

To determine if there is already something listening on that port:

$ sudo netstat -tunlp | grep 8217 
1
  • No one is running on that port. My vps.me forward is proxy1 31.220.50.*** 8217 25565 TCP Commented Feb 8, 2014 at 21:13

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.