Drbd

DRBD 起搏器失敗

  • December 11, 2017

我是 Pacemaker 和 DRBD 的新手,但我必須將它們一起配置。我創建了 2 個 drbd 資源: Drbdwww 和 DrbdMysql 但是當我使用 drbd_mon 時出現以下錯誤:

Stack: corosync
Current DC: s-ha-web1 (version 1.1.15-e174ec8) - partition with quorum
Last updated: Mon May  8 21:58:45 2017          Last change: Mon May  8 21:58:36 2017 by hacluster via crmd on s-ha-web1

2 nodes and 7 resources configured

Online: [ s-ha-web1 s-ha-web2 ]

Resource Group: haweb
    vip        (ocf::heartbeat:IPaddr2):       Started s-ha-web1
    httpd      (ocf::heartbeat:apache):        Started s-ha-web1
    Drbdwww    (ocf::linbit:drbd):     FAILED (blocked)[ s-ha-web1 s-ha-web2 ]
    fsDrbdwww  (ocf::heartbeat:Filesystem):    Stopped
    DrbdMysql  (ocf::linbit:drbd):     FAILED (blocked)[ s-ha-web1 s-ha-web2 ]
    fsDrbdMysql        (ocf::heartbeat:Filesystem):    Stopped
    mysql      (ocf::heartbeat:mysql): Stopped

Failed Actions:
* Drbdwww_monitor_0 on s-ha-web1 'not configured' (6): call=14, status=complete, exitreason='none',
   last-rc-change='Mon May  8 21:58:40 2017', queued=0ms, exec=21ms
* DrbdMysql_stop_0 on s-ha-web1 'not configured' (6): call=23, status=complete, exitreason='none',
   last-rc-change='Mon May  8 21:58:40 2017', queued=0ms, exec=30ms
* Drbdwww_stop_0 on s-ha-web2 'not configured' (6): call=32, status=complete, exitreason='none',
   last-rc-change='Mon May  8 21:58:40 2017', queued=0ms, exec=17ms
* DrbdMysql_stop_0 on s-ha-web2 'not configured' (6): call=31, status=complete, exitreason='none',
   last-rc-change='Mon May  8 21:58:40 2017', queued=0ms, exec=17ms

這是我的起搏器配置:

crm configure property stonith-enabled=false
crm configure property no-quorum-policy=ignore

crm configure primitive vip ocf:heartbeat:IPaddr2 params ip=192.168.100.100 cidr_netmask=24 nic="eth1" op monitor interval="30s" timeout="20s"

crm configure primitive Drbdwww ocf:linbit:drbd params drbd_resource="rwww" op monitor interval="30s" role="Slave" op monitor interval="29s" role="Master" 

crm configure primitive fsDrbdwww ocf:heartbeat:Filesystem params device="/dev/drbd0" directory="/var/www/html" fstype="ext4"

crm configure primitive DrbdMysql ocf:linbit:drbd params drbd_resource="rmysql" op monitor interval="30s" role="Slave" op monitor interval="29s" role="Master" 

crm configure primitive fsDrbdMysql ocf:heartbeat:Filesystem params device="/dev/drbd1" directory="/var/lib/mysql_drbd" fstype="ext4"

有人能幫我嗎 ?如果您需要更多資訊,請告訴我。

你在這裡錯過了很多。

首先,您需要為每個 DRBD 設備設置一個主從資源集。

然後,您可能想要創建資源組(fs、ip、服務),使用託管和排序約束來告訴這些組僅在其各自的 DRBD 設備被提升為主設備的位置/之後開始。資源組意味著組內資源的託管和排序。

Google 應該提供大量關於使用 DRBD 和 Pacemaker 設置 HA LAMP 堆棧的指南。

編輯:以答案的形式提供了更多資訊……我現在可以更具體了。

這就是您的 CIB(起搏器配置)應如下所示:

node 1: s-ha-web1
node 2: s-ha-web2
primitive Drbdwww ocf:linbit:drbd \
   params drbd_resource="rwww" \
   op monitor interval="30s" role="Slave" \
   op monitor interval="29s" role="Master"
primitive DrbdMysql ocf:linbit:drbd \
   params drbd_resource="rmysql" \
   op monitor interval="30s" role="Slave" \
   op monitor interval="29s" role="Master"
primitive fsDrbdwww ocf:heartbeat:Filesystem \
   params device="/dev/drbd0" directory="/var/www/html" fstype="ext4" \
   op monitor interval=30s timeout=30s
primitive fsDrbdMysql ocf:heartbeat:Filesystem \
   params device="/dev/drbd1" directory="/var/lib/mysql_drbd" fstype="ext4" \
   op monitor interval=30s timeout=30s
primitive vipwww ocf:heartbeat:IPaddr2 \
   params ip=192.168.100.100 cidr_netmask=24 nic="eth1" \
   op monitor interval="30s" timeout="20s"
primitive vipmysql ocf:heartbeat:IPaddr2 \
   params ip=192.168.100.101 cidr_netmask=24 nic="eth1" \
   op monitor interval="30s" timeout="20s"
primitive httpd ocf:heartbeat:apache \
   op start interval=0s timeout=40s
   op stop interval=0s timeout=60s
   op monitor interval=20s timeout=20s
primitive mysql ocf:heartbeat:mysql \
   op start interval=0s timeout=120s
   op stop interval=0s timeout=120s
   op monitor interval=20s timeout=30s
group gwww fsDrbdwww vipwww httpd
group gmysql fsDrbdMysql vipmysql mysql
order o_drbdwww-before-gwww inf: ms_drbdwww:promote gwww:start
colocation cl_gwww-with-drbdwww inf: gwww ms_drbdwww:Master
order o_drbdMysql-before-gmysql inf: ms_drbdMysql:promote gmysql:start
colocation cl_gmysql-with-drbdMysql inf: gmysql ms_drbdMysql:Master
ms ms_drbdwww Drbdwww \
   meta master-max=1 master-node-max=1 clone-max=2 clone-node-max=1 notify=true
ms ms_drbdMysql DrbdMysql \
   meta master-max=1 master-node-max=1 clone-max=2 clone-node-max=1 notify=true
property cib-bootstrap-options: \
   stonith-enabled=false \
   no-quorum-policy=ignore

對 DRBD 資源的操作失敗可能意味著您沒有正確設置 DRBD 設備。您是否已經為設備創建了元數據?如果是這樣,您是否已經強制將一個節點提升到主節點以開始初始同步?的輸出是cat /proc/drbd什麼樣的?

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