HAproxy stat 出現 "Proxy 'stats': in multi-process mode, stats will be limited to process assigned to the current request"
[root@haproxy haproxy-1.4.24]# ./haproxy -f haproxy.cfg
[WARNING] 181/181524 (13128) : Proxy 'stats': in multi-process mode, stats will be limited to process assigned to the current request.
只要在設定檔中加入 bind-process 1 ,讓它只跑在一顆 CPU 上 ,就不會出現錯誤訊息了。
[root@haproxy haproxy-1.4.24]# cat haproxy.cfg
# this config needs haproxy-1.1.28 or haproxy-1.2.1
global
maxconn 32768
#chroot /usr/share/haproxy
user haproxy
group haproxy
daemon
nbproc 8
#debug
#quiet
defaults
#log global
log 127.0.0.1 local3 notice
log 10.39.106.214:514 local3 notice
mode tcp
option tcplog
option dontlognull
retries 3
option redispatch
maxconn 32768
contimeout 5000
clitimeout 50000
srvtimeout 50000
listen 3868-balancer
mode tcp
bind 0.0.0.0:3868
balance leastconn
server d1 10.39.106.216:3868 weight 3 check
server d2 10.39.106.217:3868 weight 3 check
#option httpchk GET /robots.txt
#option forwardfor
listen 3870-balancer
mode tcp
bind 0.0.0.0:3870
balance leastconn
server d1 10.39.106.216:3870 weight 3 check
server d2 10.39.106.217:3870 weight 3 check
#option httpchk GET /robots.txt
#option forwardfor
listen stats :6000
mode http
stats refresh 5s
stats enable
stats hide-version
stats realm Haproxy\ Statistics
stats uri /
stats auth johnchen:johnchen
bind-process 1