- 追加された行はこの色です。
- 削除された行はこの色です。
*Pacemaker [#ucb0b0fc]
[[Cluster Labs>+http://clusterlabs.org/]]
[[GitHub Pacemaker>+https://github.com/ClusterLabs/pacemaker]]
クラスタリング環境下で、Elastic IP Address(EIP≒Virtual IP Address)の付け替えを行ったり、
リソース管理と連携してパケット振り分けを行うミドルウェア。
Pacemakerとサーバ監視ソフト(zabbix、Nagios、etc...)を連携させる事で、
監視側でアラートが上がったらEIPの付け替えを行う事も可能。
*Cluster Glue [#vc315bfa]
[[Cluster Glue>+http://www.linux-ha.org/wiki/Cluster_Glue]]
[[GitHub Glue>+http://hg.linux-ha.org/glue/]]
クラスター環境に必要なライブラリとツールを集めたパッケージ。
crmshをビルドする時に必要になる。
~
*インストール [#qed243bc]
*インストール [#ldb8e64a]
&size(16){&font(b){1. ビルド・インストール};};
PacemakerはCorosyncのライブラリを使用するので、&font(b){Pacemakerのビルド前にCorosyncを入れておく。};
また、configureオプションもCorosyncと同様にした方が動作不良が起きにくい。
"make install"する時に、Pacemaker用のグループとユーザが必要になるので事前に作っておく。
# groupadd haclient
# useradd -g haclient -s /sbin/nologin -M -d /var/pacemaker hacluster
# git clone git://github.com/ClusterLabs/pacemaker.git pacemaker
# cd pacemaker
ビルドする際にはsysconfdirとlocalstatedirをCorosync/Pacemakerと合わせる必要がある。
# yum install asciidoc mercurial
# hg clone http://hg.linux-ha.org/glue/ glue
# cd glue
# ./autogen.sh
# ./configure --prefix=/usr/local/pacemaker --sysconfdir=/etc --localstatedir=/var
# ./configure --prefix=/usr/local/glue --sysconfdir=/etc --localstatedir=/var
# make
# make install
# cd /usr/sbin
# ln -s /usr/local/pacemaker/sbin/* .
# ln -s /usr/local/glue/sbin/* .
# cd /usr/include
# ln -s /usr/local/pacemaker/include/pacemaker .
# cd /usr/libexec
# ln -s /usr/local/pacemaker/libexec/pacemaker .
# cd /usr/lib64/pkgconfig
# ln -s /usr/local/pacemaker/lib/pkgconfig/* .
# ln -s /usr/local/glue/include/* .
# cd /usr/lib64
# ln -s /usr/local/pacemaker/lib/lib* .
~
&size(16){&font(b){2. 起動};};
起動は、[Corosync→Pacemaker]の順番に行う。
Pacemakerが先に起動していたらPacemakerを一度停止した後、
Corosyncをreloadし、Pacemakerを再起動させる。
# /etc/init.d/pacemaker stop
# /etc/init.d/corosync reload
# /etc/init.d/pacemaker start
起動とクラスタノードのチェックするには、Pacemakerのコマンド(crm_mon)を使用する。
ただし、1台のみでcrm_monを打ってもノードが無い為に"0 Node"で表示される事がある為注意。
# crm_mon
Defaulting to one-shot mode
You need to have curses available at compile time to enable console mode
Last updated: Sun Dec 7 00:45:16 2014
Last change: Sat Dec 7 00:42:34 2014
Current DC: NONE
0 Nodes configured
0 Resources configured
~
&size(16){&font(b){3. 設定};};
Pacemaker単体ではEIPの設定が出来ない為、EIP設定専用のshellをインストールする。
代表的な物としては、[[crm:+http://crmsh.github.io/]]と[[pcs>Linux/Command/pcs]]の二種類がある。
crmはRedhat6.4辺りからプロジェクトが独立してしまい、現在はopenSUSEのリポジトリでサポートされている。
pcsはGitHubをベースに展開されている。
~
今後はどちらが生き残るかわからないが、
-高機能と前例事例で選ぶならcrm
-今後の主流になりそうなpcs
# ln -s /usr/local/glue/lib/lib* .
# ldconfig
の二つを元にshellを選べば良い。
また、crmとpcsは設定方法に互換性が&font(b){無い};ので、初期選択には注意する。