Heartbeat


Heartbeat配置


HeartBeat

HeartBeatLinux-HA的高可用性集群软件,它的主要作用是:

安装在LoadBalancer Backup,运行于active/standby模式。

LoadBalancer 失效时,Backup自动激活,成为实际的LoadBalancer

切换到active模式时,按顺序启动VirtualIPIPVSLdirectord

切换到standby模式时,按顺序关闭LdirectordIPVSVirtualIP

ldirectord

安装HeartBeat过程中,已经自动安装了Ldirectord,它的作用是:

监测RealServer,RealServer 失效时,把它从LoadBalancer 列表中

删除,恢复时重新添加。


HA两台服务器的设置完全一样

230 yum localinstall -y *

heartbeat-3.0.4-1.el6.x86_64.rpm heartbeat-libs-3.0.4-1.el6.x86_64.rpm

heartbeat-devel-3.0.4-1.el6.x86_64.rpm ldirectord-3.9.2-1.2.x86_64.rpm

235 cd /usr/share/doc/heartbeat-3.0.4/

237 cp authkeys ha.cf haresources /etc/ha.d/


240 vim ha.cf

debugfile/var/log/ha-debug

logfile/var/log/ha-log

logfacility local0

keepalive2

deadtime30

warntime10

initdead120

udpport694

bcast eth0 # Linux

auto_failbackon

watchdog/dev/watchdog

node mfs1.example.com

node mfs2.example.com

ping192.168.0.3

respawnhacluster /usr/lib64/heartbeat/ipfail

apiauthipfail gid=haclient uid=hacluster

241 modprobe softdag

247 echo "modprobe softdog" >> /etc/rc.local


254 vi authkeys

auth1

1crc


256 chmod 600 authkeys

261 vi haresources

mfs1.example.comIPaddr::192.168.0.73/24/eth0 httpd

262 vi /etc/hosts

192.168.0.31mfs2.example.com

274 cd /var/www/html/

276 echo 192.168.0.30 > index.html

282 /etc/init.d/heartbeat startd


然后就可以访http://192.168.0.73(虚拟ipvip)


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值