6.4. Placing Resources Relative to other Resources
When the location of one resource depends on the location of another one, we call this colocation.
There is an important side-effect of creating a colocation constraint between two resources: it affects the order in which resources are assigned to a node. If you think about it, it’s somewhat obvious. You can’t place A relative to B unless you know where B is.
So when you are creating colocation constraints, it is important to consider whether you should colocate A with B or B with A.
Another thing to keep in mind is that, assuming A is collocated with B, the cluster will also take into account A’s preferences when deciding which node to choose for B.
Table 6.3. Properties of a Collocation Constraint
Field
|
Description
|
---|
id
|
A unique name for the constraint.
|
rsc
|
The colocation source. If the constraint cannot be satisfied, the cluster may decide not to allow the resource to run at all.
|
with-rsc
|
The colocation target. The cluster will decide where to put this resource first and then decide where to put the resource in the rsc field.
|
score
|
Positive values indicate the resource should run on the same node. Negative values indicate the resources should not run on the same node. Values of +/- INFINITY change "should" to "must".
|