[Pacemaker] configuration variants for 2 node cluster

Digimer lists at alteeve.ca
Mon Jun 23 14:11:55 EDT 2014

On 23/06/14 12:50 PM, Kostiantyn Ponomarenko wrote:
> Digimer,
> I am using Debian as OS and Corosync + Pacemaker as cluster stack.
> I understand your suggestion.
> I don't have any questions about it.
> My main question is how to do it automatically?
> So that it could work without human interruption for a while (nodes
> could be rebooted, but not repaired).
> That is my question.
> The only way for me to do it is:
> Write a daemon which will run Corosync and Pacemaker.
> But before that this daemon will check the connection between the two nodes.
> Then make a decision whether to start cluster or not, based on that check.
> Maybe you have some thoughts how can I do it in other way?
> Instead of doing ping the daemon could run Corosync, get the number of
> nodes in cluster, and based on that it decides whether to run Pacemaker
> or not.
> Thank you,
> Kostya

In my case, I do this with a script I wrote[1] that is called on boot. 
It checks to see if it can talk to it's peer. If it can, it starts the 
cluster stack. If it can't, it will wait for a period of time and keep 
trying. If after the timeout expires it has failed to reach the peer, it 
shuts down without doing anything.

This is the only safe option I could find to avoid a "fence loop"[2]. 
Please note that my script is written specifically for Anvil![3] 
systems, so if you want to use it, you will need to modify it.

In a 2-Node cluster, you can't use corosync/pacemaker itself to safely 
start based on node count. If you had 3+ nodes, then you could because 
then you can enable quorum. However, *personally*, I prefer to stick 
with 2-nodes as the complexity is less.


2. https://alteeve.ca/w/Fence_Loop
3. https://alteeve.ca/w/AN!Cluster_Tutorial_2

Papers and Projects: https://alteeve.ca/w/
What if the cure for cancer is trapped in the mind of a person without 
access to education?

More information about the Pacemaker mailing list