10.检测corosync是否无误
验证corosync引擎是否正常启动了
[root@www1 corosync]# grep -i -e "corosync cluster engine" -e "configuration file" /var/log/messages
Oct 24 11:09:04 www1 smartd[3260]: Opened configuration file /etc/smartd.conf
Oct 24 11:09:04 www1 smartd[3260]: Configuration file /etc/smartd.conf was parsed, found DEVICESCAN, scanning devices
Oct 24 17:08:33 www1 corosync[26362]: [MAIN ] Corosync Cluster Engine ('1.2.7'): started and ready to provide service.
Oct 24 17:08:33 www1 corosync[26362]: [MAIN ] Successfully read main configuration file '/etc/corosync/corosync.conf'.
查看初始化成员节点通知是否发出
[root@www1 corosync]# grep -i totem /var/log/messages
Oct 24 17:08:33 www1 corosync[26362]: [TOTEM ] Initializing transport (UDP/IP).
Oct 24 17:08:33 www1 corosync[26362]: [TOTEM ] Initializing transmit/receive security: libtomcrypt SOBER128/SHA1HMAC (mode 0).
Oct 24 17:08:33 www1 corosync[26362]: [TOTEM ] The network interface is down.
Oct 24 17:08:34 www1 corosync[26362]: [TOTEM ] A processor joined or left the membership and a new membership was formed.
[root@www2 ~]# grep -i totem /var/log/messages
Oct 24 17:09:07 www2 corosync[28610]: [TOTEM ] Initializing transport (UDP/IP).
Oct 24 17:09:07 www2 corosync[28610]: [TOTEM ] Initializing transmit/receive security: libtomcrypt SOBER128/SHA1HMAC (mode 0).
Oct 24 17:09:07 www2 corosync[28610]: [TOTEM ] The network interface is down.
Oct 24 17:09:08 www2 corosync[28610]: [TOTEM ] A processor joined or left the membership and a new membership was formed.
检查过程中是否有错误产生
[root@www1 corosync]# grep -i error: /var/log/messages |grep -v unpack_resources
[root@www2 ~]# grep -i error: /var/log/messages |grep -v unpack_resources
不显示任何信息证明正确无误!
检查pacemaker时候已经启动了
[root@www1 corosync]# grep -i totem /var/log/messages
Oct 24 17:08:33 www1 corosync[26362]: [TOTEM ] Initializing transport (UDP/IP).
Oct 24 17:08:33 www1 corosync[26362]: [TOTEM ] Initializing transmit/receive sec
Oct 24 17:08:33 www1 corosync[26362]: [TOTEM ] The network interface is down.
Oct 24 17:08:34 www1 corosync[26362]: [TOTEM ] A processor joined or left the me
[root@www1 corosync]# grep -i error: /var/log/messages |grep -v unpack_resources
[root@www1 corosync]# grep -i pcmk_startup /var/log/messages
Oct 24 17:08:34 www1 corosync[26362]: [pcmk ] info: pcmk_startup: CRM: Initialized
Oct 24 17:08:34 www1 corosync[26362]: [pcmk ] Logging: Initialized pcmk_startup
Oct 24 17:08:34 www1 corosync[26362]: [pcmk ] info: pcmk_startup: Maximum core file size is: 4294967295
Oct 24 17:08:34 www1 corosync[26362]: [pcmk ] info: pcmk_startup: Service: 9
Oct 24 17:08:34 www1 corosync[26362]: [pcmk ] info: pcmk_startup: Local hostname: www1.gjp.com
[root@www2 ~]# grep -i pcmk_startup /var/log/messages
前集群的节点上启动另外一个节点
[root@www1 ~]# /etc/init.d/corosync start
Starting Corosync Cluster Engine (corosync): [ OK ]
[root@www1 ~]# ssh www2 '/etc/init.d/corosync start'
root@www2's password:
Starting Corosync Cluster Engine (corosync): [ OK ]
[root@www2 corosync]# crm status
============
Last updated: Wed Oct 24 20:11:19 2012
Stack: openais
Current DC: www1.gjp.com - partition with quorum
Version: 1.1.5-1.1.el5-01e86afaaa6d4a8c4836f68df80ababd6ca3902f
2 Nodes configured, 2 expected votes
0 Resources configured.
============
Online: [ www1.gjp.com www2.gjp.com ]
提示:集群的节点之间的时间应该是同步的,
提供高可用服务
在corosync中,定义服务可以用两种借口
1.图形接口 (使用hb—gui)
2.crm (pacemaker 提供,是一个shell)

用于查看cib的相关信息
如何验证该文件的语法错误
[root@www1 corosync]# crm_verify -L
crm_verify[4329]: 2012/10/25_14:59:35 ERROR: unpack_resources: Resource start-up disabled since no STONITH resources have been defined
crm_verify[4329]: 2012/10/25_14:59:35 ERROR: unpack_resources: Either configure some or disable STONITH with the stonith-enabled option
crm_verify[4329]: 2012/10/25_14:59:35 ERROR: unpack_resources: NOTE: Clusters with shared data need STONITH to ensure data integrity
Errors found during check: config not valid
-V may provide more details
可以看到有stonith错误,在高可用的环境里面,会禁止实用任何支援
可以禁用stonith
[root@www1 corosync]# crm
crm(live)# configure
crm(live)configure# property stonith-enabled=false
crm(live)configure# commit
crm(live)configure# show
node www1.gjp.com
node www2.gjp.com
property $id="cib-bootstrap-options" \
dc-version="1.1.5-1.1.el5-01e86afaaa6d4a8c4836f68df80ababd6ca3902f" \
cluster-infrastructure="openais" \
expected-quorum-votes="2" \
stonith-enabled="false"
再次进行检查
[root@www1 corosync]# crm_verify -L
没有错误了
系统上有专门的stonith命令
stonith -L 显示stonith所指示的类型
crm可以使用交互式模式
可以执行help
保存在cib里面,以xml的格式
