因此,我当前的环境是在一对相同的裸机服务器上的centos7。我已经安装了drbd并为DRBD镜像了3 x 100G块设备。然后,我在其中一个块设备上安装了Centos7映像。
我希望Pacemaker可以管理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虚拟机进行管理。
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资源归为一组吗?我一直在扯头发。
您需要使用对共置约束的排序来告诉集群它只能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.xml
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句