[ClusterLabs] Configuring pacemaker to migrate a group of co-located resources if any of them fail

Chris Dewbery chris.dewbery at qamcom.com
Mon Apr 1 20:24:57 EDT 2019


Hi,

I have a two node cluster running pacemaker 2.0, which I would like to run in an
active/standby model, that is, where all of the resources run on the active node
and will be migrated to the standby node in the case where any resource on the active
fails.  While I understand this model might seem a little unusual, I have a number
of resources that must be co-located and this model significantly simplifies the amount
of testing required as there are only 2 states.

After reading through the pacemaker documentation the closest behavior I have been able
to achieve is by placing each of my resources into a group like so

<resources>
    <group id="group1">
        <primitive id="A" class="lsb" type="A"/>
        <primitive id="B" class="lsb" type="B"/>
        <primitive id="C" class="lsb" type="C"/>
        <primitive id="D" class="lsb" type="D"/>
   </group>
</resources>


In this case if resource A fails on node1, A,B,C & D are all migrated to node2.
However, in the case where resource B fails, it is simply restarted.

Is there a way to configure pacemaker so that if any of the resources fail within
this group that all resources are migrated?

To complicate things a little further, I also have a number of multistate resources that
I would like the resource in the Master role to always be co-located with each of the resources
in group1.

For example.

<resources>
    <master id="ms_A">
      <meta_attributes>
        <nvpair name="notify" value="true"/>
        <nvpair name="clone-max" value="2/>
        <nvpair name="promoted-max" value="1”/>
        <nvpair name="promoted-node-max" value="1”/>
      </meta_attributes>
      <primitive id="A" class="ocf" provider="ocf-scripts" type="A">
        <operations>
           . . . . . .
        </operations>
      </primitive>
    </master>

    <group id="group1">
        <primitive id="B" class="lsb" type="A"/>
        <primitive id="C" class="lsb" type="B"/>
        <primitive id="D" class="lsb" type="C"/>
        <primitive id="E" class="lsb" type="D"/>
   </group>
</resources>
<constraints>
    <rsc_colocation id="coloc-1" score="INFINITY" rsc="group1" with-rsc="ms_A" with-rsc-role="Master"/>
</constraints>


It would be great if these could be co-located in a similar manner, where a failure of
Any resource results in all co-located resources being migrated/promoted etc.

Any suggestions as to how I can accomplish this behavior would be greatly appreciated.


Regards,


Chris
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.clusterlabs.org/pipermail/users/attachments/20190402/671d0efd/attachment-0001.html>


More information about the Users mailing list