使用ubuntu作为我的服务器,我尝试使用HAProxy设置负载平衡。
当我试图使用"haproxy -f haproxy.cfg“运行时,我会得到这个错误。
警告 035/115820 (1148):haproxy.main()不能将FD限制提高到8224。警报 035/115820 (1148):启动代理035服务:无法绑定套接字
我认为释放port80可以解决这个问题,所以我卸载了可能使用port80的apache2。但还是没有解决我的问题。那么,如何才能杀死使用端口80的应用程序呢?
我的haproxy.cfg
# this config needs haproxy-1.1.28 or haproxy-1.2.1
global
log 127.0.0.1 local0
log 127.0.0.1 local1 notice
#log loghost local0 info
maxconn 4096
#chroot /usr/share/haproxy
user haproxy
group haproxy
daemon
#debug
#quiet
defaults
log global
mode http
option httplog
option dontlognull
retries 3
option redispatch
maxconn 2000
contimeout 5000
clitimeout 50000
srvtimeout 50000
listen webservice 192.168.1.120:80
mode http
stats enable
stats refresh 10s
stats hide-version
cookie GALAXY insert
balance roundrobin
option httpclose
option httpchk OPTIONS /health_check.html
option forwardfor
server RONAHPC 192.168.1.7:80 cookie GALAXY_SERVER_01 check
server MAANPC 192.168.101:80 cookie GALAXY_SERVER_02 check发布于 2012-02-05 15:06:27
netstat -anop | grep ":80"这应该能告诉你在那个端口上监听的是什么。例如:
~]# netstat -anop | grep ":80"
tcp 0 0 :::80 :::* LISTEN 15566/httpd off (0.00/0/0)您还可以使用: lsof -Pni \ grep ":80“
例如:
~]# lsof -Pni | grep ":80"
httpd 15566 apache 4u IPv6 6247436 0t0 TCP *:80 (LISTEN)
httpd 19069 root 4u IPv6 6247436 0t0 TCP *:80 (LISTEN)发布于 2012-02-21 10:48:44
通过修改我的服务器的公共ip来工作。结果,我使用的ip地址不是当前安装了负载均衡器的服务器的ip地址。
修这条线解决了我的问题
收听webservice 192.168.1.120:80
发布于 2014-12-09 14:25:01
我遇到了与@tom-angelo-clemente相同的问题,但通过在前端的bind参数上使用广播地址来解决这个问题:
frontend wfe
bind 0.0.0.0:80这将将代理绑定到机器正在使用的任何IP地址(不确定不同NIC设备上的地址),因此,如果您有私有管理接口和不希望绑定到的地址,则在使用此方法时要小心。
https://serverfault.com/questions/357011
复制相似问题