黑帽联盟

 找回密码
 会员注册
查看: 1661|回复: 0
打印 上一主题 下一主题

[集群服务] pacemaker资源管理器(CRM)命令注解

[复制链接]

852

主题

38

听众

3181

积分

管理员

Rank: 9Rank: 9Rank: 9

  • TA的每日心情
    郁闷
    2024-5-10 17:49
  • 签到天数: 1543 天

    [LV.Master]伴坛终老

    1、crm有两种工作方式批处理模式就是在命令行中直接输入命令(如上个命令执行时使用的crm status)交互式模式(crm(live)#)
    进入到crmsh中交互执行

    2、crm命令介绍
    一级子命令
    1. [root@essun corosync]# crm

    2. crm(live)# help

    3. This is crm shell, a Pacemaker command line interface.

    4. Available commands:

    5. cib              manage shadow CIBs #cib沙盒

    6. resource         resources management #所有的资源都在这个子命令后定义

    7. configure        CRM cluster configuration #编辑集群配置信息

    8. node             nodes management #集群节点管理子命令

    9. options          user preferences #用户优先级

    10. history          CRM cluster history#

    11. site             Geo-cluster support

    12. ra               resource agents information center #资源代理子命令(所有与资源代理相关的程都在此命令之下)

    13. status           show cluster status #显示当前集群的状态信息

    14. help,?           show help (help topics for list of topics)#查看当前区域可能的命令

    15. end,cd,up        go back one level #返回第一级crm(live)#

    16. quit,bye,exit    exit the program #退出crm(live)交互模式
    复制代码
    resource子命令

    所有的资源状态都此处控制
    1. crm(live)resource# help

    2. vailable commands:

    3. status           show status of resources #显示资源状态信息

    4. start            start a resource #启动一个资源

    5. stop             stop a resource #停止一个资源

    6. restart          restart a resource #重启一个资源

    7. promote          promote a master-slave resource #提升一个主从资源

    8. demote           demote a master-slave resource #降级一个主从资源

    9. manage           put a resource into managed mode

    10. unmanage         put a resource into unmanaged mode

    11. migrate          migrate a resource to another node #将资源迁移到另一个节点上

    12. unmigrate        unmigrate a resource to another node

    13. param            manage a parameter of a resource #管理资源的参数

    14. secret           manage sensitive parameters #管理敏感参数

    15. meta             manage a meta attribute #管理源属性

    16. utilization      manage a utilization attribute

    17. failcount        manage failcounts #管理失效计数器

    18. cleanup          cleanup resource status #清理资源状态

    19. refresh          refresh CIB from the LRM status #从LRM(LRM本地资源管理)更新CIB(集群信息库),在

    20. reprobe          probe for resources not started by the CRM #探测在CRM中没有启动的资源

    21. trace            start RA tracing #启用资源代理(RA)追踪

    22. untrace          stop RA tracing #禁用资源代理(RA)追踪

    23. help             show help (help topics for list of topics) #显示帮助

    24. end              go back one level #返回一级(crm(live)#)

    25. quit             exit the program #退出交互式程序
    复制代码
    configure子命令
    所有资源的定义都是在此子命令下完成的
    1. crm(live)configure# help

    2. Available commands:

    3. node             define a cluster node #定义一个集群节点

    4. primitive        define a resource #定义资源

    5. monitor          add monitor operation to a primitive #对一个资源添加监控选项(如超时时间,启动失败后的操作)

    6. group            define a group #定义一个组类型(将多个资源整合在一起)

    7. clone            define a clone #定义一个克隆类型(可以设置总的克隆数,每一个节点上可以运行几个克隆)

    8. ms               define a master-slave resource #定义一个主从类型(集群内的节点只能有一个运行主资源,其它从的做备用)

    9. rsc_template     define a resource template #定义一个资源模板

    10. location         a location preference #定义位置约束优先级(默认运行于那一个节点(如果位置约束的值相同,默认倾向性那一个高,就在那一个节点上运行))

    11. colocation       colocate resources #排列约束资源(多个资源在一起的可能性)

    12. order            order resources #资源的启动的先后顺序

    13. rsc_ticket       resources ticket dependency

    14. property         set a cluster property #设置集群属性

    15. rsc_defaults     set resource defaults #设置资源默认属性(粘性)

    16. fencing_topology node fencing order #隔离节点顺序

    17. role             define role access rights #定义角色的访问权限

    18. user             define user access rights #定义用用户访问权限

    19. op_defaults      set resource operations defaults #设置资源默认选项

    20. schema           set or display current CIB RNG schema

    21. show             display CIB objects #显示集群信息库对

    22. edit             edit CIB objects #编辑集群信息库对象(vim模式下编辑)

    23. filter           filter CIB objects #过滤CIB对象

    24. delete           delete CIB objects #删除CIB对象

    25. default-timeouts set timeouts for operations to minimums from the meta-data

    26. rename           rename a CIB object #重命名CIB对象

    27. modgroup         modify group #改变资源组

    28. refresh          refresh from CIB #重新读取CIB信息

    29. erase            erase the CIB #清除CIB信息

    30. ptest            show cluster actions if changes were committed

    31. rsctest          test resources as currently configured

    32. cib              CIB shadow management

    33. cibstatus        CIB status management and editing

    34. template         edit and import a configuration from a template

    35. commit           commit the changes to the CIB #将更改后的信息提交写入CIB

    36. verify           verify the CIB with crm_verify #CIB语法验证

    37. upgrade          upgrade the CIB to version 1.0

    38. save             save the CIB to a file #将当前CIB导出到一个文件中(导出的文件存于切换crm 之前的目录)

    39. load             import the CIB from a file #从文件内容载入CIB

    40. graph            generate a directed graph

    41. xml              raw xml

    42. help             show help (help topics for list of topics) #显示帮助信息

    43. end              go back one level #回到第一级(crm(live)#)

    44. quit             exit the program  #退出crm交互模式
    复制代码
    node子命令
    节点管理和状态命令
    1. crm(live)resource# cd ..

    2. crm(live)# node

    3. crm(live)node# help

    4. Node management and status commands.

    5. Available commands:

    6. status           show nodes status as XML #以xml格式显示节点状态信息

    7. show             show node #命令行格式显示节点状态信息

    8. standby          put node into standby #模拟指定节点离线(standby在后面必须的FQDN)

    9. online           set node online # 节点重新上线

    10. maintenance      put node into maintenance mode

    11. ready            put node into ready mode

    12. fence            fence node #隔离节点

    13. clearstate       Clear node state #清理节点状态信息

    14. delete           delete node #删除 一个节点

    15. attribute        manage attributes

    16. utilization      manage utilization attributes

    17. status-attr      manage status attributes

    18. help             show help (help topics for list of topics)

    19. end              go back one level

    20. quit             exit the program
    复制代码
    ra子命令
    资源代理类别都在此处
    1. crm(live)node# cd ..

    2. crm(live)# ra

    3. crm(live)ra# help

    4. Available commands:

    5. classes          list classes and providers #为资源代理分类

    6. list             list RA for a class (and provider)#显示一个类别中的提供的资源

    7. meta             show meta data for a RA #显示一个资源代理序的可用参数(如meta ocf:heartbeat:IPaddr2)

    8. providers        show providers for a RA and a class

    9. help             show help (help topics for list of topics)

    10. end              go back one level

    11. quit             exit the program
    复制代码
    注:
    虽然这些命令所用的单词都很简单,但我还是将经常用得到的标注一下,虽然现在刚学完,记的比较清楚,但可能在以后的某一天对这里的某一个命令出现了盲区,岂不痛心疾首。(千万不要高估自己的记忆力,有时一个不小心就会骗了你!)

    帖子永久地址: 

    黑帽联盟 - 论坛版权1、本主题所有言论和图片纯属会员个人意见,与本论坛立场无关
    2、本站所有主题由该帖子作者发表,该帖子作者与黑帽联盟享有帖子相关版权
    3、其他单位或个人使用、转载或引用本文时必须同时征得该帖子作者和黑帽联盟的同意
    4、帖子作者须承担一切因本文发表而直接或间接导致的民事或刑事法律责任
    5、本帖部分内容转载自其它媒体,但并不代表本站赞同其观点和对其真实性负责
    6、如本帖侵犯到任何版权问题,请立即告知本站,本站将及时予与删除并致以最深的歉意
    7、黑帽联盟管理员和版主有权不事先通知发贴者而删除本文

    勿忘初心,方得始终!
    您需要登录后才可以回帖 登录 | 会员注册

    发布主题 !fastreply! 收藏帖子 返回列表 搜索
    回顶部