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構築手順】