1. 程式人生 > >haproxy 無法啟動,需要添加內核參數

haproxy 無法啟動,需要添加內核參數

無法 ipv c-c process proxy art balancer rabbitmq ted

安裝好haproxy後,配置正確無法啟動,看日誌:

Feb 13 09:32:50 cluster-node2 systemd: Started HAProxy Load Balancer.
Feb 13 09:32:50 cluster-node2 haproxy-systemd-wrapper: [ALERT] 043/093250 (6538) : Starting proxy mysql-pxc-cluster: cannot bind socket [192.168.22.30:3306]
Feb 13 09:32:50 cluster-node2 haproxy-systemd-wrapper: [ALERT] 043/093250 (6538) : Starting proxy rabbitmq-cluster: cannot bind socket [192.168.22.30:5673]
Feb 13 09:32:50 cluster-node2 haproxy-systemd-wrapper: [ALERT] 043/093250 (6538) : Starting proxy rabbitmq-cluster-management: cannot bind socket [192.168.22.30:15673]
Feb 13 09:32:50 cluster-node2 haproxy-systemd-wrapper: haproxy-systemd-wrapper: exit, haproxy RC=1
Feb 13 09:32:50 cluster-node2 systemd: haproxy.service: main process exited, code=exited, status=1/FAILURE
Feb 13 09:32:50 cluster-node2 systemd: Unit haproxy.service entered failed state.
Feb 13 09:32:50 cluster-node2 systemd: haproxy.service failed.

解決:
vim /etc/sysctl.conf
net.ipv4.ip_nonlocal_bind=1

然後sysctl -p
成功啟動

haproxy 無法啟動,需要添加內核參數