HA代理不会在Ubuntu 13上启动

我试图通过sudo在ubuntu 13 VM上启动HA Proxy 1.4.24。 我的haproxy.cfg文件复制如下。 但是,当我使用sudo服务haproxy启动或尝试启动sudo /etc/init.d/haproxy时,进程无法启动。 任何关于解决这个问题的想法都会有帮助 configuration文件似乎通过configurationtesting( sudo haproxy -f haproxy.cfg -c结果在“ configuration文件是有效的 ”)。
另外,/etc/init.d中haproxy文件中的Enabled标志被设置为1.端口80似乎没有被任何其他服务绑定。

更新:我已经在/etc/init.d/haproxy文件中将启用标志设置为1,而不是在/ etc / default / haproxy文件中 – 修复这个更改允许我正常运行haproxy。

global maxconn 25000 # Total Max Connections. This is dependent on ulimit daemon nbproc 4 # Number of processing cores. Dual Dual-core Opteron is 4 cores for example. defaults mode http clitimeout 60000 srvtimeout 30000 contimeout 4000 timeout http-request 5s # added to tackle slow http requests option abortonclose option forwardfor listen http_proxy *:80 #bind *:80 balance roundrobin # Load Balancing algorithm option httpchk option forwardfor # This sets X-Forwarded-For default_backend bk_web # Dynamic part of the application backend bk_web ## Define your servers to balance balance roundrobin ## change to URL hashing cookie MYSRV insert indirect nocache ## check this NOTE TO SELF server server1 0.0.0.0:81 weight 1 maxconn 512 check server server2 0.0.0.0:82 weight 1 maxconn 512 check 

你应该使用

 sh -x /etc/init.d/haproxy start 

这将打印debugging信息。而你错了。