5.4. Placing Resources Relative to other Resources
Colocation constraints tell the cluster that the location of one resource depends on the location of another one.
Colocation has an important side-effect: it affects the order in which resources are assigned to a node. Think about it: 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 colocated with B, the cluster will take into account A’s preferences when deciding which node to choose for B.
5.4.1. Colocation Properties
Table 5.3. Attributes of a rsc_colocation Constraint
Field | Default | Description |
---|
id
|
|
A unique name for the constraint (required).
|
rsc
|
|
The name of a resource that should be located relative to with-rsc (required).
|
with-rsc
|
|
The name of the resource used as the colocation target. The cluster will decide where to put this resource first and then decide where to put rsc (required).
|
node-attribute
|
#uname
|
|
score
|
|
Positive values indicate the resources should run on the same node. Negative values indicate the resources should run on different nodes. Values of +/- INFINITY change "should" to "must".
|