Mailing List Archive

Re: CentOS6.5でpacemaker.combinedで自動起動する方法について
木下さん

こんにちは、山内です。

pacemaker.combined.confは自動起動に対応して以下の変更がPM1.1.12以降に入っています。

https://github.com/ClusterLabs/pacemaker/blob/master/mcp/pacemaker.combined.upstart.in


こちらを参考に修正すれば起動出来ると思います。

以上です。


----- Original Message -----
> From: 木下 正昭 <kinoshita@tdc.co.jp>
> To: "linux-ha-japan@lists.sourceforge.jp" <linux-ha-japan@lists.sourceforge.jp>
> Cc:
> Date: 2015/8/21, Fri 17:55
> Subject: [Linux-ha-jp] CentOS6.5でpacemaker.combinedで自動起動する方法について
>
> はじめまして。
> TDCソフトの木下と申します。
>
> 現在、CentOS6.5でpacemaker+corosync+drbd+mysqlで環境構築をしております。
>
> Linux-HAからリポジトリ(pacemaker-repo-1.1.12-1.1.el6.x86_64.rpm)をインストールして、
> yum install pacemaker-allでインストールしています。
>
> 各バージョンが、以下になっております。
> CentOS6.5(x86_64)
> pacemaker(1.1.12)
> corosync(2.3.4-1)
> drbd(8.4.3-1)
>
> 2ノードでactive/sandbyにしています。
>
> linux-ha.osdn.jp/wp/wp-content/uploads/OSC-Tokyo2014Fall.pdf
> を参考に構築しましたが、OS起動時のサービス自動起動について質問がございます。
>
> CentOS6.5で構築するにあたり、起動スクリプトはUpstart形式で設定して、
> 手動でinitctl start pacemaker.combinedをコマンド実行すると正しく起動しますが、
> OSを再起動すると自動起動しません。
>
> http://linux-ha.osdn.jp/wp/archives/4051も参考にしていますが、
> 所謂/etc/init.d/形式でのchkconfig hoge onな記載ではないので、よく分かりません。
>
> 試しに/etc/init.d/形式でのchkconfig corosync onとchkconfig pacemaker onでの自動起動は
> うまく行きましたが、watchdogでの監視をさせたいのでUpstart方式で起動させたいです。
>
> /etc/init/pacemaker.combined.conf内にstart on runlevel [2345]の記載が無いからかと
> 記述して試しましたが、うまく自動起動しません。
>
> 自動起動しない原因が下記confファイルから間違いがあれば、ご指摘頂ければと思います。
> よろしくお願いいたします。
>
>
> ---/etc/corosync/corosync.conf---
> # Please read the corosync.conf.5 manual page
> totem {
>         version: 2
>         rrp_mode: active
>         token: 1000
>         interface {
>                 ringnumber: 0
>                 bindnetaddr: 192.168.220.0
>                 mcastaddr: 239.255.1.1
>                 mcastport: 5405
>         }
>         interface {
>                 ringnumber: 1
>                 bindnetaddr: 192.168.221.0
>                 mcastaddr: 239.255.1.1
>                 mcastport: 5405
>         }
> }
>
> logging {
>         fileline: off
>         to_logfile: yes
>         to_syslog: yes
>         logfile: /var/log/cluster/corosync.log
>         debug: off
>         timestamp: on
>         logger_subsys {
>                 subsys: QUORUM
>                 debug: off
>         }
> }
>
> quorum {
>         provider: corosync_votequorum
>         expected_votes: 2
> }
> ---/etc/corosync/corosync.conf---
>
>
>
> corosync-keygen -lで/etc/corosync/authkeyを対向ノードにコピーしています。
>
>
>
> ---/etc/sysconfig/pacemaker---
>
> # diff -u pacemaker_default pacemaker
> --- pacemaker_default  2015-08-18 17:24:18.000000000 +0900
> +++ pacemaker  2015-08-21 13:19:04.513453641 +0900
> @@ -65,7 +65,7 @@
> # PCMK_schema_directory=/some/path
>
> # Enable this for rebooting this machine at the time of process (subsystem)
> failure
> -# PCMK_fail_fast=no
> +export PCMK_fail_fast=yes
>
> #==#==# Pacemaker Remote
> # Use a custom directory for finding the authkey.
>
> ---/etc/sysconfig/pacemaker---
>
>
>
>
> ---/etc/init/corosync.conf---
>
> デフォルトのままです。
>
> ---/etc/init/corosync.conf---
>
>
>
> ---/etc/init/pacemaker.combined.conf---
>
> # diff -u pacemaker.combined.conf_deafult pacemaker.combined.conf
> --- pacemaker.combined.conf_deafult    2014-09-04 19:38:20.000000000 +0900
> +++ pacemaker.combined.conf    2015-08-21 16:13:56.414985467 +0900
> @@ -2,6 +2,7 @@
> #
> # Starts Corosync cluster engine and Pacemaker cluster manager.
>
> +stop on runlevel [0123456]
> kill timeout 3600
> respawn
>
> @@ -20,7 +21,7 @@
> pre-start script
>     # setup the software watchdog which corosync uses.
>     # rewrite according to environment.
> -    modprobe softdog soft_margin=60
> +    [ -c /dev/watchdog ] || modprobe softdog soft_margin=6
>     pidof corosync || start corosync
>
>     # if you use corosync-notifyd, uncomment the line below.
> @@ -49,7 +50,7 @@
>     rm -f /var/run/$prog.pid
>
>     # if you use watchdog of corosync, uncomment the line below.
> -    #pidof corosync || false
> +    pidof corosync || false
>
>     pidof crmd || stop corosync
>
> ---/etc/init/pacemaker.combined.conf---
>
> _______________________________________________
> Linux-ha-japan mailing list
> Linux-ha-japan@lists.osdn.me
> http://lists.osdn.me/mailman/listinfo/linux-ha-japan
>

