Have a bit of an odd situation. I need to set up a singular VIP with keepalived that will bounce among machines as they fail/come down, etc. I have four total servers, each running a database application. The reason I need this setup is because the particular database application we're using is stateful with regard to the way it syncs. I can't just have any machine come up at any time.
They're setup as two master/slave pairs. When A fails, I need C to take over. If C then fails, I need D to take over. The premise in this situation is that if A fails, I want to rebuild A and B. The same would apply if C fails, I'd want A to take over. Then B, if A also fails. I only need to survive double node failure.
Is there a good way to set this up with keepalived, or am I stuck doing something like scripting to stop keepalived on say, B, when A fails so that it will never take over?