[Linux-ha-jp] DRBDのMaster固定化に関して

Back to archive index

Motoharu Kubo mkubo****@3ware*****
2015年 6月 16日 (火) 13:21:25 JST


久保です。

たしかに紹介したページからのリンク先などの情報はheartbeatとの併用前提の
内容ですね。

Heartbeat+Pacemaker、Corosync+Pacemakerのどちらでも使える方法は

https://blog.3ware.co.jp/drbd-users-guide-8.3/s-pacemaker-fencing.html

が参考になると思います。

ただし、corosyncの通信経路(ring)を複数設けていないと、この方法はうまく動
かないはずです。ご注意ください。

On 2015年06月16日 11:14, あきやまじろう wrote:
> 久保さん
> 
> あきやまです。回答ありがとうございます。
> 
> 回答いただいた内容で導入可否の検討をしたいと思います。
> リンク先を参照したところ、Heartbeatでの設定方法に関しての記述はありまし
> たが、
> Corosyncでの設定も可能でしょうか?
> 参考になるサイト等あれば、ご教授いただけると助かります。
> 
> 以上、よろしくお願いします。
> 
> 
> 
> 2015-06-15 21:38 GMT+09:00 Motoharu Kubo <mkubo****@3ware*****
> <mailto:mkubo****@3ware*****>>:
> 
>     あきやまさん
> 
>     久保といいます。
> 
>     https://blog.3ware.co.jp/drbd-users-guide-8.3/s-outdate.html
> 
>     DRBDの通信が切れたときに、セカンダリ側のデータ状態をOutdatedという特別な
>     状態に切り替えることができます。Outdatedは相手と通信が再開するまで解除で
>     きず、ロールをPrimaryに切り替えることも許さないという、特別な保護状態で
>     す。上記ページとこのページからのリンク先を参考に、outdate-peerその他を適
>     切に設定するといいだろうと思います。
> 
>     On 2015年06月15日 17:29, あきやまじろう wrote:
>     > お世話になります。あきやまと申します。
>     >
>     > DRBDのMaster固定化に関して質問です。
>     >
>     > DRBDのスプリットブレインが自動復旧する際のMasterを固定化することは
>     可能で
>     > しょうか?
>     > 現在運用しているマシンでDRBD通信障害でスタンドアロンになった際に
>     > マシンを再起動しましたが、再起動時にSlave側の古いデータで再同期され、
>     > 最新データが消えてしまう事象が発生してしまったので、再発防止策とし
>     て設定
>     > を変更したいと考えています。
>     > 本来ならDRBDコマンド等で復旧を試みるべきなのでしょうが、
>     > 諸事情あり、詳しくないものが独自の判断で再起動を実施してしまうこと
>     があり、
>     > そのような場合も本事象を発生させないようにしたいと考えています。
>     >
>     > 【環境】
>     > Red Hat Enterprise Linux Server 6.1 (for x86)
>     > kernel-2.6.32-431.23.3.el6.i686
>     > corosync-1.4.1-17.el6_5.1.i686
>     > pacemaker-1.1.10-14.el6_5.3.i686
>     > drbd-8.3.16-1.el6.i386
>     >
>     >
>     > 【Pacemaker定義】
>     > node testsv1
>     > node testsv2 \
>     >         attributes standby=off
>     > primitive res_before_test-e lsb:before_test-e \
>     >         op monitor interval=30 timeout=30 \
>     >         op start interval=0 timeout=60 \
>     >         op stop interval=0 timeout=60
>     > primitive res_drbd_quota lsb:drbd_quota \
>     >         op monitor interval=30 timeout=30 \
>     >         op start interval=0 timeout=60 \
>     >         op stop interval=0 timeout=60
>     > primitive res_drbd_r0 ocf:linbit:drbd \
>     >         params drbd_resource=r0 \
>     >         op monitor interval=10 role=Master timeout=30 \
>     >         op monitor interval=30 role=Slave timeout=30 \
>     >         op start interval=0 timeout=240 \
>     >         op stop interval=0 timeout=100
>     > primitive res_filesystem Filesystem \
>     >         params device="/dev/drbd0" directory="/drbd" fstype=ext4
>     > options="noatime,nobarrier,usrquota" \
>     >         op start interval=0 timeout=60 \
>     >         op stop interval=0 timeout=60
>     > primitive res_nmb lsb:nmb \
>     >         op monitor interval=30 timeout=30 \
>     >         op start interval=0 timeout=60 \
>     >         op stop interval=0 timeout=60
>     > primitive res_pgsql lsb:postgresql-9.0 \
>     >         op monitor interval=30 timeout=30 \
>     >         op start interval=0 timeout=60 \
>     >         op stop interval=0 timeout=60
>     > primitive res_samba lsb:smb \
>     >         op monitor interval=30 timeout=30 \
>     >         op start interval=0 timeout=60 \
>     >         op stop interval=0 timeout=60
>     > primitive res_vsftp lsb:vsftpd \
>     >         op monitor interval=30 timeout=30 \
>     >         op start interval=0 timeout=60 \
>     >         op stop interval=0 timeout=60
>     > group rg_filesystem res_filesystem res_drbd_quota
>     > group rg_samba res_samba res_nmb
>     > ms ms_drbd_r0 res_drbd_r0 \
>     >         meta master-max=1 master-node-max=1 clone-max=2
>     clone-node-max=1
>     > notify=true
>     > location l_filesystem rg_filesystem -inf: testsv2
>     > location l_test_drbd ms_drbd_r0 \
>     >         rule 200: #uname eq testsv1 \
>     >         rule 100: #uname eq testsv2
>     > colocation c_filesystem inf: rg_filesystem ms_drbd_r0:Master
>     > colocation c_test inf: res_before_test-e rg_filesystem
>     > colocation c_pgsql inf: res_pgsql rg_filesystem
>     > colocation c_samba inf: rg_samba rg_filesystem
>     > colocation c_vsftp inf: res_vsftp rg_filesystem
>     > order o_filesystem inf: ms_drbd_r0:promote rg_filesystem:start
>     > order o_test 0: rg_samba res_before_test-e:start
>     > order o_pgsql inf: rg_filesystem res_pgsql:start
>     > order o_samba 0: res_vsftp rg_samba:start
>     > order o_vsftp 0: res_pgsql res_vsftp:start
>     > property cib-bootstrap-options: \
>     >         stonith-enabled=false \
>     >         no-quorum-policy=ignore \
>     >         default-resource-stickiness=200 \
>     >         dc-version=1.1.10-14.el6_5.3-368c726 \
>     >         cluster-infrastructure="classic openais (with plugin)" \
>     >         expected-quorum-votes=2
>     >
>     > 【DRBD定義】
>     > global {
>     >         #usage-count yes;
>     >         usage-count no;
>     >         # minor-count dialog-refresh disable-ip-verification
>     > }
>     >
>     > common {
>     >         #protocol C;
>     >
>     >         handlers {
>     >                 # These are EXAMPLE handlers only.
>     >                 # They may have severe implications,
>     >                 # like hard resetting the node under certain
>     circumstances.
>     >                 # Be careful when chosing your poison.
>     >
>     >                 # fence-peer "/usr/lib/drbd/crm-fence-peer.sh";
>     >                 # split-brain "/usr/lib/drbd/notify-split-brain.sh
>     root";
>     >                 # out-of-sync "/usr/lib/drbd/notify-out-of-sync.sh
>     root";
>     >                 # before-resync-target
>     > "/usr/lib/drbd/snapshot-resync-target-lvm.sh -p 15 -- -c 16k";
>     >                 # after-resync-target
>     > /usr/lib/drbd/unsnapshot-resync-target-lvm.sh;
>     >         }
>     >
>     >         startup {
>     >                 # wfc-timeout degr-wfc-timeout outdated-wfc-timeout
>     > wait-after-sb
>     >         }
>     >
>     >         disk {
>     >                 # on-io-error fencing use-bmbv no-disk-barrier
>     > no-disk-flushes
>     >                 # no-disk-drain no-md-flushes max-bio-bvecs
>     >                 no-disk-barrier;
>     >                 no-disk-flushes;
>     >         }
>     >
>     >         net {
>     >                 # sndbuf-size rcvbuf-size timeout connect-int ping-int
>     > ping-timeout max-buffers
>     >                 # max-epoch-size ko-count allow-two-primaries
>     > cram-hmac-alg shared-secret
>     >                 # after-sb-0pri after-sb-1pri after-sb-2pri
>     > data-integrity-alg no-tcp-cork
>     >                 max-buffers 8000;
>     >                 max-epoch-size 8000;
>     >                 after-sb-0pri discard-younger-primary;
>     >                 after-sb-1pri discard-secondary;
>     >                 after-sb-2pri disconnect;
>     >         }
>     >
>     >         syncer {
>     >                 # rate after al-extents use-rle cpu-mask verify-alg
>     > csums-alg
>     >                 rate 30M;
>     >                 verify-alg sha1;
>     >         }
>     > }
>     >
>     >
>     >
>     >
>     > _______________________________________________
>     > Linux-ha-japan mailing list
>     > Linux****@lists***** <mailto:Linux****@lists*****>
>     > http://lists.osdn.me/mailman/listinfo/linux-ha-japan
>     >
> 
>     --
>     ----------------------------------------------------------------------
>     久保  元治             (株)サードウェア
>     Motoharu Kubo          135-0034 東京都墨田区両国2-16-5 あつまビル5F
>     mkubo****@3ware***** <mailto:mkubo****@3ware*****>      URL:
>     http://www.3ware.co.jp/
>                            Phone: 03-4530-8670 03-4530-0521 (内線201)
>                            Fax:   03-6240-2420
>                            携帯:  090-6171-5545
> 
>     _______________________________________________
>     Linux-ha-japan mailing list
>     Linux****@lists***** <mailto:Linux****@lists*****>
>     http://lists.osdn.me/mailman/listinfo/linux-ha-japan
> 
> 
> 
> 
> _______________________________________________
> Linux-ha-japan mailing list
> Linux****@lists*****
> http://lists.osdn.me/mailman/listinfo/linux-ha-japan
> 

-- 
----------------------------------------------------------------------
久保  元治             (株)サードウェア
Motoharu Kubo          135-0034 東京都墨田区両国2-16-5 あつまビル5F
mkubo****@3ware*****      URL: http://www.3ware.co.jp/
                       Phone: 03-4530-8670 03-4530-0521 (内線201)
                       Fax:   03-6240-2420
                       携帯:  090-6171-5545




Linux-ha-japan メーリングリストの案内
Back to archive index