Hello, I am successfully running HAProxy 1.4.24 on CentOS 6. I am upgrading my
environment to CentOS 7 and HA-Proxy 1.5. I have configured the replacement
load balancer with the same configuration. After installing and enabling the
service to start on boot, I attempt to reboot and haproxy does not run on the
new install. Running a systemctl status -l haproxy command gives me the
following output:
-----------------------------------------------------------------------------
haproxy.service - HAProxy Load Balancer
Loaded: loaded (/usr/lib/systemd/system/haproxy.service; enabled)
Active: inactive (dead) since Tue 2014-11-25 14:24:06 PST; 1min 45s ago
Process: 951 ExecStart=/usr/sbin/haproxy-systemd-wrapper -f
/etc/haproxy/haproxy.cfg -p /run/haproxy.pid (code=exited, status=0/SUCCESS)
Main PID: 951 (code=exited, status=0/SUCCESS)
CGroup: /system.slice/haproxy.service
Nov 25 14:24:06 haproxy2 systemd[1]: Starting HAProxy Load Balancer...
Nov 25 14:24:06 haproxy2 systemd[1]: Started HAProxy Load Balancer.
Nov 25 14:24:06 haproxy2 haproxy-systemd-wrapper[951]: haproxy-systemd-wrapper:
executing /usr/sbin/haproxy -f /etc/haproxy/haproxy.cfg -p /run/haproxy.pid -Ds
Nov 25 14:24:06 haproxy2 haproxy-systemd-wrapper[951]: [ALERT] 328/142406 (958)
: Starting proxy stats: cannot bind socket [0.0.0.0:1936]
Nov 25 14:24:06 haproxy2 haproxy-systemd-wrapper[951]: haproxy-systemd-wrapper:
exit, haproxy RC=256
-----------------------------------------------------------------------------
If I try running haproxy using the following command haproxy starts
successfully, balances traffic, and supplies the stats page correctly:
[root@haproxy2 ~]# haproxy -f /etc/haproxy/haproxy.cfg
And I can see the process running:
[root@haproxy2 ~]# pgrep haproxy
2543
-----------------------------------------------------------------------------
The following is the section of the config file that sets up the stats page:
userlist UsersFor_HAProxyStatistics
group admin users haproxy
user haproxy insecure-password HA@VmView5
user stats insecure-password letmein
listen stats *:1936
mode http
stats enable
#stats scope http
#stats scope www
#stats scope static
#stats scope static_httpclose
#stats realm Haproxy\ Statistics
stats uri /haproxy?stats
#stats auth haproxy:HA@VmView5
stats refresh 20s
stats show-node
stats show-legends
acl AuthOkay_ReadOnly http_auth(UsersFor_HAProxyStatistics)
acl AuthOkay_Admin http_auth_group(UsersFor_HAProxyStatistics) admin
stats http-request auth realm HAProxy-Statistics unless
AuthOkay_ReadOnly
stats admin if AuthOkay_Admin
-----------------------------------------------------------------------------
I am not strong in Linux, but it appears that running it as root works, but
running it on startup it does not. Any ideas would be helpful. Thank you!
Sincerely,
Zach Scheidegger