• 配置crmsh的yum仓库,此仓库的RPM包有openSUSE提供,将这个network:ha-clustering:Stable.repo文件直接下载到本地并且命名为crmsh.repo
wget -O /etc/yum.repos.d/crmsh.repo http://download.opensuse.org/repositories/network:/ha-clustering:/Stable/CentOS_CentOS-7/network:ha-clustering:Stable.repo
yum repolist
yum install -y crmsh
crmsh是pacemaker的命令行接口工具,执行help命令,可以查看shell接口所有的一级命令和二级命令,使用cd 可以切换到二级子命令的目录中去,可以执行二级子命令
在集群中的资源有四类:primitive主资源、group组资源、clone克隆资源、ms/master主从资源
在集群中的约束有三种:

①:location位置约束:资源间的依赖/互斥性,定义资源是否运行在同一节点上。score,正值表示要运行在同一节点上,负值则不可。 
②:colocation排列约束:每个节点都有一个score值,正值则倾向于本节点,负值倾向于其他节点,所有节点score比较,倾向于最大值的节点。 
③:order顺序约束:定义资源执行动作的次序,例如vip应先配置,httpd服务后配置。特殊的score值,-inf 负无穷,inf 正无穷。

 
常用指令介绍:
crm(live)# help
Help overview for crmsh
 
 
Available topics:(可用主题)
 
Overview Help overview for crmsh

Topics Available topics

Description Program description
CommandLine Command line options
Introduction Introduction
Interface User interface
Completion Tab completion
Shorthand Shorthand syntax
Features Features
Shadows Shadow CIB usage
Checks Configuration semantic checks
Templates Configuration templates
Testing Resource testing
Security Access Control Lists (ACL)
Resourcesets Syntax: Resource sets
AttributeListReferences Syntax: Attribute list references
AttributeReferences Syntax: Attribute references
RuleExpressions Syntax: Rule expressions
Reference Command reference
 
Available commands:(可用命令)
 
      cd            切换命令层级,例如 cd cluster:切换到cluster二级命令
