因此,我当前的环境是一对相同的裸金属服务器上的centos7。我已经安装了drbd,并分割了3x100G块设备,以便DRBD镜像。然后我在其中一个块设备上安装了一个Centos7映像。
我想让Pac怪人管理DRBD以及xen虚拟映像,所以我遵循了clusterlabs.org的“从零开始集群”文档中指定的方向:
pcs cluster cib drbd_cfg
pcs -f drbd_cfg resource create XenHost01_Storage ocf:linbit:drbd drbd_resource=XenHost01 op monitor interval=60s
pcs -f drbd_cfg resource master XenHost01_StorageClone XenHost01_Storage master-max=1 master-node-max=1 clone-max=2 clone-node-max=1 notify=true
pcs cluster cib-push drbd_cfg然后,我还添加了要管理的Xen vm。
pcs cluster cib vmstate_cfg
pcs -f vmstate_cfg resource create XenHosts --group vminit systemd:vmstate op monitor interval=10s
pcs cluster cib-push vmstate_cfg所以我的集群资源应该是这样的:
Full list of resources:
Master/Slave Set: XenHost01_StorageClone [XenHost01_Storage]
Masters: [ ha1 ]
Slaves: [ ha2 ]
Resource Group: vminit
XenHosts (systemd:vmstate): Started ha1
PCSD Status:
ha1: Online
ha2: Online我试图找出的是,以及我发表文章的原因,是如何将DRBD主/从对放在vminit组下,以便Xen虚拟机只能在主DRBD主机上启动。如果在一个组中没有它们,如果另一个主机在DRBD中显示为主主机,集群就不会在意,仍然会尝试启动虚拟映像,并将失败。
有人知道如何将主从drbd资源放在一个组下吗?我一直在扯头发。
发布于 2016-06-08 14:43:31
您需要使用排序定位约束来告诉集群,它只能启动vminit组,其中XenHost01_StorageClone是主节点。
以下是为你做的事:
# pcs cluster cib cib_constraints.xml
# pcs -f cib_constraints.xml constraint order promote XenHost01_StorageClone then start vminit
# pcs -f cib_constraints.xml constraint colocation add vminit with master XenHost01_StorageClone
# pcs cluster verify cib_constraints.xml
# pcs cluster cib-push cib_constraints.xmlhttps://unix.stackexchange.com/questions/288238
复制相似问题