haproxy failover backup server
https://www.haproxy.com/blog/failover-and-worst-case-management-with-haproxy/
Normal backup servers: In this case, s3 will be used first, until it fails, then s4 will be used.
frontent ft_app
bind 10.0.0.1:80
default_backend bk_app_main
backend bk_app_main
server s1 10.0.0.101:80 check
server s2 10.0.0.102:80 check
server s3 10.0.0.103:80 check backup
server s4 10.0.0.104:80 check backup
Multiple backup servers: In this case, both s3 and s4 will be used if they are available.
option allbackups
frontent ft_app
bind 10.0.0.1:80
default_backend bk_app_main
backend bk_app_main
option allbackups
server s1 10.0.0.101:80 check
server s2 10.0.0.102:80 check
server s3 10.0.0.103:80 check backup
server s4 10.0.0.104:80 check backup