_______________________________________________
Linux-ha-japan mailing list
Linux-ha-japan@lists.osdn.me
http://lists.osdn.me/mailman/listinfo/linux-ha-japan
Re: CentOS6.5でpacemaker.combinedで自動起動する方法について [ In reply to ]
木下さん

こんにちは、山内です。

pacemaker.combined.confは自動起動に対応して以下の変更がPM1.1.12以降に入っています。

https://github.com/ClusterLabs/pacemaker/blob/master/mcp/pacemaker.combined.upstart.in


こちらを参考に修正すれば起動出来ると思います。

以上です。


----- Original Message -----
> From: 木下 正昭 <kinoshita@tdc.co.jp>
> To: "linux-ha-japan@lists.sourceforge.jp" <linux-ha-japan@lists.sourceforge.jp>
> Cc:
> Date: 2015/8/21, Fri 17:55
> Subject: [Linux-ha-jp] CentOS6.5でpacemaker.combinedで自動起動する方法について
>
> はじめまして。
> TDCソフトの木下と申します。
>
> 現在、CentOS6.5でpacemaker+corosync+drbd+mysqlで環境構築をしております。
>
> Linux-HAからリポジトリ(pacemaker-repo-1.1.12-1.1.el6.x86_64.rpm)をインストールして、
> yum install pacemaker-allでインストールしています。
>
> 各バージョンが、以下になっております。
> CentOS6.5(x86_64)
> pacemaker(1.1.12)
> corosync(2.3.4-1)
> drbd(8.4.3-1)
>
> 2ノードでactive/sandbyにしています。
>
> linux-ha.osdn.jp/wp/wp-content/uploads/OSC-Tokyo2014Fall.pdf
> を参考に構築しましたが、OS起動時のサービス自動起動について質問がございます。
>
> CentOS6.5で構築するにあたり、起動スクリプトはUpstart形式で設定して、
> 手動でinitctl start pacemaker.combinedをコマンド実行すると正しく起動しますが、
> OSを再起動すると自動起動しません。
>
> http://linux-ha.osdn.jp/wp/archives/4051も参考にしていますが、
> 所謂/etc/init.d/形式でのchkconfig hoge onな記載ではないので、よく分かりません。
>
> 試しに/etc/init.d/形式でのchkconfig corosync onとchkconfig pacemaker onでの自動起動は
> うまく行きましたが、watchdogでの監視をさせたいのでUpstart方式で起動させたいです。
>
> /etc/init/pacemaker.combined.conf内にstart on runlevel [2345]の記載が無いからかと
> 記述して試しましたが、うまく自動起動しません。
>
> 自動起動しない原因が下記confファイルから間違いがあれば、ご指摘頂ければと思います。
> よろしくお願いいたします。
>
>
> ---/etc/corosync/corosync.conf---
> # Please read the corosync.conf.5 manual page
> totem {
>         version: 2
>         rrp_mode: active
>         token: 1000
>         interface {
>                 ringnumber: 0
>                 bindnetaddr: 192.168.220.0
>                 mcastaddr: 239.255.1.1
>                 mcastport: 5405
>         }
>         interface {
>                 ringnumber: 1
>                 bindnetaddr: 192.168.221.0
>                 mcastaddr: 239.255.1.1
>                 mcastport: 5405
>         }
> }
>
> logging {
>         fileline: off
>         to_logfile: yes
>         to_syslog: yes
>         logfile: /var/log/cluster/corosync.log
>         debug: off
>         timestamp: on
>         logger_subsys {
>                 subsys: QUORUM
>                 debug: off
>         }
> }
>
> quorum {
>         provider: corosync_votequorum
>         expected_votes: 2
> }
> ---/etc/corosync/corosync.conf---
>
>
>
> corosync-keygen -lで/etc/corosync/authkeyを対向ノードにコピーしています。
>
>
>
> ---/etc/sysconfig/pacemaker---
>
> # diff -u pacemaker_default pacemaker
> --- pacemaker_default  2015-08-18 17:24:18.000000000 +0900
> +++ pacemaker  2015-08-21 13:19:04.513453641 +0900
> @@ -65,7 +65,7 @@
> # PCMK_schema_directory=/some/path
>
> # Enable this for rebooting this machine at the time of process (subsystem)
> failure
> -# PCMK_fail_fast=no
> +export PCMK_fail_fast=yes
>
> #==#==# Pacemaker Remote
> # Use a custom directory for finding the authkey.
>
> ---/etc/sysconfig/pacemaker---
>
>
>
>
> ---/etc/init/corosync.conf---
>
> デフォルトのままです。
>
> ---/etc/init/corosync.conf---
>
>
>
> ---/etc/init/pacemaker.combined.conf---
>
> # diff -u pacemaker.combined.conf_deafult pacemaker.combined.conf
> --- pacemaker.combined.conf_deafult    2014-09-04 19:38:20.000000000 +0900
> +++ pacemaker.combined.conf    2015-08-21 16:13:56.414985467 +0900
> @@ -2,6 +2,7 @@
> #
> # Starts Corosync cluster engine and Pacemaker cluster manager.
>
> +stop on runlevel [0123456]
> kill timeout 3600
> respawn
>
> @@ -20,7 +21,7 @@
> pre-start script
>     # setup the software watchdog which corosync uses.
>     # rewrite according to environment.
> -    modprobe softdog soft_margin=60
> +    [ -c /dev/watchdog ] || modprobe softdog soft_margin=6
>     pidof corosync || start corosync
>
>     # if you use corosync-notifyd, uncomment the line below.
> @@ -49,7 +50,7 @@
>     rm -f /var/run/$prog.pid
>
>     # if you use watchdog of corosync, uncomment the line below.
> -    #pidof corosync || false
> +    pidof corosync || false
>
>     pidof crmd || stop corosync
>
> ---/etc/init/pacemaker.combined.conf---
>
> _______________________________________________
> Linux-ha-japan mailing list
> Linux-ha-japan@lists.osdn.me
> http://lists.osdn.me/mailman/listinfo/linux-ha-japan
>

