4.web1 和web2中启动heartbeat
#service heartbeat start
#ssh web2 ‘service heartbeat start’
5.测试heartbeat web高可用
web1作为主模式测试正常,测试web服务器的运行状态
#elinks -dump http://192.168.0.254
web1
现在将web1通过命令实现成为备份模式,来测试web2的工作情况:
web1上执行:
#/usr/share/heartbeat/hb_standby
2012/12/28_19:43:49 Going standby [all].
#elinks -dump http://192.168.0.254
web2
通过测试说明当web1作为主模式时,集群资源在web1服务上;
当web2作为主模式时,集群资源在web2服务上
6.重新配置资源实现web1与web2共享同一个web页面
web1
#vim /etc/ha.d/haresources
web1.example.com 192.168.0.254/24/eth0 Filesystems::192.168.0.100:/webfile::/var/www/html httpd
#scp /etc/ha.d/haresources root@web2:/etc/ha.d/
#service heartbeat restart
#ssh web2 'service heartbeat restart'
7再重新进行第五步测试,查看结果
web1作为主模式测试正常,测试web服务器的运行状态
#elinks -dump http://192.168.0.254
nfs
现在将web1通过命令实现成为备份模式,来测试web2的工作情况:
web1上执行:
#/usr/share/heartbeat/hb_standby
2012/12/28_19:43:49 Going standby [all].
#elinks -dump http://192.168.0.254
nfs
通过测试说明当web1与web2其中一个节点故障,不影响web的访问,实现了高可用
本文永久更新链接地址:http://www.linuxidc.com/Linux/2014-08/104926.htm
本文永久更新链接地址:http://www.linuxidc.com/Linux/2014-08/1049.htm