help 查看帮助
ls 列出命令层级和命令
quit 退出
report 报告
status 查看集群状态,可以有参数 help status 可以查看
up 回到上一个命令层级
verify 验证集群状态
assist/ Configuration assistant 配置集群代理
template Create template for primitives
weak-bond Create a weak bond between resources cib/ CIB shadow management
cibstatus CIB status management and editing (CIB状态管理和编辑)
commit Copy a shadow CIB to the cluster (将影子CIB复制到集群)
delete Delete a shadow CIB (删除阴影CIB)
diff Diff between the shadow CIB and the live CIB (阴影CIB和活动CIB的区别)
import Import a CIB or PE input file to a shadow (将CIB或PE输入文件导入到阴影中)
list List all shadow CIBs (列出所有阴影CIB)
new Create a new shadow CIB (创建一个新的CIB)
reset Copy live cib to a shadow CIB (将活动CIB复制到影子CIB)
use Change working CIB (改变工作CIB) cibstatus/ CIB status management and editing
load Load the CIB status section
node Change node status
op Edit outcome of a resource operation
origin Display origin of the CIB status section
quorum Set the quorum
run Run policy engine
save Save the CIB status section
show Show CIB status section
simulate Simulate cluster transition
ticket Manage tickets cluster/ Cluster setup and management (重要)
add 给集群添加节点
copy 拷贝文件到另外一个集群的节点
diff Diff file across cluster
geo_init Configure cluster as geo cluster
geo_init_arbitrator Initialize node as geo cluster arbitrator
geo_join Join cluster to existing geo cluster
health 集群的健康状态检查
init 初始化集群
join 加入到已经存在的集群
remove 从集群中移除一个节点
run 在所有集群节点执行一条命令
start 启动集群服务
status 集群状态检查
stop 停止集群服务
wait_for_startup Wait for cluster to start configure/ CIB configuration cib 集群配置(很重要,最重要的命令用中文注释了)
acl_target Define target access rights
alert Event-driven alerts
cib CIB shadow management
cibstatus CIB status management and editing
clone 定义克隆资源
colocation 设置排列约束
commit Commit the changes to the CIB
default-timeouts Set timeouts for operations to minimums from the meta-data
delete Delete CIB objects
edit 编辑集群配置文件,cib文件
erase Erase the CIB
fencing_topology Node fencing order
filter Filter CIB objects
get_property Get property value
graph Generate a directed graph
group 定义组资源
load Import the CIB from a file
location 设置位置约束
modgroup Modify group
monitor Add monitor operation to a primitive
ms 定义主从资源
node Define a cluster node
op_defaults Set resource operations defaults
order 设置顺序约束
primitive 定义主资源
property 设置集群的属性
ptest Show cluster actions if changes were committed
refresh Refresh from CIB
rename Rename a CIB object
role Define role access rights
rsc_defaults Set resource defaults
rsc_template Define a resource template
rsc_ticket Resources ticket dependency
rsctest Test resources as currently configured
save Save the CIB to a file
schema Set or display current CIB RNG schema
set Set an attribute value
show Display CIB objects
tag Define resource tags
template Edit and import a configuration from a template
upgrade Upgrade the CIB
user Define user access rights
validate-all Help for command validate-all
validate_all Call agent validate-all for resource
verify Verify the CIB with crm_verify
xml Raw xml corosync/ Corosync management Corosync的管理
add-node Add a corosync node
del-node Remove a corosync node
diff Diffs the corosync configuration
edit Edit the corosync configuration
get Get a corosync configuration value
log Show the corosync log file
pull Pulls the corosync configuration
push Push the corosync configuration
reload Reload the corosync configuration
set Set a corosync configuration value
show Display the corosync configuration
status Display the corosync status history/ Cluster history 设置集群的历史信息
detail Set the level of detail shown
diff Cluster states/transitions difference
events Show events in log
exclude Exclude log messages
graph Generate a directed graph from the PE file
info Cluster information summary
latest Show latest news from the cluster
limit Limit timeframe to be examined
log Log content
node Node events
peinputs List or get PE input files
refresh Refresh live report
resource Resource events
session Manage history sessions
setnodes Set the list of cluster nodes
show Show status or configuration of the PE input file
source Set source to be examined
transition Show transition
transitions List transitions
wdiff Cluster states/transitions difference maintenance/ Maintenance mode commands 维护模式的命令
action Invoke a resource action
off Disable maintenance mode
on Enable maintenance mode node/ Node management 节点管理(很重要)
attribute 管理、查看节点属性
clearstate Clear node state
delete 删除节点
fence Fence 一个节点
maintenance Put node into maintenance mode
online 让节点上线, 例如:node online node2
ready Put node into ready mode
server Show node hostname or server address
show 查看集群中的节点
standby 让一个节点standy,例如:node standby node1
status 查看集群中节点的状态
status-attr 管理集群中节点的属性
utilization Manage utilization attributes options/ User preferences
add-quotes Add quotes around parameters containing spaces
check-frequency When to perform semantic check
check-mode How to treat semantic errors
colorscheme Set colors for output
editor Set preferred editor program
manage-children How to handle children resource attributes
output Set output type
pager Set preferred pager program
reset Reset user preferences to factory defaults
save Save the user preferences to the rc file
set Set the value of a given option
show Show current user preference
skill-level Set skill level
sort-elements Sort CIB elements
user Set the cluster user
wait Synchronous operation ra/ 资源代理管理操作(很重要)
classes 列出资源类别和提供者,例如:ra classes
info 查看脚本的使用方法,例如:ra info IPaddr2
list 列出一个类别中有多少可用的资源代理,例如:ra list lsb 或 ra list ocf
providers 查看特定资源代理有哪个提供者提供,例如:ra providers IPaddr2
validate Validate parameters for RA resource/ Resource management 资源管理(重要)
ban Ban a resource from a node
cleanup Cleanup resource status
clear Clear any relocation constraint
constraints Show constraints affecting a resource
demote Demote a master-slave resource
failcount Manage failcounts
locate Show the location of resources
maintenance Enable/disable per-resource maintenance mode
manage Put a resource into managed mode
meta Manage a meta attribute
move 将某个资源迁移到哪个节点上去
operations Show active resource operations
param Manage a parameter of a resource
promote Promote a master-slave resource
refresh Refresh CIB from the LRM status
reprobe Probe for resources not started by the CRM
restart Restart resources
scores Display resource scores
secret Manage sensitive parameters
start Start resources
status Show status of resources
stop Stop resources
trace Start RA tracing
unmanage Put a resource into unmanaged mode
untrace Stop RA tracing
utilization Manage a utilization attribute script/ Cluster script management
json JSON API for cluster scripts
list List available scripts
run Run the script
show Describe the script
verify Verify the script site/ GEO clustering site support
ticket Manage site tickets template/ Edit and import a configuration from a template
apply Process and apply the current configuration to the current CIB
delete Delete a configuration
edit Edit a configuration
list List configurations/templates
load Load a configuration
new Create a new configuration from templates
show Show the processed configuration

