Cluster Labs
GitHub Pacemaker
クラスタリング環境下で、Elastic IP Address(EIP≒Virtual IP Address)の付け替えを行ったり、
リソース管理と連携してパケット振り分けを行うミドルウェア。
Pacemakerとサーバ監視ソフト(zabbix、Nagios、etc...)を連携させる事で、
監視側でアラートが上がったらEIPの付け替えを行う事も可能。
1. ビルド・インストール
PacemakerはCorosyncのライブラリを使用するので、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 # ./autogen.sh # ./configure --prefix=/usr/local/pacemaker --sysconfdir=/etc --localstatedir=/var # make # make install
# cd /usr/sbin # ln -s /usr/local/pacemaker/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/* . # cd /usr/lib64 # ln -s /usr/local/pacemaker/lib/lib* .
2. 起動
起動は、[Corosync→Pacemaker]の順番に行う。
その為Corosyncが先に起動していたら、一度停止した後にPacemakerを起動させる。
# /etc/init.d/corosync restart # /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