
crm(live)configure# order rsc1 rsc2
crm(live)configure# colocation rsc2 rsc1
It is only possible to set a score of INFINITY or -INFINITY, defining resources
that must always or must never run on the same node. For example, to run the two re-
sources with the IDs
filesystem_resource
and
nfs_group
always on the same
host, use the following constraint:
crm(live)configure# colocation nfs_on_filesystem inf: nfs_group
filesystem_resource
For a master slave configuration, it is necessary to know if the current node is a master
in addition to running the resource locally. This can be checked with an additional
to_role
or
from_role
attribute.
5.5.3 Ordering Constraints
Sometimes it is necessary to provide an order in which services must start. For example,
you cannot mount a file system before the device is available to a system. Ordering
constraints can be used to start or stop a service right before or after a different resource
meets a special condition, such as being started, stopped, or promoted to master. Use
the following commands in the
crm
shell to configure an an ordering constraint:
crm(live)configure# order nfs_after_filesystem mandatory: group_nfs
filesystem_resource
5.5.4 Constraints for the Example
Configuration
The example used for this chapter would not work as expected without additional con-
straints. It is essential that all resources run on the same machine as the master of the
drbd resource. Another thing that is critical is that the drbd resource must be master
before any other resource starts. Trying to mount the drbd device when drbd is not
master simply fails. The constraints that must be fulfilled look like the following:
• The file system must always be on the same node as the master of the drbd resource.
crm(live)configure# colocation filesystem_on_master inf: \
filesystem_resource drbd_resource:Master
Configuring Cluster Resources From Command Line
67
Summary of Contents for LINUX ENTERPRISE 11 - HIGH AVAILABILITY
Page 10: ......
Page 11: ...Part I Installation and Setup...
Page 12: ......
Page 28: ......
Page 38: ......
Page 39: ...Part II Configuration and Administration...
Page 40: ......
Page 68: ......
Page 108: ......
Page 114: ......
Page 115: ...Part III Storage and Data Replication...
Page 116: ......
Page 126: ......
Page 140: ......
Page 141: ...Part IV Troubleshooting and Reference...
Page 142: ......
Page 148: ......
Page 166: ...See Also cibadmin 8 page 142 156 High Availability Guide...
Page 202: ......
Page 210: ......
Page 285: ...Part V Appendix...
Page 286: ......