[Linux-ha-jp] リソース停止時のフェイルオーバについて

Zurück zum Archiv-Index

renay****@ybb***** renay****@ybb*****
2009年 10月 15日 (木) 13:13:57 JST


稲垣さん

こんにちは。メイトリックスの山内です。

下記、実施された方法で問題ないと思います。

> 対処方法としてはどのような方法が考えられるでしょうか?
mysqldのスクリプト内で、mysqlの起動判定を行う必要があると思います。

> # /etc/init.d/mysqld status ; echo $?
> mysqld は停止しています
> 3
停止中は、statusが3を返しておりますので、stop時にこれをstatusを実行して、3の場合は、
停止済みでOK(0)を返していただければよいのではないでしょうか?

# /etc/init.d/mysqld stop ; echo $?
MySQL を停止中:                                            [失敗]
0...(となるよう)

ただし、mysqldに手を入れることになってしまうので、あまり好ましくない場合もありますね。

mysql用のリソースには、lsbリソースではなく、ocfリソースもありますので、そちらの
利用の方がうまく行くかと思いますが。。。。

以上、よろしくお願いいたします。


--- 稲垣 <tadas****@gmail*****> wrote:

> メイトリックス 山内様
> 
> 早速のご返信ありがとうございます。
> 
> 山内様がおっしゃられているのは下記URLにあるチェック方法でよろしいでしょうか。
> http://www.linux-ha.org/ja/LSBResourceAgent_ja
> 
> 結果は以下のようになりました。
> # /etc/init.d/mysqld start ; echo $?
> MySQL を起動中:                                            [  OK  ]
> 0
> #
> #
> # /etc/init.d/mysqld status ; echo $?
> mysqld (pid 25755) を実行中...
> 0
> # /etc/init.d/mysqld start ; echo $?
> MySQL を起動中:                                            [  OK  ]
> 0
> # /etc/init.d/mysqld stop ; echo $?
> MySQL を停止中:                                            [  OK  ]
> 0
> #
> #
> # /etc/init.d/mysqld status ; echo $?
> mysqld は停止しています
> 3
> # /etc/init.d/mysqld stop ; echo $?
> MySQL を停止中:                                            [失敗]
> 1
> 
> どうやらプロセス停止時の停止がうまくいってないみたいですね。
> 
> 対処方法としてはどのような方法が考えられるでしょうか?
> 
> 以上、宜しくお願いいたします。
> 
> 
> 2009年10月15日12:09  <renay****@ybb*****>:
> > 稲垣さん
> >
> > こんにちは。メイトリックスの山内です。
> >
> > 同一環境で試していませんが、mysqlのstopに失敗していることが原因です。
> >
> >
> mysqlのlsbスクリプトの停止実行(stop)で、mysqlがkillされている状態の場合に、正しい戻り値(0)が返って
い
> > るかどうか確認してみてください。
> >
> > 以上、よろしくお願いいたします。
> >
> >
> > --- 稲垣 <tadas****@gmail*****> wrote:
> >
> >> お世話になっております。稲垣と申します。
> >>
> >> 掲題の件について質問させてください。
> >>
> Heartbeatのリリース2の場合、プロセスもしくはサービス(本環境ではMySQLのプロセス)が停止するとフェイ
> > ルオーバするものと思っておりますが、
> >> 現環境ではフェイルオーバが実行されず、下記【手順】のようになってしまいます。
> >> 尚、プロセスをkillする場合とinitスクリプトを停止する場合でも同じ結果となりました。
> >> 添付したcib.xmlファイルに不備等ありますか?
> >>
> >> 【手順】
> >> # ps -ef | grep mysql
> >> root      2397 27259  0 18:22 pts/1    00:00:00 grep mysql
> >> root      3068     1  0 01:38 ?        00:00:00 /bin/sh
> >> /usr/bin/mysqld_safe --datadir=/var/lib/mysql
> >> --socket=/var/lib/mysql/mysql.sock --log-error=/var/log/mysqld.log
> >> --pid-file=/var/run/mysqld/mysqld.pid --federated --user=mysql
> >> mysql     3182  3068  0 01:38 ?        00:00:01 /usr/libexec/mysqld
> >> --basedir=/usr --datadir=/var/lib/mysql --user=mysql --federated
> >> --log-error=/var/log/mysqld.log --pid-file=/var/run/mysqld/mysqld.pid
> >> --socket=/var/lib/mysql/mysql.sock
> >>
> >> # kill -9 2397 3068
> >>
> >> # crm_mon -1
> >>
> >>
> >> ============
> >> Last updated: Sat Oct 17 07:29:25 2009
> >> Current DC: hoge02.example.com (91e0db86-1aaf-47a9-a80f-bc198c4c8969)
> >> 2 Nodes configured.
> >> 1 Resources configured.
> >> ============
> >>
> >> Node: hoge02.example.com (91e0db86-1aaf-47a9-a80f-bc198c4c8969): online
> >> Node: hoge01.example.com (dbdb4396-8c57-4f70-878f-a6984ec7d554): online
> >>
> >> Resource Group: test-db
> >>     IPaddr2_1   (ocf::heartbeat:IPaddr2):       Started hoge01.example.com
> >>     drbddisk_2  (heartbeat:drbddisk):   Started hoge01.example.com
> >>     Filesystem_3        (ocf::heartbeat:Filesystem):    Started
> >> hoge01.example.com
> >>     mysqld_4    (lsb:mysqld):   Started hoge01.example.com (unmanaged) FAILED
> >>
> >> Failed actions:
> >>     mysqld_4_monitor_120000 (node=hoge01.example.com, call=13, rc=7): complete
> >>     mysqld_4_stop_0 (node=hoge01.example.com, call=14, rc=1): complete
> >>
> >>
> >> 検証環境は以下の通りです。
> >> OS: CentOS5.3
> >> Heartbeat 2.1.4-1
> >>
> >>
> >> 以上、宜しくお願いいたします。
> >> >  <cib admin_epoch="0" generated="true" have_quorum="true" ignore_dtd="false" num_peers="2"
> >> cib_feature_revision="2.0" crm_feature_set="2.0" ccm_transition="2" epoch="69"
> >> dc_uuid="91e0db86-1aaf-47a9-a80f-bc198c4c8969" num_updates="3" cib-last-written="Fri Oct 16
> >> 01:38:10 2009">
> >>    <configuration>
> >>      <crm_config>
> >>        <cluster_property_set id="cib-bootstrap-options">
> >>          <attributes>
> >>            <nvpair id="cib-bootstrap-options-symmetric-cluster" name="symmetric-cluster"
> >> value="true"/>
> >>            <nvpair id="cib-bootstrap-options-no-quorum-policy" name="no-quorum-policy"
> >> value="stop"/>
> >>            <nvpair id="cib-bootstrap-options-default-resource-stickiness"
> >> name="default-resource-stickiness" value="INFINITY"/>
> >>            <nvpair id="cib-bootstrap-options-default-resource-failure-stickiness"
> >> name="default-resource-failure-stickiness" value="0"/>
> >>            <nvpair id="cib-bootstrap-options-stonith-enabled" name="stonith-enabled"
> >> value="false"/>
> >>            <nvpair id="cib-bootstrap-options-stonith-action" name="stonith-action"
> >> value="reboot"/>
> >>            <nvpair id="cib-bootstrap-options-startup-fencing" name="startup-fencing"
> >> value="true"/>
> >>            <nvpair id="cib-bootstrap-options-stop-orphan-resources"
> name="stop-orphan-resources"
> >> value="true"/>
> >>            <nvpair id="cib-bootstrap-options-stop-orphan-actions" name="stop-orphan-actions"
> >> value="true"/>
> >>            <nvpair id="cib-bootstrap-options-remove-after-stop" name="remove-after-stop"
> >> value="false"/>
> >>            <nvpair id="cib-bootstrap-options-short-resource-names"
> name="short-resource-names"
> >> value="true"/>
> >>            <nvpair id="cib-bootstrap-options-transition-idle-timeout"
> >> name="transition-idle-timeout" value="5min"/>
> >>            <nvpair id="cib-bootstrap-options-default-action-timeout"
> >> name="default-action-timeout" value="20s"/>
> >>            <nvpair id="cib-bootstrap-options-is-managed-default" name="is-managed-default"
> >> value="true"/>
> >>            <nvpair id="cib-bootstrap-options-cluster-delay" name="cluster-delay"
> value="60s"/>
> >>            <nvpair id="cib-bootstrap-options-pe-error-series-max" name="pe-error-series-max"
> >> value="-1"/>
> >>            <nvpair id="cib-bootstrap-options-pe-warn-series-max" name="pe-warn-series-max"
> >> value="-1"/>
> >>            <nvpair id="cib-bootstrap-options-pe-input-series-max" name="pe-input-series-max"
> >> value="-1"/>
> >>            <nvpair id="cib-bootstrap-options-dc-version" name="dc-version"
> >> value="2.1.4-fb84f606a422 tip"/>
> >>          </attributes>
> >>        </cluster_property_set>
> >>      </crm_config>
> >>      <nodes>
> >>        <node id="91e0db86-1aaf-47a9-a80f-bc198c4c8969" uname="hoge02.example.com"
> type="normal">
> >>          <instance_attributes id="nodes-91e0db86-1aaf-47a9-a80f-bc198c4c8969">
> >>            <attributes>
> >>              <nvpair id="standby-91e0db86-1aaf-47a9-a80f-bc198c4c8969" name="standby"
> >> value="off"/>
> >>            </attributes>
> >>          </instance_attributes>
> >>        </node>
> >>        <node id="dbdb4396-8c57-4f70-878f-a6984ec7d554" uname="hoge01.example.com"
> >> type="normal"/>
> >>      </nodes>
> >>      <resources>
> >>        <group id="test-db">
> >>          <primitive class="ocf" id="IPaddr2_1" provider="heartbeat" type="IPaddr2">
> >>            <operations>
> >>              <op id="IPaddr2_1_mon" interval="5s" name="monitor" timeout="5s"/>
> >>            </operations>
> >>            <instance_attributes id="IPaddr2_1_inst_attr">
> >>              <attributes>
> >>                <nvpair id="IPaddr2_1_attr_0" name="ip" value="172.31.208.220"/>
> >>                <nvpair id="IPaddr2_1_attr_1" name="nic" value="eth0"/>
> >>                <nvpair id="IPaddr2_1_attr_2" name="cidr_netmask" value="24"/>
> >>                <nvpair id="IPaddr2_1_attr_3" name="broadcast" value="172.31.208.255"/>
> >>              </attributes>
> >>            </instance_attributes>
> >>          </primitive>
> >>          <primitive class="heartbeat" id="drbddisk_2" provider="heartbeat" type="drbddisk">
> >>            <operations>
> >>              <op id="drbddisk_2_mon" interval="120s" name="monitor" timeout="60s"/>
> >>            </operations>
> >>            <instance_attributes id="drbddisk_2_inst_attr">
> >>              <attributes>
> >>                <nvpair id="drbddisk_2_attr_1" name="1" value="r0"/>
> >>              </attributes>
> >>            </instance_attributes>
> >>          </primitive>
> >>          <primitive class="ocf" id="Filesystem_3" provider="heartbeat" type="Filesystem">
> >>            <operations>
> >>              <op id="Filesystem_3_mon" interval="120s" name="monitor" timeout="60s"/>
> 
=== 以下のメッセージは省略されました ===





Linux-ha-japan メーリングリストの案内
Zurück zum Archiv-Index