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

Andrei Borzenkov arvidjaar at gmail.com
Tue Apr 2 00:12:46 EDT 2019


02.04.2019 3:24, Chris Dewbery пишет:
> 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.
> 

Actually default reaction to failure is to restart resource. So there
should be no difference. Logs from DC when both failures happened would
be interesting.

Otherwise that's probably as best as you can get. Pacemaker does not
have notion of "colocated together"; colocation is always from to; there
can be no loops so if A must run with B, there is no way to tell it that
B must run with A (one of constraints will simply be ignored).

Pacemaker tries to take in account dependent resources, so if B must run
with A, but B cannot run on node n1, pacemaker /should/ select other
node to place both resources.

> 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
> 
> 
> _______________________________________________
> Manage your subscription:
> https://lists.clusterlabs.org/mailman/listinfo/users
> 
> ClusterLabs home: https://www.clusterlabs.org/
> 



More information about the Users mailing list