[ClusterLabs] SBD stonith in 2 node cluster - how to make it prefer one side of cluster?
Andrei Borzenkov
arvidjaar at gmail.com
Sat Nov 25 01:52:58 EST 2017
Wrapping my head around how pcmk_delay_max works, my understanding is
- on startup pacemaker always starts one instance of stonith/sbd; it
probably randomly selects node for it. I suppose this initial start is
delayed by random number within pcmk_delay_max.
- when cluster is partitioned, pacemaker *also* starts one instance of
stonith/sbd in each partition where it is not yet running. This startup
is also delayed by random number within pcmk_delay_max.
- this makes partition that already has stonith/sbd running win race for
kill request
Is my understanding correct?
If yes, consider two node cluster where one application is more
important than the other. The obvious example is replicated database -
in case of split brain we want to preserve node with primary as it
likely has active connections.
Would using advisory colocation constraint between application and
stonith/sbd work? Let's consider (using crmsh notation)
primitive my_database
ms my_replicated_database my_database
primitive fencing_sbd stonith:external/sbd params pcmk_delay_max=15
colocation prefer_primary 10: fencing_sbd my_replicated_database:Master
It is going to work?
It should work on startup, as it simply affects where sbd resource is
placed initially and pacemaker need to make this decision anyway.
I expect it to work if my_primary_database master moves to another node
- pacemaker should move sbd resource too, right? It does add small
window where no stonith agent is running, but as I understand pacemaker
is going to start it anyway in case of split brain, so in the worst case
non-preferred node will be fenced, which is not worse than what we have
already.
What I am not sure is what happens during split brain. Will colocation
affect pacemaker decision to start another copy of sbd resource on
another partitioned node? I hope not, as it is advisory so it should
still use the only available node left in this case?
Does it all make sense? Anyone has used it in real life?
More information about the Users
mailing list