corosync,pacemaker,crmクラスタリソースモニタリング


corosyncのリソースモニタリング機能について説明します.
node1 node1.luojianlong.com  192.168.30.116   OS: Centos 6.4 x86_64
node2 node2.luojianlong.com  192.168.30.117   OS: Centos 6.4 x86_64
1.corosyncリソースの定義:
[root@node1 ~]# crm configure primitive WebIP ocf:heartbeat:IPaddr params ip=192.168.30.230 op monitor interval=20 timeout=15 on-fail=restart
[root@node2 ~]# crm status
Last updated: Tue Mar 25 13:22:25 2014
Last change: Tue Mar 25 13:17:52 2014 via cibadmin on node1.luojianlong.com
Stack: classic openais (with plugin)
Current DC: node1.luojianlong.com - partition with quorum
Version: 1.1.10-14.el6_5.1-368c726
2 Nodes configured, 2 expected votes
1 Resources configured
Online: [ node1.luojianlong.com node2.luojianlong.com ]
 WebIP  (ocf::heartbeat:IPaddr):    Started node1.luojianlong.com

WebIPがnode 1で自動的に起動していることがわかりました
2.corosyncがいずれかのノードの起動に失敗した場合、別のノードで起動することを確認します.
# node1 node2     nginx
[root@node1 ~]# yum -y install nginx
[root@node2 ~]# yum -y install nginx
# node2   httpd,  80     , nginx    
[root@node2 ~]# service  httpd start
Starting httpd:                                            [  OK  ]
#  nginx  
[root@node2 ~]# crm configure primitive nginx lsb:nginx op monitor interval=20 timeout=20 on-fail=restart
[root@node2 ~]# crm status
Last updated: Tue Mar 25 13:40:30 2014
Last change: Tue Mar 25 13:37:07 2014 via cibadmin on node2.luojianlong.com
Stack: classic openais (with plugin)
Current DC: node1.luojianlong.com - partition with quorum
Version: 1.1.10-14.el6_5.1-368c726
2 Nodes configured, 2 expected votes
2 Resources configured
Online: [ node1.luojianlong.com node2.luojianlong.com ]
 WebIP  (ocf::heartbeat:IPaddr):    Started node1.luojianlong.com
 nginx  (lsb:nginx):    Started node1.luojianlong.com
# node1   nginx      :
[root@node1 ~]# ss -antpl | grep nginx
LISTEN     0      128                       *:80                       *:*      users:(("nginx",29510,6),("nginx",29512,6))