背景:
阅读新闻
LVS-DR+Heartbeat实现高可用负载均衡服务
[日期:2012-10-26] 来源:Linux社区 作者:zhangzhenzz [字体:]
拷贝相关文件
[root@node1 ~]# cd /usr/share/doc/heartbeat-2.1.4/
[root@node1 heartbeat-2.1.4]# cp ha.cf /etc/ha.d/
[root@node1 heartbeat-2.1.4]# cp haresources /etc/ha.d/
[root@node1 heartbeat-2.1.4]# cp authkeys /etc/ha.d/
[root@node1 ha.d]# cp /etc/init.d/ipvsadm /etc/ha.d/resource.d/
[root@node1 ha.d]# vim ha.cf
91 #bcast eth0 # Linux
92 #bcast eth1 eth2 # Linux
93 #bcast le0 # Solaris
94 #bcast le1 le2 # Solaris
95 bcast eth1 //广播接口
212 #node ken3
213 #node kathy
214 node node1.a.com
215 node node2.a.com //指明结点
[root@node1 ha.d]# dd if=/dev/random bs=512 count=1 |openssl md5
0+1 records in
0+1 records out
128 bytes (128 B) copied, 0.000335324 seconds, 382 kB/s
af42fae97f8db1512bfc7eac86da60ea
编辑修改authkeys文件:
[root@node1 ha.d]# vim authkeys
23 #auth 1
24 #1 crc
25 #2 sha1 HI!
26 #3 md5 Hello!
27 auth 3
28 3 md5 af42fae97f8db1512bfc7eac86da60ea //md5加密数
[root@node1 ha.d]# chmod 600 authkeys
编辑修改haresources文件:
[root@node1 ha.d]# vim haresources
45 node1.a.com 192.168.145.101/24/eth0/192.168.145.255 ipvsadm
node2.a.com上[root@node2 ~]# mkdir /mnt/cdrom
[root@node2 ~]# mount /dev/cdrom /mnt/cdrom
[root@node2 ~]# yum install -y ipvsadm //安装ipvsadm
[root@node2 ~]# scp node1:/root/*.rpm ./
heartbeat-2.1.4-9.el5.i386.rpm 100% 1599KB 1.6MB/s 00:00
heartbeat-ldirectord-2.1.4-9.el5.i386.rpm 100% 109KB 109.1KB/s 00:00
heartbeat-pils-2.1.4-10.el5.i386.rpm 100% 90KB 89.9KB/s 00:01
heartbeat-stonith-2.1.4-10.el5.i386.rpm 100% 175KB 175.0KB/s 00:00
libnet-1.1.4-3.el5.i386.rpm 100% 55KB 55.5KB/s 00:00
perl-MailTools-1.77-1.el5.noarch.rpm 100% 90KB 89.9KB/s 00:00
[root@node2 ~]# yum localinstall -y *.rpm --nogpgcheck
[root@node2 ~]# scp node1:/etc/ha.d/ha.cf /etc/ha.d/
ha.cf 100% 10KB 10.3KB/s 00:00
[root@node2 ~]# scp node1:/etc/ha.d/haresources /etc/ha.d/
haresources 100% 5963 5.8KB/s 00:00
[root@node2 ~]# scp node1:/etc/ha.d/authkeys /etc/ha.d/
authkeys 100% 691 0.7KB/s 00:00
[root@node2 ~]# scp node1:/etc/init.d/ipvsadm /etc/ha.d/resource.d/
ipvsadm 100% 2618 2.6KB/s 00:00
[root@node2 ~]# scp node1:/etc/sysconfig/ipvsadm /etc/sysconfig/ipvsadm
ipvsadm 100% 141 0.1KB/s 00:00
[root@node1 ha.d]# service heartbeat start
Starting High-Availability services:
2012/10/25_19:41:45 INFO: Resource is stopped
[确定]
[root@node2 ~]# service heartbeat start
Starting High-Availability services:
2012/10/25_19:42:37 INFO: Resource is stopped
[确定]
Corosync+OpenAIS+Pacemaker+Web+DRBD实现高可用群集
本文评论 查看全部评论 (0)
尊重网上道德,遵守中华人民共和国的各项有关法律法规 承担一切因您的行为而直接或间接导致的民事或刑事法律责任 本站管理人员有权保留或删除其管辖留言中的任意内容 本站有权在网站内转载或引用您的评论 参与本评论即表明您已经阅读并接受上述条款
评论声明
最新资讯