crm用法

crm命令: crm有两种工作方式: 1,批处理模式,就是在shell命令行中直接输入命令;

2,交互式模式(crm(live)#),进入到crmsh中交互执行;

crm的特性: 1、任何操作都需要commit提交后才会生效;

2、想要删除一个资源之前需要先将资源停止

3、可以用  help COMMAND 获取该命令的帮助 

4、与Linux命令行一样,都支持TAB补全
复制代码

crm命令详解: 1.一级子命令 [root@node1 corosync]# crm crm(live)# help # 获取当前可用命令 Available commands: cib manage shadow CIBs #cib管理模块

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

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

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

options user preferences #用户优先级

history CRM cluster history #CRM历史

site Geo-cluster support #地理集群支持

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

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

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

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

quit,bye,exit exit the program #退出crm(live)交互模式

常用子命令介绍: 1.resource子命令 #定义所有资源的状态

crm(live)resource# help vailable commands: status show status of resources #显示资源状态信息

start start a resource #启动一个资源

stop stop a resource #停止一个资源

restart restart a resource #重启一个资源

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

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

manage put a resource into managed mode

unmanage put a resource into unmanaged mode

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

unmigrate unmigrate a resource to another node

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

secret manage sensitive parameters #管理敏感参数

meta manage a meta attribute #管理源属性

utilization manage a utilization attribute

failcount manage failcounts #管理失效计数器

cleanup cleanup resource status #清理资源状态

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

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

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

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

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

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

quit exit the program #退出交互式程序

2.configure子命令 #资源粘性、资源类型、资源约束 crm(live)configure# help Available commands: node define a cluster node #定义一个集群节点

primitive define a resource #定义资源

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

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

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

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

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

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

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

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

rsc_ticket resources ticket dependency#

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

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

fencing_topology node fencing order #隔离节点顺序

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

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

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

schema set or display current CIB RNG schema

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

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

filter filter CIB objects #过滤CIB对象

delete delete CIB objects #删除CIB对象

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

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

modgroup modify group #改变资源组

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

erase erase the CIB #清除CIB信息

ptest show cluster actions if changes were committed

rsctest test resources as currently configured

cib CIB shadow management

cibstatus CIB status management and editing

template edit and import a configuration from a template

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

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

upgrade upgrade the CIB to version 1.0

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

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

graph generate a directed graph

xml raw xml

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

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

3.node子命令 #节点管理和状态 crm(live)# node crm(live)node# help Node management and status commands. Available commands: status show nodes status as XML #以xml格式显示节点状态信息

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

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

online set node online #节点重新上线

maintenance put node into maintenance mode

ready put node into ready mode

fence fence node #隔离节点

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

delete delete node #删除 一个节点

attribute manage attributes

utilization manage utilization attributes

status-attr manage status attributes

help show help (help topics for list of topics)

end go back one level

quit exit the program

4.ra子命令 #资源代理类别都在此处 crm(live)# ra crm(live)ra# help Available commands: classes list classes and providers # 为资源代理分类

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

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

providers show providers for a RA and a class

help show help (help topics for list of topics)

end go back one level

quit exit the program

5.show xml 显示完整的xml格式信息 crm(live)configure# show node node1.a.com node node2.a.com #当前集群共有2个节点 property cib-bootstrap-options:
dc-version=1.1.11-97629de \ #DC的版本 cluster-infrastructure="classic openais (with plugin)" \ #底层基础架构(经典的openais,使用plugin方式来运行) expected-quorum-votes=2 \ #当前节点一共有两票 stonith-enabled=false #stonith 设备已被禁用

6.禁用stonith设备(如果没有stonith设备,最好禁用): configure crm(live)configure# property stonith-enabled=false crm(live)configure# commit

crm_verify -L -V #此时再检查就不会检查stoith设备了;

CRM2011资源管理器2.8.5版本新增,Windows域控同步工具,实现Windows域用户的批量创建,批量修改,不同域控服务器之间组织和用户的同步等功能。 目前工具具备的功能有: 1、实体的快速查询(支持中文和实体代码)模糊查询功能,编辑实体窗体; 2、实体属性的快速查询(支持中文和实体代码)模糊查询功能,选择属性单元格,按Ctrl+C是可以复制的,编辑属性功能; 3、Web资源的快速查询(支持中文和英文)模糊查询功能,并能编辑和发布Web资源; 4、角色对实体权限的批量设置,实体对角色的批量设置,权限文件的导出可导入功能,并能修改权限文件具体设置某一实体或角色具体的权限,并能导入系统中; 5、支持不同服务器角色权限设置的比较功能; 6、中文Ribbon工具编辑功能; 7、站点地图编辑功能,实现运行时效果可视化编辑功能; 8、支持解决方案的导出功能 9、系统数据管理功能,支持用户安全角色,业务部门的设置,设置方式可以按业务部门方式,安全角色方式,和具体用户方式,方便系统初用始化用户的设置和查看。 实体数据管理功能,可以编辑实体具体数据,并能设置显示的列和显示顺序,方便进行系统数据的维护。 10、代码笔记管理功能,了添加一些常用代码、技术文章方便查询使用,并增加导入导出功能可以和别人共享自己的代码笔记。 11、复制实体或批量创建实体属性功能。 12、Windows域控同步工具,实现Windows域用户的批量创建,批量修改,不同域控服务器之间组织和用户的同步等功能。
### 如何在 IntelliJ IDEA 中创建 Spring Boot 项目 #### 准备工作 为了顺利创建一个 Spring Boot 项目,在开始之前需要确认已经安装并配置好了以下环境: - **Java JDK**:确保本地已安装适合的 Java 版本。 - **IntelliJ IDEA**:推荐使用 Ultimate 版本,因为它内置了对 Spring 的支持[^1]。 --- #### 创建 Spring Boot 项目的具体步骤 1. 打开 IntelliJ IDEA 并点击 `File` -> `New` -> `Project...` 来启动新建项目向导。 2. 在弹出的新建项目窗口中,选择左侧列表中的 `Spring Initializr`。这一步是基于官方提供的模板服务自动生成基础结构[^1]。 3. 配置 Maven 或 Gradle 构建工具的相关参数: - **Group**: 定义 Maven 工程的 GroupId,通常为公司域名反写形式(如 com.example)。 - **Artifact**: 输入模块名作为 ArtifactId,注意不能包含大写字母[^2]。 - **Name**: 自定义项目名称。 - **Package Name**: 自动生成的基础包路径。 - **Packaging**: 默认选择 jar 包即可,因为 Spring Boot 内嵌 Tomcat 支持通过命令行直接运行 jar 文件。 4. 如果国内网络访问速度较慢,可以选择替换默认的初始化 URL 地址为阿里云镜像站点 https://start.aliyun.com/,从而提高下载效率[^3]。 5. 进入依赖管理界面后勾选所需的 Starter Dependencies,对于基本 Web 应用只需添加 `Spring Web` 即可完成核心功能引入。 6. 点击下一步直至最终生成完毕,此时应该能看到标准目录布局下的 src/main/java 和 resources 子文件夹[^1]。 7. 编辑器会自动加载 pom.xml (如果是 Maven) 或 build.gradle (如果是 Gradle),其中列出了所有必要的库版本号等信息。 8. 启动应用程序类上的 main 方法验证是否成功部署到内存中的服务器实例上。 --- ```java @SpringBootApplication public class DemoApplication { public static void main(String[] args) { SpringApplication.run(DemoApplication.class, args); } } ``` --- #### 常见问题排查 如果按照以上流程操作仍然遇到异常情况,则可以从以下几个角度入手解决: - 检查互联网连接状态良好与否; - 更改仓库源至更稳定的地址比如阿里的开源镜像站; - 查看日志输出定位具体的错误提示语句进一步分析原因所在。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值