Why HAProxy won't listen on port 80?
Fresh machine, no http servers are running (no httpd, no lighttpd, no nginx)
$ netstat -nat | grep 80 | grep LISTEN
yields nothing...
Here's my HAProxy conf, what can be the reason for HAProxy not to
global
maxconn 72000
daemon
defaults
mode http
timeout connect 4000ms
timeout client 60000ms
timeout server 30000ms
frontend my_frontend
bind *:80
default_backend cdn
backend cdn
server cdn1 10.177.0.17:80 开发者_C百科weight 1 maxconn 8192 check
server cdn2 10.177.1.92:80 weight 1 maxconn 8192 check
server cdn3 10.177.1.147:80 weight 1 maxconn 8192 check
server cdn4 10.177.1.202:80 weight 1 maxconn 8192 check
server cdn4 10.177.1.202:80 weight 1 maxconn 8192 check
server cdn5 10.177.1.211:80 weight 1 maxconn 8192 check
server cdn6 10.177.1.93:80 weight 1 maxconn 8192 check
server cdn7 10.177.1.230:80 weight 1 maxconn 8192 check
server cdn8 10.177.0.7:80 weight 1 maxconn 8192 check
server cdn9 10.177.0.196:80 weight 1 maxconn 8192 check
server cdn10 10.177.1.82:80 weight 1 maxconn 8192 check
server cdn11 10.177.0.124:80 weight 1 maxconn 8192 check
server cdn12 10.177.1.142:80 weight 1 maxconn 8192 check
server cdn13 10.177.1.58:80 weight 1 maxconn 8192 check
server cdn14 10.177.1.137:80 weight 1 maxconn 8192 check
server cdn15 10.177.1.169:80 weight 1 maxconn 8192 check
server cdn16 10.177.0.187:80 weight 1 maxconn 8192 check
server cdn17 10.177.1.95:80 weight 1 maxconn 8192 check
server cdn18 10.177.1.123:80 weight 1 maxconn 8192 check
running haproxy-1.4.13 from source.
When I try to start it I get this error
[ALERT] 084/220004 (2409) : Starting frontend my_frontend: cannot bind socket
add global config parameter called user
user nobody
or some less privileged user. Still you need to start as root, but after acquiring the port process itself will reduce the user/privileges to nobody.
So I tried starting haproxy with the root user and it worked. I'm not sure if it's a good idea to run it under root though.
haproxy can run under some other user. such as nobody..
精彩评论