rsc-role
and/or with-rsc-role
fields (for colocation constraints) and first-action
and/or then-action
fields (for ordering constraints) are used.
Table 10.7. Additional constraint options relevant to multi-state resources
Field | Description |
---|---|
rsc-role
| |
with-rsc-role
| |
first-action
| |
then-action
|
myApp
will wait until one of the database copies has been started and promoted to master before being started itself. Only if no copies can be promoted will apache-stats
be prevented from being active. Additionally, the database will wait for myApp
to be stopped before it is demoted.
Example 10.8. Example constraints involving multi-state resources
<constraints> <rsc_location id="db-prefers-node1" rsc="database" node="node1" score="500"/> <rsc_colocation id="backup-with-db-slave" rsc="backup" with-rsc="database" with-rsc-role="Slave"/> <rsc_colocation id="myapp-with-db-master" rsc="myApp" with-rsc="database" with-rsc-role="Master"/> <rsc_order id="start-db-before-backup" first="database" then="backup"/> <rsc_order id="promote-db-then-app" first="database" first-action="promote" then="myApp" then-action="start"/> </constraints>
Master
or Slave
). In the example, the cluster will choose a location based on where database is running as a Master
, and if there are multiple Master
instances it will also factor in myApp
's own location preferences when deciding which location to choose.
rsc
clone is (after role filtering) limited to nodes on which the with-rsc
multi-state resource is (or will be) in the specified role. Allocation is then performed as-per-normal.