Hello,

When I specify the ‘option prefer-last-server in the backend then:

If backend node1 goes in maintenance state (via the stats page), haproxy 
diverts all traffic to backend node2 as expected.
If node1 goes back in ready state, haproxy does not use backend node1 at all 
for balancing the incoming traffic until the meter test completes. 
If I don’t specify the prefer-last-server, server1 starts serving requests as 
soon as it becomes ready, as expected

I am running haproxy 1.6.4 on cento 6.7 on a VM environment.

The configuration for the frontend and backend is as follows:

defaults
        log     global
        mode    http
        option  httplog
        option  http-keep-alive
        option  redispatch
        no option persist
        option  dontlognull
        retries 3
        maxconn 1000

        timeout connect 5s
        timeout client  10s
        timeout server  10s
        timeout http-request 5s

frontend my-fe
        bind 172.16.251.200:700 ssl crt /etc/haproxy/my-cert.full.chain.pem

        mode http

        option http-keep-alive
        no option httpclose
        no option http-server-close
        no option forceclose

        option contstats
        option dontlognull

        default_backend gr-server-cluster

backend my-be
        balance roundrobin # default algorithm is roundrobin

        default-server inter 1s rise 2 fall 3

        server node01 172.16.252.10:7000 ssl check ca-file 
/etc/haproxy/ca-chain.cert.pem maxconn 400 weight 10
        server node02 172.16.252.11:7000 ssl check ca-file 
/etc/haproxy/ca-chain.cert.pem maxconn 400 weight 10

        mode http

        option http-keep-alive
        option prefer-last-server
        no option httpclose
        no option http-server-close
        no option forceclose

Any ideas?


Many thanks,
George


Reply via email to