鉴于下面描述的Pacemaker / Corosync资源configuration,是否可以在资源组内的特定位置添加资源? configuration是使用RHEL提供的集群附件的CentOS 7.2。
这是一个NFS服务器集群,Pacemaker处理NFS守护进程,卷,导出,虚拟IP和NFS客户端通知。
当我想要将NFS挂载(exportfs资源)添加到群集设置时,它会在nfs-notify资源之后列出。 这以丑陋的方式打破了集群。
我find了基本的pcs resource order命令,这似乎允许指定资源X需要在资源Y之前运行 ,但这不是可伸缩的。
这可能吗?
[root@zfs1-node1 ~]# pcs status Cluster name: zfs1 Last updated: Tue Jan 5 04:09:11 2016 Last change: Tue Jan 5 04:08:15 2016 by root via cibadmin on zfs1-node1 Stack: corosync Current DC: zfs1-node1 (version 1.1.13-10.el7-44eb2dd) - partition with quorum 2 nodes and 9 resources configured Online: [ zfs1-node1 zfs1-node2 ] Full list of resources: fence-vol1 (stonith:fence_scsi): Started zfs1-node1 Resource Group: group-vol1 vol1 (ocf::heartbeat:ZFS): Started zfs1-node1 nfs-daemon (ocf::heartbeat:nfsserver): Started zfs1-node1 nfsinfo (ocf::heartbeat:exportfs): Started zfs1-node1 vol1-management (ocf::heartbeat:exportfs): Started zfs1-node1 vol1-ppro-mirrors (ocf::heartbeat:exportfs): Started zfs1-node1 vol1-staging (ocf::heartbeat:exportfs): Started zfs1-node1 ip-vol1 (ocf::heartbeat:IPaddr2): Started zfs1-node1 nfs-notify (ocf::heartbeat:nfsnotify): Started zfs1-node1 PCSD Status: zfs1-node1: Online zfs1-node2: Online Daemon Status: corosync: active/enabled pacemaker: active/enabled pcsd: active/enabled
您可以使用cibadmin实用程序来查询Pacemakerconfiguration,相应地在<group id="group-vol1"></group>标记内移动原语,然后将新configuration重新推送到Pacemaker。
这个过程看起来像这样:
# cibadmin --query > /tmp/cib.xml # vi /tmp/cib.xml # cibadmin --replace --xml-file /tmp/cib.xml# cibadmin --query > /tmp/cib.xml # vi /tmp/cib.xml # cibadmin --replace --xml-file /tmp/cib.xml
当你在vi中编辑cib.xml时,你会看到你的组被标签定义如下:
<group id="group-vol1"> *primitives within the group will go here* </group>
所有的原语将在组标签内定义。 他们会看起来像这样(例如ZFS原语:
<primitive id="vol1" class="ocf" provider="heartbeat" type="ZFS"> *attributes and operations will go here* </primitive>
按照您希望的方式移动原始graphics, 第一,最后。 把变化推入起搏器,你应该是好的。