2017年5月11日木曜日

dlmのフェンシング(その2)

前回、dlm_tool fence_ack で復旧出来ることを書いたが、この情報にたどり着くまでの経緯。

現象を発生させるために再現テストを行っていたら、syslog に dlm_stonith というキーワードが出力されていることに気付いた。
でも、そもそも stonith は pacemaker を使用している時等に使うフェンシングツールだ。今回は pacemaker も入れていないため、何故 stonith というキーワードがログに記録されるのか、ちょっと謎だった。
で、dlm_stonith の man を見てみたところ、以下のような記述が。
-----
dlm_controld  can  use  dlm_stonith  as  a  proxy  fence agent when the stonith/pacemaker system performs actual fencing.
-----
どうやら、dlm が stonith と通信する時に、その間を取り持つツール・コマンドのようだ。
そもそも stonith が導入されていないのだから、正しく動くわけがない。

更に以下のような記載がある。
-----
If fencing was successful, this program has a zero exit code.  If fencing failed, this program has a non-zero exit code.
-----
成功した時はリターンコード0、失敗した時は0以外、とのこと。

つまり、stonith が動いていない以上、必ず失敗する、ということだ。
どうも、フェンシングに関して特に指定していなければ、dlm_stonith が動くようだ。

ということは、dlm.conf でフェンシングの設定をイジればいいのではないか?ということで調査をしていったところ、gfs2 の man の dlm.conf の項に以下のような記載があった。
-----
* To use no fencing, use this line:
enable_fencing=0

* To use no fencing, but exercise fencing functions, use this line:
fence_all /bin/true
:
* To use manual fencing, use this line:
fence_all /bin/false
The "false" binary will be executed for all nodes and will fail (exit1) immediately.
When a node fails, manually run: dlm_tool fence_ack <nodeid>

* To use stonith/pacemaker for fencing, use this line:
fence_all /usr/sbin/dlm_stonith
The "dlm_stonith" binary will be executed for all nodes.
If stonith/pacemaker systems are not available, dlm_stonith will fail and this config becomes the equivalent of the previous /bin/false config.
-----
どうやら、フェンシングを使用しない場合は dlm.conf に enable_fencing=0 を書けばいいだけのようだ。
今回の構成ならこれで良いっぽい。
フェンシング処理はしないが、フェンシングの機能を使いたいという場合(良くワカランが…)、enable_fencing=1 にしつつ、fence_all /bin/true を書けばいいっぽい。

で、dlm_stonith が動くパターンは、失敗した時の挙動は fance_all /bin/false を指定した時と同じだ、とのこと。

で、fance_all /bin/false を指定した場合ってのが…手作業でフェンシングする形式らしい。
でその中に dlm_tool fence_ack <nodeid> が書いてあって、手作業でフェンシングする時はこのコマンドだよ、と。

という流れでようやくヒントが掴めた。
次回からは、dlm.conf を書き換えて検証することにする。

0 件のコメント:

コメントを投稿