我试图确保当服务器在关闭后恢复运行(并且不再处于活动状态)时,它将自动重新启用。
这是我的haproxy.cfg:
global
log 127.0.0.1 local0
log 127.0.0.1 local1 notice
chroot /var/lib/haproxy
user haproxy
group haproxy
# daemon
defaults
log global
mode tcp
#retries 3
option tcplog
option dontlognull
option redispatch
no option persist
#balance roundrobin
balance leastconn
timeout connect 5000ms
timeout client 50000ms
timeout server 50000ms
errorfile 400 /etc/haproxy/errors/400.http
errorfile 403 /etc/haproxy/errors/403.http
errorfile 408 /etc/haproxy/errors/408.http
errorfile 500 /etc/haproxy/errors/500.http
errorfile 502 /etc/haproxy/errors/502.http
errorfile 503 /etc/haproxy/errors/503.http
errorfile 504 /etc/haproxy/errors/504.http
listen stats 0.0.0.0:9000 #Listen on all IP's on port 9000
mode http
balance
timeout client 5000
timeout connect 4000
timeout server 30000
#This is the virtual URL to access the stats page
stats uri /haproxy_stats
#Authentication realm. This can be set to anything. Escape space characters with a backslash.
stats realm HAProxy\ Statistics
#The user/pass you want to use. Change this password!
stats auth admin:adminpassword
#This allows you to take down and bring up back end servers.
#This will produce an error on older versions of HAProxy.
stats admin if TRUE
# FRONTEND - NON-SSL
frontend www-http
bind *:80
# detect capacity issues in production farm
acl MAIN_not_enough_capacity nbsrv(www-unsecure-backend-proxy) le 2
# failover traffic to backup farm
use_backend www-unsecure-backend-direct if MAIN_not_enough_capacity
default_backend www-unsecure-backend-proxy
# BACKEND - NON-SSL
backend www-unsecure-backend-proxy
mode tcp
server rproxycache01 rpcache01.container:80 check
server rproxycache02 rpcache02.container:80 check
# FALLBACK - NON-SSL
backend www-unsecure-backend-direct
option allbackups
server rproxycache01 rpcache01.container:80 check
server rproxycache02 rpcache02.container:80 check
server frontend01 web01.container:80 check backup
server frontend02 web02.container:80 check backup
因此,假设所有服务器都关闭了,只要有一个服务器重新启动,就应该使用它,但是我在 Web 界面检查过,所有服务器都显示为红色。
我该怎么做?
先感谢您。