问题:

CentOS7.3安装HAProxy1.8.17后启动报错,日志

[root@ldap1 run]# systemctl start haproxy
Job for haproxy.service failed because the control process exited with error code. See "systemctl status haproxy.
[root@ldap1 run]# journalctl -xe
Jan 22 16:37:10 ldap1 systemd[1]: Unit haproxy.service entered failed state.
Jan 22 16:37:10 ldap1 systemd[1]: haproxy.service failed.
Jan 22 16:37:10 ldap1 systemd[1]: haproxy.service holdoff time over, scheduling restart.
Jan 22 16:37:10 ldap1 systemd[1]: Cannot add dependency job for unit syslog.service, ignoring: Unit not found.
Jan 22 16:37:10 ldap1 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 ldap1 haproxy[14609]: [ALERT] 021/163710 (14609) : Starting frontend GLOBAL: cannot bind UNIX soc
Jan 22 16:37:10 ldap1 systemd[1]: haproxy.service: control process exited, code=exited status=1
Jan 22 16:37:10 ldap1 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 ldap1 systemd[1]: Unit haproxy.service entered failed state.
Jan 22 16:37:10 ldap1 systemd[1]: haproxy.service failed.
Jan 22 16:37:10 ldap1 systemd[1]: haproxy.service holdoff time over, scheduling restart.
Jan 22 16:37:10 ldap1 systemd[1]: Cannot add dependency job for unit syslog.service, ignoring: Unit not found.
Jan 22 16:37:10 ldap1 systemd[1]: start request repeated too quickly for haproxy.service
Jan 22 16:37:10 ldap1 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 ldap1 systemd[1]: Unit haproxy.service entered failed state.
Jan 22 16:37:10 ldap1 systemd[1]: haproxy.service failed.

 

解决:

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

[root@ldap1 ~]# mkdir -p /var/lib/haproxy
[root@ldap1 ~]# touch /var/lib/haproxy/stats

再次启动,成功

[root@ldap1 ~]# systemctl start haproxy
[root@ldap1 ~]# 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
[root@ldap1 run]# haproxy -v
HA-Proxy version 1.8.17 2019/01/08
Copyright 2000-2019 Willy Tarreau <willy@haproxy.org>

[root@ldap1 run]#

 

Logo

北京人形旗下天工造物具身智能开源社区,聚焦具身天工与慧思开物两大平台

更多推荐