[ClusterLabs] multi-state constraints

Alastair Basden a.g.basden at durham.ac.uk
Mon May 10 13:36:58 EDT 2021


Hi Andrei,

Thanks.  So, in summary, I need to:
pcs resource create resourcedrbd0 ocf:linbit:drbd drbd_resource=disk0 op monitor interval=60s
pcs resource master resourcedrbd0Clone resourcedrbd0 master-max=1 master-node-max=1 clone-max=2 clone-node-max=1 notify=true

pcs constraint location resourcedrb0Clone prefers node1=100
pcs constraint location resourcedrb0Clone prefers node2=50
pcs constraint location resourcedrb0Clone avoids node3
pcs constraint location resourcedrb0Clone avoids node4

Does this mean that it will prefer to run as master on node1, and slave on 
node2?  If not, how can I achieve that?

Thanks,
Alastair.




>>>
>>> I think we need to constrain the resource:
>>> pcs constraint location resourcedrbd0 prefers node1=100
>>> pcs constraint location resourcedrbd0 prefers node2=50
>>> pcs constraint location resourcedrbd0 avoids node3
>>> pcs constraint location resourcedrbd0 avoids node4
>>>
>>> Do we also need to constrain the clone?:
>>
>> No, only one set is needed. I am not sure what is preferred, but you can
>> use either primitive or clone in resource constraints.
>>
>
> Probably I was wrong and you have to use clone constraints. According to
> documentation, "You should never reference the name of a clone’s child
> (the primitive or group resource being cloned)".
>
>>> pcs constraint location resourcedrb0Clone prefers node1=100
>>> pcs constraint location resourcedrb0Clone prefers node2=50
>>
>> Those two constraints are redundant and they do not do what you expect.
>> Location constraints are not related to master selection. They just
>> define which nodes are eligible to run clone instance; which instance
>> will be promoted is defined by master score which is usually set by
>> resource agent.
>>
>> You can define rules to set master score, but I do not know how it will
>> interact with explicit scores set by other means.
>>
>>> pcs constraint location resourcedrb0Clone avoids node3
>>> pcs constraint location resourcedrb0Clone avoids node4
>>>
>>> Is this correct, or should I be using a colocation somehow?
>>>
>>>
>>> Do I also need:
>>> pcs constraint order demote resourcedrbd0 then promote resourcedrbd0    ?
>>> I think probably not.
>>>
>>> For the file system resource that will then I think we should use this:
>>> pcs constraint colocation add resourceFilesystem with resourcedrbd0Clone
>>> INFINITY with-rsc-role=Master
>>> pcs constraint order promote resourcedrbd0Clone then start
>>> resourceFilesystem
>>>
>>> Is that correct?  I'm not sure about the with-rsc-role=Master part.
>>>
>>> Thanks,
>>> Alastair.
>>> _______________________________________________
>>> Manage your subscription:
>>> https://lists.clusterlabs.org/mailman/listinfo/users
>>>
>>> ClusterLabs home: https://www.clusterlabs.org/
>>
>
> _______________________________________________
> Manage your subscription:
> https://lists.clusterlabs.org/mailman/listinfo/users
>
> ClusterLabs home: https://www.clusterlabs.org/
>


More information about the Users mailing list