文档详情

PCS命令配置corosyncpacemaker群集操作步骤.doc

发布:2017-12-23约1.16万字共15页下载文档
文本预览下载声明
PCS命令配置corosyncpacemaker群集操作步骤 使用pcs shell配置corosync pacemaker群集 Pacemaker Pacemaker,即Cluster Resource Manager(CRM),管理整个HA,客户端通过pacemaker管理监控整个集群。 CRM支持ocf和lsb两种资源类型: ocf格式的启动脚本在/usr/lib/ocf/resource.d/下面。 lsb的脚本一般在/etc/rc.d/init.d/下面。 1、常用的集群管理工具: (1)基于命令行 crm shell/pcs (2)基于图形化 pygui/hawk/lcmc/pcs 2、相关的资源文件: (1)/usr/lib/ocf/resource.d,pacemaker资源库文件位置,可安装资源包:resource-agents 获取更多ocf格式的资源。 (2)/usr/sbin/fence_***,Fencing设备的执行脚本名称,可安装资源包:fence-agents 获取更多Fencing设备资源。 3、查看使用说明: [shell]# man ocf_heartbeat_*** ## 查看OCF资源说明,man ocf_heartbeat_apache [shell]# man fence_*** ## 查看Fencing设备说明,man fence_vmware 4、参考文档 /ClusterLabs /doc/ /doc/mans/mans.html /documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Configuring_the_Red_Hat_High_Availability_Add-On_with_Pacemaker/index.html 在群集配置过程中参考了互联网上众多优秀文章,在此感谢原作者!!! 以下记录整理了在vmware esxi5.5 + centos6.6环境中使用PCS命令配置corosync pacemaker群集的一些操作,由于本人水平有限,仅供参考: 1.安装群集软件: [shell]# yum -y install corosync pacemaker pcs [shell]# yum -y install fence-agents resource-agents 2.拷贝配置文件、启动脚本 [shell]# mkdir -p /etc/cluster/ [shell]# ln -s /etc/rc.d/init.d/corosync /etc/rc.d/init.d/cman [shell]# ln -s /usr/sbin/corosync-cmapctl /usr/sbin/corosync-objctl [shell]# cp /etc/corosync/corosync.conf.example /etc/corosync/corosync.conf 注意:群集需要严格的时间同步机制,如果启用了防火墙需要开放相应的端口。 PCS(Pacemaker/Corosync configuration system)命令配置群集示例: 一、建立群集: 1、配置群集节点的认证as the hacluster user: [shell]# pcs cluster auth node11 node12 2、创建一个二个节点的群集 [shell]# pcs cluster setup --name mycluster node11 node12 [shell]# pcs cluster start --all ## 启动群集 3、设置资源默认粘性(防止资源回切) [shell]# pcs resource defaults resource-stickiness=100 [shell]# pcs resource defaults 4、设置资源超时时间 [shell]# pcs resource op defaults timeout=90s [shell]# pcs resource op defaults 5、二个节点时,忽略节点quorum功能 [shell]# pcs property set no-quorum-policy=ignore 6、没有 Fencing设备时,禁用STONITH 组件功能 在 stonith-enabled=false 的情况下,分布式锁管理器 (DLM) 等资源以及依赖DLM 的所有服务(例如 cLVM2、GFS2 和 OCFS2)都将无法启动。 [shell]# pcs property set stonith-e
显示全部
相似文档