Sep 15 11:37:39 corosync [MAIN ] Corosync Cluster Engine ('1.4.1'): started and ready to provide service. Sep 15 11:37:39 corosync [MAIN ] Successfully read main configuration file '/etc/corosync/corosync.conf'.
查看初始化成员节点通知是否正常发出:
1 2 3 4 5 6 7
# grep TOTEM /var/log/cluster/corosync.log
Sep 15 11:37:39 corosync [TOTEM ] Initializing transport (UDP/IP Multicast). Sep 15 11:37:39 corosync [TOTEM ] Initializing transmit/receive security: libtomcrypt SOBER128/SHA1HMAC (mode 0). Sep 15 11:37:39 corosync [TOTEM ] The network interface [192.168.10.7] is now up. Sep 15 11:37:39 corosync [TOTEM ] A processor joined or left the membership and a new membership was formed. Sep 15 11:37:39 corosync [TOTEM ] A processor joined or left the membership and a new membership was formed.
Sep 15 11:37:39 corosync [pcmk ] ERROR: process_ais_conf: You have configured a cluster using the Pacemaker plugin for Corosync. The plugin is not supported in this environment and will be removed very soon. Sep 15 11:37:39 corosync [pcmk ] ERROR: process_ais_conf: Please see Chapter 8 of 'Clusters from Scratch' (http://www.clusterlabs.org/doc) for details on using Pacemaker with CMAN Sep 15 11:37:40 corosync [pcmk ] ERROR: pcmk_wait_dispatch: Child process mgmtd exited (pid=2375, rc=100)
Sep 15 12:10:00 [2688] node1.test.com crmd: info: do_te_control: Transitioner is now inactive Sep 15 12:10:00 [2688] node1.test.com crmd: info: update_dc: Set DC to node2.test.com (3.0.7) Sep 15 12:10:00 [2683] node1.test.com cib: info: cib_process_replace: Digest matched on replace from node2.test.com: a221b8ae3386d35b263633d8b1fe213f Sep 15 12:10:00 [2683] node1.test.com cib: info: cib_process_replace: Replaced 0.8.7 with 0.8.7 from node2.test.com Sep 15 12:10:00 [2688] node1.test.com crmd: info: erase_status_tag: Deleting xpath: //node_state[@uname='node1.test.com']/transient_attributes Sep 15 12:10:00 [2688] node1.test.com crmd: info: update_attrd: Connecting to attrd... 5 retries remaining Sep 15 12:10:00 [2688] node1.test.com crmd: notice: do_state_transition: State transition S_PENDING -> S_NOT_DC [ input=I_NOT_DC cause=C_HA_MESSAGE origin=do_cl_join_finalize_respond ] Sep 15 12:10:00 [2686] node1.test.com attrd: notice: attrd_local_callback: Sending full refresh (origin=crmd) Sep 15 12:10:01 [2686] node1.test.com attrd: notice: attrd_trigger_update: Sending flush op to all hosts for: probe_complete (true) Sep 15 12:10:01 [2686] node1.test.com attrd: notice: attrd_perform_update: Sent update 5: probe_complete=true
如果安装了crmsh,可使用如下命令查看集群节点的启动状态:
1 2 3 4 5 6 7 8 9 10 11 12
# crm status
Last updated: Sun Sep 15 12:12:25 2013 Last change: Sun Sep 15 12:12:18 2013 via cibadmin on node1.test.com Stack: classic openais (with plugin) Current DC: node2.test.com - partition with quorum Version: 1.1.8-7.el6-394e906 2 Nodes configured, 3 expected votes 0 Resources configured.
# crm_verify -L -V error: unpack_resources: Resource start-up disabled since no STONITH resources have been defined error: unpack_resources: Either configure some or disable STONITH with the stonith-enabled option 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
# crm status Last updated: Sun Sep 15 12:25:54 2013 Last change: Sun Sep 15 12:25:50 2013 via cibadmin on node1.test.com Stack: classic openais (with plugin) Current DC: node2.test.com - partition with quorum Version: 1.1.8-7.el6-394e906 2 Nodes configured, 2 expected votes 1 Resources configured.
Online: [ node1.test.com node2.test.com ] WebIP (ocf::heartbeat:IPaddr): Started node1.test.com
当然,也可以在node1上执行ifconfig命令看到此地址已经在eth0的别名上生效:
1 2 3 4 5
# ifconfig eth0:0 Link encap:Ethernet HWaddr 00:0C:29:62:DE:4C inet addr:192.168.10.11 Bcast:192.168.0.255 Mask:255.255.255.0 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
而后我们到node2上通过如下命令停止node1上的corosync服务:
1
# ssh node1 -- /etc/init.d/corosync stop
查看集群工作状态:
1 2 3 4 5 6 7 8 9 10 11 12
# crm status Last updated: Sun Sep 15 12:32:10 2013 Last change: Sun Sep 15 12:31:46 2013 via cibadmin on node1.test.com Stack: classic openais (with plugin) Current DC: node2.test.com - partition WITHOUT quorum Version: 1.1.8-7.el6-394e906 2 Nodes configured, 2 expected votes 1 Resources configured.
# crm status Last updated: Mon Jul 8 19:14:30 2013 Last change: Sun Sep 15 15:16:37 2013 via cibadmin on node2.test.com Stack: classic openais (with plugin) Current DC: node1.test.com - partition with quorum Version: 1.1.8-7.el6-394e906 2 Nodes configured, 2 expected votes 1 Resources configured.
Online: [ node1.test.com node2.test.com ]
WebIP (ocf::heartbeat:IPaddr): Started node2.test.com
# crm status Last updated: Mon Jul 8 19:21:29 2013 Last change: Sun Sep 15 15:22:13 2013 via cibadmin on node2.test.com Stack: classic openais (with plugin) Current DC: node1.test.com - partition with quorum Version: 1.1.8-7.el6-394e906 2 Nodes configured, 2 expected votes 2 Resources configured.
Online: [ node1.test.com node2.test.com ]
WebIP (ocf::heartbeat:IPaddr): Started node1.test.com WebServer (lsb:httpd): Started node2.test.com
# crm status Last updated: Mon Jul 8 19:27:47 2013 Last change: Sun Sep 15 15:29:55 2013 via cibadmin on node2.test.com Stack: classic openais (with plugin) Current DC: node1.test.com - partition with quorum Version: 1.1.8-7.el6-394e906 2 Nodes configured, 2 expected votes 2 Resources configured.
Online: [ node1.test.com node2.test.com ]
WebIP (ocf::heartbeat:IPaddr): Started node1.test.com WebServer (lsb:httpd): Started node1.test.com
接着,我们还得确保WebSite在某节点启动之前得先启动WebIP,这可以使用如下命令实现:
1
# crm configure order webserver-after-webip mandatory: WebIP WebServer