背景:
阅读新闻
Corosync+OpenAIS+Pacemaker+Web+DRBD实现高可用群集
[日期:2012-10-26] 来源:Linux社区 作者:zhangzhenzz [字体:]
2.安装所需要的软件包
Node1上
[root@node1 ~]# ll
总计 3416
-rw------- 1 root root 1287 08-11 23:13 anaconda-ks.cfg
-rw-r--r-- 1 root root 271360 10-20 12:10 cluster-glue-1.0.6-1.6.el5.i386.rpm
-rw-r--r-- 1 root root 133254 10-20 12:10 cluster-glue-libs-1.0.6-1.6.el5.i386.rpm
-rw-r--r-- 1 root root 170052 10-20 12:10 corosync-1.2.7-1.1.el5.i386.rpm
-rw-r--r-- 1 root root 158502 10-20 12:10 corosynclib-1.2.7-1.1.el5.i386.rpm
drwxr-xr-x 2 root root 4096 08-11 15:20 Desktop
-rw-r--r-- 1 root root 165591 10-20 12:10 heartbeat-3.0.3-2.3.el5.i386.rpm
-rw-r--r-- 1 root root 289600 10-20 12:10 heartbeat-libs-3.0.3-2.3.el5.i386.rpm
-rw-r--r-- 1 root root 35369 08-11 23:13 install.log
-rw-r--r-- 1 root root 3995 08-11 23:11 install.log.syslog
-rw-r--r-- 1 root root 60458 10-20 12:10 libesmtp-1.0.4-5.el5.i386.rpm
-rw-r--r-- 1 root root 796813 10-20 12:10 pacemaker-1.1.5-1.1.el5.i386.rpm
-rw-r--r-- 1 root root 207925 10-20 12:10 pacemaker-cts-1.1.5-1.1.el5.i386.rpm
-rw-r--r-- 1 root root 332026 10-20 12:10 pacemaker-libs-1.1.5-1.1.el5.i386.rpm
-rw-r--r-- 1 root root 32818 10-20 12:10 perl-TimeDate-1.16-5.el5.noarch.rpm
-rw-r--r-- 1 root root 388632 10-20 12:10 resource-agents-1.0.4-1.1.el5.i386.rpm
# yum localinstall -y *.rpm --nogpgcheck
[root@node1 ~]# cd /etc/corosync/
[root@node1 corosync]# cp -p corosync.conf.example corosync.conf
[root@node1 corosync]# vim corosync.conf
10 bindnetaddr: 192.168.145.0
33 service {
34 ver: 0
35 name: pacemaker
36 }
37 aisexec {
38 user: root
39 group: root
40 }
创建目录
#mkdir /var/log/cluster
为了便面其他主机加入该集群,需要认证,生成一个authkey
[root@node1 corosync]# corosync-keygen
Corosync Cluster Engine Authentication key generator.
Gathering 1024 bits for key from /dev/random.
Press keys on your keyboard to generate entropy.
Writing corosync key to /etc/corosync/authkey.
[root@node1 corosync]# ll
总计 28
-rw-r--r-- 1 root root 5384 2010-07-28 amf.conf.example
-r-------- 1 root root 128 10-20 13:02 authkey
-rw-r--r-- 1 root root 540 10-20 12:59 corosync.conf
-rw-r--r-- 1 root root 436 2010-07-28 corosync.conf.example
drwxr-xr-x 2 root root 4096 2010-07-28 service.d
drwxr-xr-x 2 root root 4096 2010-07-28 uidgid.d
拷贝到node2上去 (使用 -p 以保留权限)
[root@node1 corosync]# scp -p authkey corosync.conf node2:/etc/corosync/
在另外的一个节点上创建日志目录
[root@node1 corosync]# ssh node2 'mkdir /var/log/cluster'
在节点上启动服务
[root@node1 corosync]# service corosync start
[root@node1 corosync]# ssh node2 'service corosync start'
验证启动corosync是否正常:
查看corosync引擎是否正常启动
[root@node1 corosync]# grep -i -e "corosync cluster engine" -e "configuration file" /var/log/messages
Oct 20 13:08:39 localhost corosync[32303]: [MAIN ] Corosync Cluster Engine ('1.2.7'): started and ready to provide service.
Oct 20 13:08:39 localhost corosync[32303]: [MAIN ] Successfully read main configuration file '/etc/corosync/corosync.conf'.
查看初始化成员节点通知是否发出
[root@node1 corosync]# grep -i totem /var/log/messages
Oct 20 13:08:39 localhost corosync[32303]: [TOTEM ] Initializing transport (UDP/IP).
Oct 20 13:08:39 localhost corosync[32303]: [TOTEM ] Initializing transmit/receive security: libtomcrypt SOBER128/SHA1HMAC (mode 0).
Oct 20 13:08:39 localhost corosync[32303]: [TOTEM ] The network interface [192.168.145.100] is now up.
Oct 20 13:08:40 localhost corosync[32303]: [TOTEM ] A processor joined or left the membership and a new membership was formed.
Oct 20 13:09:18 localhost corosync[32303]: [TOTEM ] A processor joined or left the membership and a new membership was formed.
相关资讯
本文评论 查看全部评论 (0)
尊重网上道德,遵守中华人民共和国的各项有关法律法规 承担一切因您的行为而直接或间接导致的民事或刑事法律责任 本站管理人员有权保留或删除其管辖留言中的任意内容 本站有权在网站内转载或引用您的评论 参与本评论即表明您已经阅读并接受上述条款
评论声明
最新资讯