corosync+pacemaker的crmsh的常用指令介绍的更多相关文章

  1. 高可用集群corosync+pacemaker之crmsh使用(二)

    上一篇博客我们聊到了crmsh的安装以及配置一个资源到corosync+pacemaker高可用集群上的相关命令的用法,回顾请参考https://www.cnblogs.com/qiuhom-1874 ...

  2. 高可用集群corosync+pacemaker之crmsh使用(一)

    上一篇博客我们聊了下高可用集群corosync+pacemaker的相关概念以及corosync的配置,回顾请参考https://www.cnblogs.com/qiuhom-1874/p/13585 ...

  3. docker创建image方法以及常用指令介绍

    docker -help    # 显示帮助 docker COMMAND -help    # 帮助信息更详细 docker start “容器名称”    # 启动一个或多个容器 docker s ...

  4. 新人成长之入门Vue.js常用指令介绍(一)

    写在前面 作为一个刚步入职场工作的新人,对于公司中所用的技术和框架基本上不懂,只能从最基础的开始做起,进入公司接触的第一个框架就是前端框架Vue.js,几个功能做下来,觉得Vue.js首先学习起来真的 ...

  5. Nginx学习系列四默认负载均衡轮询及Ip_hash等常用指令介绍

    一.简介 Upstream模块是Nginx中一个核心模块,当客户端访问Nginx服务器的时候,Nginx会从服务器列表中选取压力小的服务器,然后分配给客户端进行访问.这个过程,Nginx通过轮询算法轮 ...

  6. Emit学习(2) - IL - 常用指令介绍

    学习Emit必不可少的, 会使用到IL中间代码. 初见IL代码, 让我有一种汇编的感觉, 让我想起了, 大学时, 学习8051的汇编语言. 多的就不扯了, 直接进入正题, OpCodes指令集是不是有 ...

  7. Vue入门---安装及常用指令介绍

    1.安装 BootCDN----官网https://www.bootcdn.cn/ <script src="https://cdn.bootcss.com/vue/2.6.10/vu ...

  8. git介绍和常用指令

    Git介绍和常用指令 介绍:Git和SVN一样都是版本控制工具.不同的是Git是分布式的,SVN是集中式的.Git开始用可能感觉难点,等你用习惯了你就会觉得svn是有点恐怖.(如果一个项目有好多人一起 ...

  9. Corosync+Pacemaker+crmsh构建Web高可用集群

    一.概述: 1.1 AIS和OpenAIS简介 AIS应用接口规范,是用来定义应用程序接口(API)的开放性规范的集合,这些应用程序作为中间件为应用服务提供一种开放.高移植性的程序接口.是在实现高可用 ...

随机推荐

  1. WINDOWS 下设置单独的java环境

    set JAVA_HOME=C:\Program Files\Java\jdk1.8.0_65set PATH=%JAVA_HOME%\bin;%PATH%;D:cd D:\JavaProjectcm ...

  2. 【转】URL编码(encodeURIComponent和decodeURIComponent)

    转自http://blog.jhonse.com/archives/2032.jhonse 最近在用CI框架的时候,发现一个问题,URL的GET方式链接时,如果用中文字符的话,就会出现问题,提示:链接 ...

  3. 转://SIHA环境修改主机名实施步骤

    目 录1 实施需求 2 修改主机名 2.1 停止HAS服务 2.2 修改主机名 3 重新配置服务 3.1 使用root用户重新配置CSS & OHAS服务 3.2 设置cssd自动启动属性 3 ...

  4. 关于PHP中浏览器禁止Cookie后,Session能使用吗?

    sessionid是存储在cookie中的,解决方案如下: Session URL重写,保证在客户端禁用或不支持COOKIE时,仍然可以使用Session session机制.session机制是一种 ...

  5. linux永久配置ip地址

    vi /etc/sysconfig/network-scripts/ifcfg-eth0 i修改 DEVICE=eth() BOOTPROTO=static ONBOOT=yes IPADDR=192 ...

  6. java--Git学习使用

    第一步:安装 很简单,什么都不用管,一直下一步直到完成 第二步:Git配置                   1.打开GIt Bash         2.依次输入   git config --g ...

  7. 离线安装Cloudera Manager 5和CDH5(最新版5.9.3) 完全教程(七)界面安装

    一.安装过程 1.1 登录 1.2 接受许可协议 1.3 选择免费版本 1.4 选择下一步 1.5 选择当前管理的主机 1.6 选择使用Parcel安装,选择CDH版本,点击继续 1.7 等待安装 此 ...

  8. Appium——处理混合APP中H5的操作

    https://blog.csdn.net/iiyting/article/details/51887488

  9. 笔记二:常用的h5语义化标签

    0.前言: 所谓语义化标签就是一种 我们仅通过标签名就能判断出该标签内容的语义的标签,见名知意. 总结这部分内容,主要是为了能从繁琐的div嵌套div中,改成带有h5标签码.这样更有利于读写代码. 人 ...

  10. Vue2 第一天学习

    个人小总结:1年多没有写博客,感觉很多知识点生疏了,虽然工作上能解决问题,但是当别人问到某个知识点的时候,还是迷迷糊糊的,所以坚持写博客是硬道理的,因为大脑不可能把所有的知识点记住,有可能某一天忘了, ...