_______________________________________________
Linux-ha-japan mailing list
Linux-ha-japan@lists.osdn.me
http://lists.osdn.me/mailman/listinfo/linux-ha-japan
Re: CentOS6.5でpacemaker.combinedで自動起動する方法について [ In reply to ]
$B#T#D#C%=%U%H(B $BLZ2<$5$^(B

$B%a%H%m%7%9%F%`%:$NHSED$H?=$7$^$9!#(B

pacemaker.combined$B$r;H$C$?;~$N<+F05/F0J}K!$G$9$,!"(B
$B2<5-$N@_Dj$r(Bpacemaker.combined.conf$B$KDI2C$7$F$$$?$@$1$l$P$&$^$/F0$/$H;W$$$^$9!#(B

start on started local and runlevel [2345]

Pacemaker-1.1.13$B$+$i$O>e5-=$@5$,<h$j9~$^$l$F$$$^$9$N$G!"(B
$B%3%a%s%H%"%&%H$r30$9$@$1$G<+F05/F0MQ$N@_Dj$r9T$&$3$H$,$G$-$^$9!#(B
https://github.com/ClusterLabs/pacemaker/blob/Pacemaker-1.1.13/mcp/pacemaker.combined.upstart.in

$B0J>e!"$h$m$7$/$*4j$$$7$^$9!#(B

2015$BG/(B8$B7n(B21$BF|(B 17:55 $BLZ2<(B $B@5><(B <kinoshita@tdc.co.jp>:
> $B$O$8$a$^$7$F!#(B
> $B#T#D#C%=%U%H$NLZ2<$H?=$7$^$9!#(B
>
> $B8=:_!"(BCentOS6.5$B$G(Bpacemaker+corosync+drbd+mysql$B$G4D6-9=C[$r$7$F$*$j$^$9!#(B
>
> Linux-HA$B$+$i%j%]%8%H%j(B(pacemaker-repo-1.1.12-1.1.el6.x86_64.rpm)$B$r%$%s%9%H!<%k$7$F!"(B
> yum install pacemaker-all$B$G%$%s%9%H!<%k$7$F$$$^$9!#(B
>
> $B3F%P!<%8%g%s$,!"0J2<$K$J$C$F$*$j$^$9!#(B
> CentOS6.5(x86_64)
> pacemaker(1.1.12)
> corosync(2.3.4-1)
> drbd(8.4.3-1)
>
> 2$B%N!<%I$G(Bactive/sandby$B$K$7$F$$$^$9!#(B
>
> linux-ha.osdn.jp/wp/wp-content/uploads/OSC-Tokyo2014Fall.pdf
> $B$r;29M$K9=C[.$7$^$7$?$,!"(BOS$B5/F0;~$N%5!<%S%9<+F05/F0$K$D$$$F<ALd$,$4$6$$$^$9!#(B
>
> CentOS6.5$B$G9=C[$9$k$K$"$?$j!"5/F0%9%/%j%W%H$O(BUpstart$B7A<0$G@_Dj$7$F!"(B
> $B<jF0$G(Binitctl start pacemaker.combined$B$r%3%^%s%I<B9T$9$k$H@5$7$/5/F0$7$^$9$,!"(B
> OS$B$r:F5/F0$9$k$H<+F05/F0$7$^$;$s!#(B
>
> http://linux-ha.osdn.jp/wp/archives/4051$B$b;29M$K$7$F$$$^$9$,!"(B
> $B=j0b(B/etc/init.d/$B7A<0$G$N(Bchkconfig hoge on$B$J5-:\$G$O$J$$$N$G!"$h$/J,$+$j$^$;$s!#(B
>
> $B;n$7$K(B/etc/init.d/$B7A<0$G$N(Bchkconfig corosync on$B$H(Bchkconfig pacemaker on$B$G$N<+F05/F0$O(B
> $B$&$^$/9T$-$^$7$?$,!"(Bwatchdog$B$G$N4F;k$r$5$;$?$$$N$G(BUpstart$BJ}<0$G5/F0$5$;$?$$$G$9!#(B
>
> /etc/init/pacemaker.combined.conf$BFb$K(Bstart on runlevel [2345]$B$N5-:\$,L5$$$+$i$+$H(B
> $B5-=R$7$F;n$7$^$7$?$,!"$&$^$/<+F05/F0$7$^$;$s!#(B
>
> $B<+F05/F0$7$J$$860x$,2<5-(Bconf$B%U%!%$%k$+$i4V0c$$$,$"$l$P!"$4;XE&D:$1$l$P$H;W$$$^$9!#(B
> $B$h$m$7$/$*4j$$$$$?$7$^$9!#(B
>
>
> ---/etc/corosync/corosync.conf---
> # Please read the corosync.conf.5 manual page
> totem {
> version: 2
> rrp_mode: active
> token: 1000
> interface {
> ringnumber: 0
> bindnetaddr: 192.168.220.0
> mcastaddr: 239.255.1.1
> mcastport: 5405
> }
> interface {
> ringnumber: 1
> bindnetaddr: 192.168.221.0
> mcastaddr: 239.255.1.1
> mcastport: 5405
> }
> }
>
> logging {
> fileline: off
> to_logfile: yes
> to_syslog: yes
> logfile: /var/log/cluster/corosync.log
> debug: off
> timestamp: on
> logger_subsys {
> subsys: QUORUM
> debug: off
> }
> }
>
> quorum {
> provider: corosync_votequorum
> expected_votes: 2
> }
> ---/etc/corosync/corosync.conf---
>
>
>
> corosync-keygen -l$B$G(B/etc/corosync/authkey$B$rBP8~%N!<%I$K%3%T!<$7$F$$$^$9!#(B
>
>
>
> ---/etc/sysconfig/pacemaker---
>
> # diff -u pacemaker_default pacemaker
> --- pacemaker_default 2015-08-18 17:24:18.000000000 +0900
> +++ pacemaker 2015-08-21 13:19:04.513453641 +0900
> @@ -65,7 +65,7 @@
> # PCMK_schema_directory=/some/path
>
> # Enable this for rebooting this machine at the time of process (subsystem) failure
> -# PCMK_fail_fast=no
> +export PCMK_fail_fast=yes
>
> #==#==# Pacemaker Remote
> # Use a custom directory for finding the authkey.
>
> ---/etc/sysconfig/pacemaker---
>
>
>
>
> ---/etc/init/corosync.conf---
>
> $B%G%U%)%k%H$N$^$^$G$9!#(B
>
> ---/etc/init/corosync.conf---
>
>
>
> ---/etc/init/pacemaker.combined.conf---
>
> # diff -u pacemaker.combined.conf_deafult pacemaker.combined.conf
> --- pacemaker.combined.conf_deafult 2014-09-04 19:38:20.000000000 +0900
> +++ pacemaker.combined.conf 2015-08-21 16:13:56.414985467 +0900
> @@ -2,6 +2,7 @@
> #
> # Starts Corosync cluster engine and Pacemaker cluster manager.
>
> +stop on runlevel [0123456]
> kill timeout 3600
> respawn
>
> @@ -20,7 +21,7 @@
> pre-start script
> # setup the software watchdog which corosync uses.
> # rewrite according to environment.
> - modprobe softdog soft_margin=60
> + [ -c /dev/watchdog ] || modprobe softdog soft_margin=6
> pidof corosync || start corosync
>
> # if you use corosync-notifyd, uncomment the line below.
> @@ -49,7 +50,7 @@
> rm -f /var/run/$prog.pid
>
> # if you use watchdog of corosync, uncomment the line below.
> - #pidof corosync || false
> + pidof corosync || false
>
> pidof crmd || stop corosync
>
> ---/etc/init/pacemaker.combined.conf---
>
> _______________________________________________
> Linux-ha-japan mailing list
> Linux-ha-japan@lists.osdn.me
> http://lists.osdn.me/mailman/listinfo/linux-ha-japan



--
----------------------------------------
METRO SYSTEMS CO., LTD

Yusuke Iida
Mail: yusk.iida@gmail.com
----------------------------------------
_______________________________________________
Linux-ha-japan mailing list
Linux-ha-japan@lists.osdn.me
http://lists.osdn.me/mailman/listinfo/linux-ha-japan