Table 5.1. Attributes of a rsc_location Element
Attribute | Default | Description |
---|---|---|
id
|
| |
rsc
|
| |
rsc-pattern
|
|
A pattern matching the names of resources to which this constraint applies. The syntax is the same as POSIX extended regular expressions, with the addition of an initial ! indicating that resources not matching the pattern are selected. If the regular expression contains submatches, and the constraint is governed by a rule, the submatches can be referenced as
%0 through %9 in the rule’s score-attribute or a rule expression’s attribute . A location constraint must either have a rsc , have a rsc-pattern , or contain at least one resource set.
|
node
|
| |
score
|
|
Positive values indicate a preference for running the affected resource(s) on
node — the higher the value, the stronger the preference. Negative values indicate the resource(s) should avoid this node (a value of -INFINITY changes "should" to "must"). A location constraint must either have a node and score , or contain at least one rule.
|
resource-discovery
|
always
|
Whether Pacemaker should perform resource discovery (that is, check whether the resource is already running) for this resource on this node. This should normally be left as the default, so that rogue instances of a service can be stopped when they are running where they are not supposed to be. However, there are two situations where disabling resource discovery is a good idea: when a service is not installed on a node, discovery might return an error (properly written OCF agents will not, so this is usually only seen with other agent types); and when Pacemaker Remote is used to scale a cluster to hundreds of nodes, limiting resource discovery to allowed nodes can significantly boost performance.
|
Warning
never
or exclusive
removes Pacemaker’s ability to detect and stop unwanted instances of a service running where it’s not supposed to be. It is up to the system administrator (you!) to make sure that the service can never be active on nodes without resource-discovery (such as by leaving the relevant software uninstalled).