DRBD構築時に発生したエラー
DRBDを構築時に遭遇したエラーとその解決手順を説明します。・メタデータ領域の初期化でエラー発生(ignored, since this host ....)
・DRBD起動時のエラー(Failure: (112) Meta device too small.)
メタデータ領域の初期化でエラー発生(ignored, since this host ....)
■メタデータ領域の初期化で発生するエラー# drbdadm create-md db01 'db01' ignored, since this host (dev-db1) is not mentioned with an 'on' keyword.□解決手順
# uname -n dev-db01・/etc/drbd.confファイルの定義変更
# vi /etc/drbd.conf
on dev-db01 { device /dev/drbd0; disk /dev/sdb2; address 192.168.100.104:7788; meta-disk /dev/sdb1[0]; }
DRBD起動時のエラー(Failure: (112) Meta device too small.)
■DRBD起動時のエラー#drbdadm up db01 0: Failure: (112) Meta device too small. Command 'drbdsetup 0 disk /dev/sdb2 /dev/sdb1 0 --set-defaults --create-device --on-io-error=call-local-io-error' terminated with exit code 10□解決手順
PaceMaker+DRBDの運用関連記事
PaceMaker+DRBDの実践運用手順HeartBeat2+DRBD構築【目次】
01. HeartBeat2+DRBD構築 【DRBD構築手順】HeartBeat2+DRBD構築 【DRBD障害対応】
DRBDにおいて、スプリットブレインが発生した場合の障害対応を説明します。DRBDのスプリットブレインを確認
■障害側サーバでスプリットブレインを確認# cat /proc/drbd version: 8.3.8 (api:88/proto:86-94) GIT-hash: d78846e52224fd00562f7c225bcc25b2d422321d build by mockbuild@builder10.centos.org, 2010-06-04 08:04:09 0: cs:StandAlone ro:Secondary/Unknown ds:UpToDate/DUnknown r---- ns:0 nr:0 dw:0 dr:0 al:0 bm:0 lo:0 pe:0 ua:0 ap:0 ep:1 wo:b oos:516
# cat /var/log/messages May 18 13:03:46 dev-db02 kernel: block drbd0: Split-Brain detected but unresolved, dropping connection!
# cat /proc/drbd version: 8.3.8 (api:88/proto:86-94) GIT-hash: d78846e52224fd00562f7c225bcc25b2d422321d build by mockbuild@builder10.centos.org, 2010-06-04 08:04:09 0: cs:StandAlone ro:Primary/Unknown ds:UpToDate/DUnknown r---- ns:0 nr:0 dw:1110652 dr:4109 al:52 bm:0 lo:0 pe:0 ua:0 ap:0 ep:1 wo:b oos:132684
DRBDのスプリットブレインから復旧する手順
■スプリットブレインからの復旧手順(方法1)[db2 ~]# drbdadm down all # drbdadm down all # cat /proc/drbd version: 8.3.8 (api:88/proto:86-94) GIT-hash: d78846e52224fd00562f7c225bcc25b2d422321d build by mockbuild@builder10.centos.org, 2010-06-04 08:04:09 0: cs:Unconfigured
[db2 ~]# drbdadm attach all # drbdadm attach all # cat /proc/drbd version: 8.3.8 (api:88/proto:86-94) GIT-hash: d78846e52224fd00562f7c225bcc25b2d422321d build by mockbuild@builder10.centos.org, 2010-06-04 08:04:09 0: cs:StandAlone ro:Secondary/Unknown ds:UpToDate/DUnknown r---- ns:0 nr:0 dw:0 dr:0 al:0 bm:0 lo:0 pe:0 ua:0 ap:0 ep:1 wo:b oos:516
[db2 ~]# drbdadm invalidate all # drbdadm invalidate all # cat /proc/drbd version: 8.3.8 (api:88/proto:86-94) GIT-hash: d78846e52224fd00562f7c225bcc25b2d422321d build by mockbuild@builder10.centos.org, 2010-06-04 08:04:09 0: cs:StandAlone ro:Secondary/Unknown ds:Inconsistent/DUnknown r---- ns:0 nr:0 dw:0 dr:0 al:0 bm:0 lo:0 pe:0 ua:0 ap:0 ep:1 wo:b oos:6152896
[db2 ~]# drbdadm connect all # drbdadm connect all # cat /proc/drbd version: 8.3.8 (api:88/proto:86-94) GIT-hash: d78846e52224fd00562f7c225bcc25b2d422321d build by mockbuild@builder10.centos.org, 2010-06-04 08:04:09 0: cs:WFConnection ro:Secondary/Unknown ds:Inconsistent/DUnknown C r---- ns:0 nr:0 dw:0 dr:0 al:0 bm:0 lo:0 pe:0 ua:0 ap:0 ep:1 wo:b oos:6152896【正常側サーバ】
[db1 ~]# drbdadm connect all # drbdadm connect all # cat /proc/drbd version: 8.3.8 (api:88/proto:86-94) GIT-hash: d78846e52224fd00562f7c225bcc25b2d422321d build by mockbuild@builder10.centos.org, 2010-06-04 08:04:09 0: cs:SyncSource ro:Primary/Secondary ds:UpToDate/Inconsistent C r---- ns:13420 nr:0 dw:1110652 dr:23181 al:52 bm:0 lo:58 pe:30 ua:234 ap:0 ep:1 wo:b oos:6140416 [>....................] sync'ed: 0.3% (5996/6008)M delay_probe: 0 finish: 0:31:58 speed: 3,120 (3,120) K/sec同期が開始される
PaceMaker+DRBDの運用関連記事
PaceMaker+DRBDの実践運用手順HeartBeat2+DRBD構築【目次】
01. HeartBeat2+DRBD構築 【DRBD構築手順】HeartBeat2+DRBD構築 【Heart運用手順】
HeartBeatの運用手順
・PostgreSQLを再起動する場合【Heart運用手順】
・リソースのスイッチオーバ【Heart運用手順】
・障害発生後の後処理【Heart運用手順】
# crm_resource -p is_managed -r pgsql_4 -t primitive -v off
#/opt/scripts/hb/drbd_postgres_watch.sh suspend※独自監視(drbd_postgres_watch.sh)のCHKDIR変数の値のディレクトリがあることを確認($DBROOT/hb_check)
# /etc/init.d/postgresql restart
# crm_resource -p is_managed -r pgsql_4 -t primitive -v on
# /opt/scripts/hb/drbd_postgres_watch.sh resume
Resource Group: group_1 drbddisk_1 (heartbeat:drbddisk): Started dev-db-01 Filesystem_2 (heartbeat::ocf:Filesystem): Started dev-db01 IPaddr_172_18_50_105 (heartbeat::ocf:IPaddr): Started dev-db01 pgsql_4 (heartbeat::ocf:pgsql): Started dev-db01 (unmanaged) FAILED MailTo_1 (heartbeat::ocf:MailTo): Started dev-db01 Failed actions: pgsql_4_monitor_120000 (node=dev-db01, call=191, rc=7): complete
Resource Group: group_1 drbddisk_1 (heartbeat:drbddisk): Started dev-db01 Filesystem_2 (heartbeat::ocf:Filesystem): Started dev-db01 IPaddr_172_18_50_105 (heartbeat::ocf:IPaddr): Started dev-db01 pgsql_4 (heartbeat::ocf:pgsql): Started dev-db01 (unmanaged) MailTo_1 (heartbeat::ocf:MailTo): Started dev-db01※「(unmanaged)」は、「crm_resource -p is_managed -r pgsql_4 -t primitive -v on」を実行すると消える。
# crm_standby -U `hostname` -v on
# crm_mon Defaulting to one-shot mode You need to have curses available at compile time to enable console mode ============ Last updated: Fri Jul 15 12:45:56 2011 Current DC: dev-db01 (749e05b9-1610-44a6-9c01-dfd37fea7372) 2 Nodes configured. 1 Resources configured. ============ Node: dev-db01 (749e05b9-1610-44a6-9c01-dfd37fea7372): standby Node: dev-db02 (81312dbc-9b48-444c-b669-203c84055c1f): online Resource Group: group_1 drbddisk_1 (heartbeat:drbddisk): Started dev-db02 Filesystem_2 (heartbeat::ocf:Filesystem): Started dev-db02 IPaddr_172_18_50_105 (heartbeat::ocf:IPaddr): Started dev-db02 pgsql_4 (heartbeat::ocf:pgsql): Started dev-db02 MailTo_1 (heartbeat::ocf:MailTo): Started dev-db02
# crm_standby -U `hostname` -v off
# crm_mon : 省略 : Node: dev-db01 (749e05b9-1610-44a6-9c01-dfd37fea7372): online Node: dev-db02 (81312dbc-9b48-444c-b669-203c84055c1f): online Resource Group: group_1 drbddisk_1 (heartbeat:drbddisk): Started dev-db02 Filesystem_2 (heartbeat::ocf:Filesystem): Started dev-db02 IPaddr_172_18_50_105 (heartbeat::ocf:IPaddr): Started dev-db02 pgsql_4 (heartbeat::ocf:pgsql): Started dev-db02 MailTo_1 (heartbeat::ocf:MailTo): Started dev-db02※スタンバイ状態でサーバを再起動をするとHeartbeatが起動してこないので、手動で起動する必要があります。
# crm_resource -C -H `uname -n` -r pgsql_4※「`uname -n`」は、 障害発生したサーバ名を指定する。
Failed actions:
pgsql_4_start_0 (node=dev-db01, call=75, rc=-2): Timed Out
HeartBeat2+DRBD構築【目次】
01. HeartBeat2+DRBD構築 【DRBD構築手順】