Вы находитесь на странице: 1из 3

PacemakerQuickCommandReference

Martin Loschwitz <martin.loschwitz@linbit.com> Edited by Florian Haas v1.0, Oct 2010


Copyright 2010, 2011 LINBIT HA-Solutions GmbH

Trademark notice
DRBD and LINBIT are trademarks or registered trademarks of LINBIT in Austria, the United States, and other countries. Other names mentioned in this document may be trademarks or registered trademarks of their respective owners.

License information
The text and illustrations in this document are licensed under a Creative Commons Attribution-NonCommercialNoDerivs 3.0 Unported license ("CC BY-NC-ND"). A summary of CC BY-NC-ND is available at http://creativecommons.org/licenses/by-nc-nd/3.0/. The full license text is available at http://creativecommons.org/licenses/by-nc-nd/3.0/legalcode. In accordance with CC BY-NC-ND, if you distribute this document, you must provide the URL for the original version.

1. 2. 3. 4. 5. 6. 7. 8.

Getting an overview over the situation ....................................................................... Manipulating resources ............................................................................................. Manipulating cluster nodes ........................................................................................ Maintenance work for your cluster ............................................................................ Troubleshooting ....................................................................................................... Using the internal documentation ............................................................................... Moving resources between cluster nodes .................................................................... Editing the CRM configuration manually ......................................................................

1 1 2 2 2 2 2 3

The following command reference aims to give you an overview over some of the most important shell commands when it comes to using and dealing with Pacemaker.

1.Gettinganoverviewoverthesituation
If you only need an overview over the current status of all of your resources, use crm resource show For a more sophisticated overview over the current status of your cluster, including information about nodes, failcounts and inactive resources, use: crm_mon -1 -rf If you want a permanent monitor instead of a "one-shot" view, leave out the -1 and you will get a view that is automatically updated based on events.

2.Manipulatingresources
To start a resource if its stopped, use this command: crm resource start <resource> To stop a resource, use this command: crm resource stop <resource>

Pacemaker Quick Command Reference The following command will create a new resource: crm configure \ primitive <name> <resource agent> \ params <parameters> \ op <operation> If you want to remove an existing resource from the cluster information base, do it like this: crm resource delete <resource>

Note
Before removing a resource from the CIB, make sure that the resource is stopped.

3.Manipulatingclusternodes
If you want to put a cluster node into Standby mode, do it like this: crm node standby <node> To put a cluster node into Online mode, allowing Pacemaker to start resources on it, use this command: crm node online <node>

4.Maintenanceworkforyourcluster
If you intend to do maintenance work on your cluster and want Pacemaker to temporarily not manage your cluster at all, enable the maintenance mode like this: crm configure property maintenance-mode="true" To re-enable the cluster management done by Pacemaker, turn off the maintenance mode: crm configure property maintenance-mode="false"

5.Troubleshooting
If you want to reset a resources failcount and trigger a re-probe of that exact resource (this process is called "cleanup"), heres how: crm resource cleanup <resource>

6.Usingtheinternaldocumentation
When using the CRM shell, in order to get help, use this command: crm help <command> If you want more specific information about a certain resource agent, including a list of the supported parameters, use this command: crm ra info <resource agent>

7.Movingresourcesbetweenclusternodes
To migrate a resource from one cluster node to another, use the following command:

Pacemaker Quick Command Reference crm resource move <resource> <target> This sets a constraint in the cluster information base which make it impossible to run the resource on the host from which it was moved away. To remove this constraint, do this: crm resource unmove <resource>

8.EditingtheCRMconfigurationmanually
To edit the current cluster configuration, start the CRM shell in the configure context: crm configure Then, use edit to load the current configuration into the editor defined in $EDITOR. If you want to see what would happen if you commit these changes, use ptest nograph vvvvv If you are satisfied with the effects that your changes cause, commit them into the cluster: commit

Вам также может понравиться