CentOS6.2下搭建LVS(DR)+Keepalived实现高性能高可用负(3)

 

 

首页服务器应用

背景:

阅读新闻

CentOS6.2下搭建LVS(DR)+Keepalived实现高性能高可用负载均衡服务器

[日期:2012-03-24]   来源:Linux社区  作者:crazylinux   [字体:]  

6、在2台RealServer中分别配置HTTP并启动realserver.sh
[root@host3 ~]# yum -y install httpd
[root@host3 ~]# cd /var/www/html/
[root@host3 html]# cat index.html
<h1>RealServer 192.168.10.3</h1>
[root@host3 html]# /etc/init.d/httpd start
[root@host3 ~]# /etc/init.d/realserver.sh start
另一台机器配置一样,过程略、、、
7、测试:
分别启动Keepalived
[root@host1 ~]# chkconfig keepalived on
[root@host1 ~]# /etc/init.d/keepalived restart
[root@host1 ~]# ipvsadm
IP Virtual Server version 1.2.1 (size=4096)
Prot LocalAddress:Port Scheduler Flags
  -> RemoteAddress:Port           Forward Weight ActiveConn InActConn
TCP  192.168.10.100:http rr persistent 50
  -> 192.168.10.3:http            Route   1      0          0        
  -> 192.168.10.4:http            Route   1      0          0  
先关闭LVS_Master的Keepalived,观察LVS_Backup的日志
[root@host2 ~]# tailf /var/log/messages
Mar 21 07:22:28 host2 Keepalived_vrrp: VRRP_Instance(VI_1) Transition to MASTER STATE
Mar 21 07:22:29 host2 Keepalived_vrrp: VRRP_Instance(VI_1) Entering MASTER STATE
Mar 21 07:22:29 host2 Keepalived_vrrp: VRRP_Instance(VI_1) setting protocol VIPs.
Mar 21 07:22:29 host2 Keepalived_healthcheckers: Netlink reflector reports IP 192.168.10.100 added
Mar 21 07:22:29 host2 Keepalived_vrrp: VRRP_Instance(VI_1) Sending gratuitous ARPs on eth0 for 192.168.10.100
在测试机上访问:

CentOS6.2下搭建LVS(DR)+Keepalived实现高性能高可用负

启动LVS_Master,在查看LVS_Backup日志
[root@host2 ~]# tailf /var/log/messages
Mar 21 07:26:20 host2 Keepalived_vrrp: VRRP_Instance(VI_1) Received higher prio advert
Mar 21 07:26:20 host2 Keepalived_vrrp: VRRP_Instance(VI_1) Entering BACKUP STATE
Mar 21 07:26:20 host2 Keepalived_vrrp: VRRP_Instance(VI_1) removing protocol VIPs.
Mar 21 07:26:20 host2 Keepalived_healthcheckers: Netlink reflector reports IP 192.168.10.100 removed
一切访问正常~!祝各位好运!~

 

解决CentOS 6.2下安装ipvsadm-1.26报错

CentOS6.2下搭建LVS(NAT)+Keepalived实现高性能高可用负载均衡服务器

相关资讯       LVS 

   

本文评论   查看全部评论 (0)


评论声明

尊重网上道德,遵守中华人民共和国的各项有关法律法规

承担一切因您的行为而直接或间接导致的民事或刑事法律责任

本站管理人员有权保留或删除其管辖留言中的任意内容

本站有权在网站内转载或引用您的评论

参与本评论即表明您已经阅读并接受上述条款

 

 

 

最新资讯

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:http://www.heiqu.com/4fb5d2825083f70eb5ccde27729b0785.html