node $id="10" db10 \
attributes standby="off"
node $id="9" db09 \
attributes standby="off"
primitive drbd_jenkins ocf:linbit:drbd \
params drbd_resource="r0" \
op start interval="0s" timeout="60s" \
op stop interval="0s" timeout="60s"
primitive jenkins lsb:jenkins \
op monitor interval="15s" \
op start interval="0s" timeout="90s"
primitive mount_jenkins ocf:heartbeat:Filesystem \
params device="/dev/drbd0" directory="/var/lib/jenkins/" fstype="ext4" \
op start timeout="20s" interval="0" \
op stop timeout="20s" interval="0"
primitive vip-158 ocf:heartbeat:IPaddr2 \
params ip="x.x.x.158" nic="eth0" cidr_netmask="28" \
op start interval="0s" timeout="60s" \
op monitor interval="5s" timeout="20s" \
op stop interval="0s" timeout="60s" \
meta target-role="Started"
group jenkins_group jenkins vip-158 mount_jenkins
ms ms_drbd_jenkins drbd_jenkins \
meta master-max="1" master-node-max="1" clone-max="2" clone-node-max="1" notify="true" globally-unique="false" target-role="Master"
colocation drbd_mount inf: ms_drbd_jenkins:Master jenkins_group
order mount_after_drbd inf: ms_drbd_jenkins:promote jenkins_group:start
property $id="cib-bootstrap-options" \
dc-version="1.1.10-42f2063" \
cluster-infrastructure="corosync" \
stonith-enabled="false" \
last-lrm-refresh="1489005751"
rsc_defaults $id="rsc-options" \
resource-stickiness="0"
심박조율기가 시작되면 모든 것이 정상입니다.
root@db09:~# crm status
Last updated: Wed Mar 8 21:20:33 2017
Last change: Wed Mar 8 21:15:15 2017 via crm_resource on db10
Stack: corosync
Current DC: db10 (10) - partition with quorum
Version: 1.1.10-42f2063
2 Nodes configured
5 Resources configured
Online: [ db09 db10 ]
Master/Slave Set: ms_drbd_jenkins [drbd_jenkins]
Masters: [ db09 ]
Slaves: [ db10 ]
Resource Group: jenkins_group
jenkins (lsb:jenkins): Started db09
vip-158 (ocf::heartbeat:IPaddr2): Started db09
mount_jenkins (ocf::heartbeat:Filesystem): Started db09
하지만 마스터를 db10으로 이동할 수는 없습니다.
crm_resource --resource ms_drbd_jenkins --move --node db10
또는
crm resource migrate ms_drbd_jenkins db10
최악의 부분은 db09 노드를 대기로 설정하면 둘 다 슬레이브가 된다는 것입니다.
root@db09:~# crm node standby db09
root@db09:~# crm status
Last updated: Wed Mar 8 21:27:26 2017
Last change: Wed Mar 8 21:27:24 2017 via crm_attribute on db09
Stack: corosync
Current DC: db10 (10) - partition with quorum
Version: 1.1.10-42f2063
2 Nodes configured
5 Resources configured
Node db09 (9): standby
Online: [ db10 ]
Master/Slave Set: ms_drbd_jenkins [drbd_jenkins]
Slaves: [ db09 db10 ]
db10이 대기 모드로 전환되면 중지됩니다. 이는 예상된 결과입니다.
root@db09:~# crm node standby db10
root@db09:~# crm status
Last updated: Wed Mar 8 21:28:45 2017
Last change: Wed Mar 8 21:28:44 2017 via crm_attribute on db09
Stack: corosync
Current DC: db10 (10) - partition with quorum
Version: 1.1.10-42f2063
2 Nodes configured
5 Resources configured
Node db10 (10): standby
Online: [ db09 ]
Master/Slave Set: ms_drbd_jenkins [drbd_jenkins]
Masters: [ db09 ]
Stopped: [ db10 ]
Resource Group: jenkins_group
jenkins (lsb:jenkins): Started db09
vip-158 (ocf::heartbeat:IPaddr2): Started db09
mount_jenkins (ocf::heartbeat:Filesystem): Started db09
내가 여기서 뭘 잘못하고 있는 걸까?
답변1
호스팅 한도가 올바르지 않습니다. DRBD가 jenkins_group을 시작하는 마스터여야 함을 클러스터에 알립니다.
대신 다음 제약 조건을 사용하세요.
colocation cl_jenkins-with-drbd inf: jenkins_group ms_drbd_jenkins:Master
order o_drbd-before-jenkins inf: ms_drbd_jenkins:promote jenkins_group:start
전문가 팁: 제약 조건 이름의 "언어"를 참고하세요: cl____-with-____
, o____-before-____
. 이는 점수 뒤의 리소스 이름과 일치합니다 inf:
. 제약 조건 이름에서 with
및 명명 규칙을 따르면 before
읽기/관리/문제 해결이 더 쉬워집니다.