haproxy uses one server at a time only

I use haproxy in front of several servers to failover. My purpose is at one time, haproxy sticks to one online server only. I can do this with option “check backup” likes below.

frontend web_front

   default_backend web_backend

backend web_backend
   server s1 check
   server s2 check backup

This works well when everything ok, server s1 will be chosen normally. When server s1 is down, s2 will serve.

How can I make haproxy still use s2 even when s1 becomes online again?



Leave a Reply