How to Configure Keepalived that When Master is Available After Falling, It Will not Route to Master

1.3k views Asked by At

How can I configure Keepalived that when Master is available after falling, it will continue to route to backup until backup goes down. My currently configuration always routes to Master if it is available. When Master is gone, it routes to Backup and when Master is available again, it routes to the Master. I don't want that. I want it route whenever the current routed server is gone, not always to Master. So it can be understood like there are two Masters. Is it possible?

Servers are Ubuntu 18.04

1

There are 1 answers

1
Ephemeral On

You can do this by defining state MASTER on both, and having priority set to the same value on both. You can use check scripts to decrease priority when you detect a failure. When the failure condition is resolved, both will have the same priority, but the one that is currently master will continue being a master.