# 概述

Pacemaker的管理工具主要有两种：crmsh、pcs(Pacemaker/Corosync configuration system)，本文将同时介绍这两种命令行工具。

# 通用操作

## 挂起节点（Node standby）

crm has the ability to set the status on reboot or forever.
pcs can apply the change to all the nodes.

# 集群资源处理操作

## 查询具体RA的描述信息

Use any RA name (like IPaddr2) from the list displayed with the previous command
You can also use the full class:provider:RA format if multiple RAs with the same name are available :

## 创建资源

The standard and provider (ocf:heartbeat) are determined automatically since IPaddr2 is unique.
The monitor operation is automatically created based on the agent’s metadata.

## 显示资源配置信息

crmsh also displays fencing resources.
The result can be filtered by supplying a resource name (IE ClusterIP):

crmsh also displays fencing resources.

## 显示fencing资源

pcs treats STONITH devices separately.

## 更新资源

crmsh also has an edit command which edits the simplified CIB syntax
(same commands as the command line) via a configurable text editor.

Using the interactive shell mode of crmsh, multiple changes can be
edited and verified before committing to the live configuration.

With roles

With roles:

With roles:

## 移动资源至指定节点（Move resources）

A resource can also be moved away from a given node:

Remember that moving a resource sets a stickyness to -INF to a given node until unmoved

## Handling configuration elements by type

pcs deals with constraints differently. These can be manipulated by the command above as well as the following and others

Removing a constraint in crmsh uses the same command as removing a resource.

The show and edit commands in crmsh can be used to manage
resources and constraints by type:

# 其它操作

## 创建模板（Template creation）

Create a resource template based on a list of primitives of the same
type

## 日志分析

Display information about recent cluster events

## Configuration scripts

Create and apply multiple-step cluster configurations including
configuration of cluster resources