HiPBX
The Highly Available PBX
CRM

From HiPBX Wiki

Jump to: navigation, search

Cluster Resource Manager

The major part of the Pacemaker package is crm. This tool is the most common utilitiy for interacting with the cluster. Due to hard-coded security restrictions, it can only be run by the 'root' user.

Common usages

Full documentation on crm can be found on the Pacemaker web site. or with the CRM Cheatsheat. Note that HiPBX uses Pacemaker 1.1.

However, some common usage scenarios are outlined below:

  • Show the cluster status
crm status
There is more information on interpreting the output of this command on the CRM Status page.
  • Remove all running services from a node gracefully
crm node standby nodename
This will put the node specified by nodename into standby. This stops any resources running on the node, shuts down DRBD, and leaves the machine dis-assocated from any resources. Note that the cluster service is still running on the node, and services can be restored with the 'crm node online nodename' from either node. As long as resources aren't pinned to a specific machine (using crm migrate) they will automatically move across to the other node, if it is not in standby mode too.
  • Bring node online, and make it available for resources
crm node online nodename
This will return the node specified by nodename from standby. No services will be moved from the other node. This command re-establishes the DRBD connection, and will replicate any changes that have occurred on the running node across.
  • Explicitly move a resource to a different node and lock it there (migrate)
crm resource migrate resource [<node>] [<timeout>]
This immediately and permanently pins the resource specified by resource (eg, 'http', 'asterisk', 'mysql') to the node that is not running the command, or the node specified by node. It is important to remember to either specify a timeout, or, immediately unmigrate the resource after it's moved to enable failover once again. Whilst a resource is in a 'mgrate' state, it will only run on the node specified.
  • Release a lock on a resource (unmigrate)
crm resource unmigrate resource
This command unpins the resource from any node, letting it migrate naturally between nodes as required. Always unmigrate a resource after it has been migrated.
  • Clean up any errors on a resource
crm resource cleanup resource
If there were any errors stopping a resource from starting on a node, there will be errors displayed in the crm Status command. After those errors have been fixed, run 'crm resource cleanup resource' to mark those errors as fixed, and the resource will try to start.
unaware