2014/04/07

Pacemaker + cmanでクラスタを作る手順メモ

日曜日の夜が更けてきたのでコマンドだけメモして寝るw

# vi /etc/hosts
10.3.12.121     LAINCL01.local LAINCL01
10.3.12.122     LAINCL02.local LAINCL02


# yum install pacemaker corosync pcs cman ccs
# corosync-keygen
# cd /etc/corosync/
# scp authkey root@10.3.12.122:/etc/corosync
# cp corosync.conf.example.udpu corosync.conf
# vi corosync.conf
以下の設定を記載
・interface memberにノードIPを並べる
・bindnetaddrはネットワークアドレス
・transportはudpuにする
・logging to_syslogはnoにする


# iptables -I INPUT 1 --protocol udp --dport 5405 -j ACCEPT
# iptables -I INPUT 1 --protocol udp --sport 5404 -j ACCEPT
# iptables -I OUTPUT 1 --protocol udp --dport 5405 -j ACCEPT
# iptables -I OUTPUT 1 --protocol udp --sport 5404 -j ACCEPT


# crm_mon

# service cman start
# service pacemaker start
# chkconfig cman on
# chkconfig pacemaker on

# ccs -f /etc/cluster/cluster.conf --createcluster LAINCL00
# ccs -f /etc/cluster/cluster.conf --addnode LAINCL01.local
# ccs -f /etc/cluster/cluster.conf --addnode LAINCL02.local
# ccs -f /etc/cluster/cluster.conf --addfencedev pcmk agent=fence_pcmk
# ccs -f /etc/cluster/cluster.conf --addmethod pcmk-redirect LAINCL01.local
# ccs -f /etc/cluster/cluster.conf --addmethod pcmk-redirect LAINCL02.local
# ccs -f /etc/cluster/cluster.conf --addfenceinst pcmk LAINCL01.local pcmk-redirect port=LAINCL01.local
# ccs -f /etc/cluster/cluster.conf --addfenceinst pcmk LAINCL02.local pcmk-redirect port=LAINCL02.local

# echo "CMAN_QUORUM_TIMEOUT=0" >> /etc/sysconfig/cman

# pcs property set stonith-enabled=false
# pcs property set no-quorum-policy=ignore

参考:
http://clusterlabs.org/quickstart-redhat.html
http://blog.suz-lab.com/2012/12/corosync-pacemaker.html
http://linux-ha.sourceforge.jp/wp/dl/pminstall_cent5
http://sios-oss.blogspot.jp/2013/05/pacemaker-corosync-ha.html