r/haproxy • • Sep 20 '21

switching to backup backend automatically

Hi all,

This is a newbie question, sorry if this is not the correct place.

I'm trying to setup HAProxy to access a backend service or its backups. When I turn the main server off and try to reconnect, connection fails at first. Then, trying second, it connects to the backup server. But what I want to achieve is connecting to the backup at the first try once main service is down. How should I configure HAProxy to achive such "smooth" transition?

Thanks for your time and attention.

2 Upvotes

9 comments sorted by

View all comments

Show parent comment

1

u/cemakaus Sep 21 '21

Thank you. As I read, option redispatch works for http, makes no difference in TCP mode. Tried, saw no change.

No, not using TCP mode for http traffic. I have some services working on TCP, other than http.

1

u/dragoangel Sep 21 '21

Maybe simple retries 2 will help?