[ClusterLabs] multi-state constraints

Alastair Basden a.g.basden at durham.ac.uk
Thu May 13 05:00:29 EDT 2021


>> So:
>> pcs constraint location resourceClone rule role=master score=100 \#uname
>> eq node1
>> pcs constraint location resourceClone rule add role=master score=50
>> \#uname eq node2
>> 
>> Is that the same as:
>> pcs constraint location resourceClone rule role=master score=100 \#uname
>> eq node1
>> pcs constraint location resourceClone rule role=master score=50 \#uname
>> eq node2
>> ?
>> 
>
> The first two commands create a single constraint with two rules. The
> other two commands create two constraints with one rule each. So it's
> not the same strictly speaking, even though it has the same effect:
> A location constraint may contain one or more top-level rules. The
> cluster will act as if there is a separate location constraint for each
> rule that evaluates as true. [1]

Is there a preference which I should use?  Or perhaps I should use both - 
i.e. create 2 constraints with 2 rules each, just to be sure!

> Also note your rule add command doesn't work, the syntax is:
> pcs constraint rule add <constraint id> [id=<rule id>]
> [role=master|slave] [score=<score>|score-attribute=<attribute>] <expression>
> So you create a constraint, get its id from 'pcs constraint location'
> and then you add the second rule to the constraint using the id.

Yes, thanks - I spotted that when I tried it.

Cheers,
Alastair.



More information about the Users mailing list