[ClusterLabs] Moving multi-state resources
a.g.basden at durham.ac.uk
Wed May 12 05:58:56 EDT 2021
Some help required with master/slave moving please...
I have set up a resource with:
pcs resource create resourcedrbd ocf:linbit:drbd drbd_resource=disk1 op monitor interval=60s
pcs resource master resourcedrbdClne resourcedrbd master-max=1 master-node-max=1 clone-max=2 clone-node-max=1 notify=true
pcs constraint location resourcedrbdClone prefers node1=100
pcs constraint location resourcedrbdClone prefers node1=50
pcs constraint location resourcedrbdClone avoids node3
pcs constraint location resourcedrbdClone avoids node4
pcs resource op add resourcedrbd monitor interval=61s role=Master
pcs constraint location resourcedrbdClone rule role=master score=100 \#uname eq node1
pcs constraint location resourcedrbdClone rule role=master score=50 \#uname eq node2
If I put node1 into standby:
pcs cluster standby node1
It works, and moves the resource to node2.
However, when I bring it back:
pcs cluster unstandby node1
the resource remains on node2.
I want the resource to move back to node1.
What have I missed? I thought the location rule should have sorted this
I have also tried:
pcs constraint rule add location-resourcedrbdClone-1 role=master score=100 \#uname eq node1
(getting the location-resourcedrbdClone-1 ID from
/var/lib/pacemaker/cib/cib.xml - though I guess there might be a better
way to get the ID through pcs)
And this doesn't help.
More information about the Users