haproxy cannot bind UNIX socket [/var/lib/haproxy/stats] 已解决

CentOS7.2安装HAProxy1.8.12后启动报错,

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
[root@fffmo.com run]# journalctl -xe
Jan 22 16:37:10 fffmo.com systemd[1]: Unit haproxy.service entered failed state.
Jan 22 16:37:10 fffmo.com systemd[1]: haproxy.service failed.
Jan 22 16:37:10 fffmo.com systemd[1]: haproxy.service holdoff time over, scheduling restart.
Jan 22 16:37:10 fffmo.com systemd[1]: Cannot add dependency job for unit syslog.service, ignoring: Unit not found.
Jan 22 16:37:10 fffmo.com systemd[1]: Starting HAProxy Load Balancer...
-- Subject: Unit haproxy.service has begun start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit haproxy.service has begun starting up.
Jan 22 16:37:10 fffmo.com haproxy[14609]: [ALERT] 021/163710 (14609) : Starting frontend GLOBAL: cannot bind UNIX socket
Jan 22 16:37:10 fffmo.com systemd[1]: haproxy.service: control process exited, code=exited status=1
Jan 22 16:37:10 fffmo.com systemd[1]: Failed to start HAProxy Load Balancer.
-- Subject: Unit haproxy.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit haproxy.service has failed.
-- 
-- The result is failed.
Jan 22 16:37:10 fffmo.com systemd[1]: Unit haproxy.service entered failed state.
Jan 22 16:37:10 fffmo.com systemd[1]: haproxy.service failed.
Jan 22 16:37:10 fffmo.com systemd[1]: haproxy.service holdoff time over, scheduling restart.

haproxy启动无/var/lib/haproxy/stats文件,导致启动报错。

创建/var/lib/haproxy/stats文件

1
[root@fffmo.com ~]# mkdir -p /var/lib/haproxy

[root@fffmo.com ~]

# touch /var/lib/haproxy/stats 再次启动,成功

[root@fffmo.com ~]

# systemctl start haproxy

[root@fffmo.com ~]

1
2
3
4
[root@fffmo.com ~]# ps -ef | grep -i haproxy
root     14637     1  0 16:38 ?        00:00:00 /usr/sbin/haproxy -W -f /etc/haproxy/haproxy.cfg -p /run/haproxy.pid
haproxy  14639 14637  0 16:38 ?        00:00:00 /usr/sbin/haproxy -W -f /etc/haproxy/haproxy.cfg -p /run/haproxy.pid
root     14641  2589  0 16:38 pts/0    00:00:00 grep --color=auto -i haproxy

相关推荐

随机文章