Redispatch does not work when balance source


#1

I have setup a haproxy config file as follow, and try to verify redispatch function, however, when i set the balance algorithm as source, i get 3 retry(from stats web page) and finally get a 503 error, the request does not redspatch to s2 when I kill s1, is anything wrong with my cfg, any helps are appricicated. I am using haproxy 1.6.10

global
# logging to rsyslog facility local3 [err warning info debug]
log 127.0.0.1 local1 notice
log 127.0.0.1 local3 warning
log 127.0.0.1
stats bind-process 4
stats socket /tmp/haproxy.sock mode 0600 level admin

maxconn  51200
ulimit-n 102434
pidfile /var/wd/ehaproxy/haproxy.pid
daemon
nbproc 4
#cpu-map TODO
spread-checks 5
user  haproxy
group haproxy

defaults
log global
mode http # [tcp|http|health]
backlog 10000
#retries 0
retries 3
maxconn 15000
balance roundrobin
errorfile 500 /var/wd/ehaproxy/conf/500.http
errorfile 502 /var/wd/ehaproxy/conf/502.http
errorfile 503 /var/wd/ehaproxy/conf/503.http
errorfile 504 /var/wd/ehaproxy/conf/504.http

no option httpclose
option log-separate-errors
option httplog
option dontlognull 
option abortonclose 
option redispatch  

option forwardfor   # X-Forwarded-For: remote client ip


timeout client          10m 
timeout server          10m
timeout connect         1s
#timeout tunnel          10m
timeout http-keep-alive 6m   # ?
timeout queue           1m
timeout check           5s
#timeout http-request    5s

default-server minconn 50 maxconn 5000 inter 80s rise 2 fall 3

listen 0.0.0.0:10910
bind 0.0.0.0:10910
bind-process 1
stats uri /stats

listen 0.0.0.0:10911
bind 0.0.0.0:10911
bind-process 2
stats uri /stats

listen 0.0.0.0:10912
bind 0.0.0.0:10912
bind-process 3
stats uri /stats

listen 0.0.0.0:10913
bind 0.0.0.0:10913
bind-process 4
stats uri /stats

listen sub
bind 0.0.0.0:19192
balance source
server s1 192.168.149.150:22222 weight 4
server s2 192.168.149.150:9192 weight 4


#2

but your servers are not checked so haproxy never knows that you kill this server. Thus it must not (and will not) redispatch since the farm remains in the same state. You need to enable health checks.