High-Availability

起搏器無法啟動 drbd 資源

  • November 10, 2014

這是 crm 配置顯示

[root@node1 /]# crm configure show
node node1
node node1.mycluster.org
node node2
node node2.mycluster.org
primitive Apache apache \
       params configfile="/etc/httpd/conf/httpd.conf" \
       op monitor interval=30s \
       op start timeout=40s interval=0 \
       op stop timeout=60s interval=0 \
       meta target-role=Started
primitive drbd_res ocf:linbit:drbd \
       params drbd_resource=data \
       op monitor interval=29s role=Master \
       op monitor interval=31s role=Slave
primitive failover_ip IPaddr2 \
       params ip=192.168.1.100 cidr_netmask=32 \
       op monitor interval=30s \
       meta target-role=Started
primitive fs_res Filesystem \
       params device="/dev/drbd0" directory="/data" fstype=ext4
ms drbd_master_slave drbd_res \
       meta master-max=1 master-node-max=1 clone-max=2 clone-node-max=1 notify=true target-role=Started
location cli-ban-Apache-on-node2.mycluster.org Apache role=Started -inf: node2.mycluster.org
location cli-ban-drbd_res-on-node1.mycluster.org drbd_res role=Started -inf: node1.mycluster.org
colocation apache_ip_colo inf: Apache failover_ip
colocation fs_drbd_colo inf: fs_res drbd_master_slave:Master
order apache_after_ip Mandatory: failover_ip Apache
order fs_after_drbd Mandatory: drbd_master_slave:promote fs_res:start
property cib-bootstrap-options: \
       dc-version=1.1.10-14.el6_5.3-368c726 \
       cluster-infrastructure="classic openais (with plugin)" \
       expected-quorum-votes=2 \
       stonith-enabled=false \
       no-quorum-policy=ignore

node1 之前:crm 資源啟動 drbd_res

[root@node2 /]# service drbd status
drbd driver loaded OK; device status:
version: 8.3.16 (api:88/proto:86-97)
GIT-hash: a798fa7e274428a357657fb52f0ecf40192c1985 build by phil@Build64R6, 2013-09-27 16:00:43
m:res   cs         ro                 ds                 p  mounted  fstype
0:data  Connected  Secondary/Primary  UpToDate/UpToDate  C

node1之後:crm資源啟動drbd_res

[root@node1 /]# crm resource start drbd_res
   [root@node1 /]# crm status
   Last updated: Thu Nov  6 18:04:43 2014
   Last change: Thu Nov  6 17:51:37 2014 via cibadmin on node1.mycluster.org
   Stack: classic openais (with plugin)
   Current DC: node1.mycluster.org - partition with quorum
   Version: 1.1.10-14.el6_5.3-368c726
   4 Nodes configured, 2 expected votes
   5 Resources configured


   Online: [ node1.mycluster.org node2.mycluster.org ]
   OFFLINE: [ node1 node2 ]

    failover_ip    (ocf::heartbeat:IPaddr2):       Started node1.mycluster.org
    Master/Slave Set: drbd_master_slave [drbd_res]
        Masters: [ node2.mycluster.org ]
        Stopped: [ node1 node1.mycluster.org node2 ]
    fs_res (ocf::heartbeat:Filesystem):    Started node2.mycluster.org
    Apache (ocf::heartbeat:apache):        Started node1.mycluster.org

   Failed actions:
       drbd_res_monitor_29000 on node1.mycluster.org 'ok' (0): call=42, status=complete, last-rc-change='Thu Nov  6 16:02:12 2014', queued=0ms, exec=0ms
       drbd_res_promote_0 on node2.mycluster.org 'unknown error' (1): call=909, status=Timed Out, last-rc-change='Thu Nov  6 15:25:36 2014', queued=20002ms, exec=0ms

它使我在 node2 上的 drbd 關閉,我無法將 node2 設置為輔助…

[root@node2 /]# service drbd status
drbd driver loaded OK; device status:
version: 8.3.16 (api:88/proto:86-97)
GIT-hash: a798fa7e274428a357657fb52f0ecf40192c1985 build by phil@Build64R6, 2013-09-27 16:00:43
m:res   cs          ro               ds                 p       mounted  fstype
0:data  StandAlone  Primary/Unknown  UpToDate/DUnknown  r-----  ext4

我有什麼問題嗎?

您可以嘗試一些事情。首先確保節點可以“看到”彼此。

node1:~# ping node2 && node2:~# ping node1

您不應該忘記的另一件事是 Pacemaker 必須控制 DRBD。起搏器啟動時,DRBD 無法執行。如果是這樣,您將發生各種奇怪的事情。除此之外,您可以發布您的 drbd 配置。

希望這在某種程度上有所幫助。讓我們發布,我自己是一個狂熱的 DRBD 使用者,所以我很想知道解決方案。

擁有更多日誌會有所幫助,但乍一看,我覺得你有一個主/從資源的“target-role=Started”似乎很奇怪。嘗試刪除它。

引用自:https://serverfault.com/questions/643187