keepalived 问题
我的keepalived 日志显示我的负载均衡几已经进入master状态
下面是keepalived的配置文件
! Configuration File for keepalived global_defs { # notification_email { # acassen@firewall.loc # failover@firewall.loc # sysadmin@firewall.loc # } # notification_email_from Alexandre.Cassen@firewall.loc # smtp_server 192.168.200.1 # smtp_connect_timeout 30 router_id LVS_DEVEL } vrrp_instance VI_1 { state MASTER interface eth0 virtual_router_id 51 priority 100 advert_int 5 authentication { auth_type PASS auth_pass 1111 } virtual_ipaddress { 192.168.200.88 } } virtual_server 192.168.200.88 80 { delay_loop 6 lb_algo wrr lb_kind DR nat_mask 255.255.255.0 persistence_timeout 0 protocol TCP real_server 192.168.200.101 80 { weight 1 TCP_CHECK { connect_timeout 5 nb_get_retry 3 delay_before_retry 3 connect_port 80 } } real_server 192.168.200.100 80 { weight 1 TCP_CHECK { connect_timeout 5 nb_get_retry 3 delay_before_retry 3 connect_port 80 } } } |
我单独访问100 和 101 机器都能正常访问 页面 但是通过88 负载均衡机器就访问不到 , 这几台机器网络都能ping同 起防火墙都关闭了 , 为什么 负载均衡没正常转发啊?????
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(11)
Keepalived+LVS或者LVS都是做高可用的,不是做负载均衡的。
你配置了Keepalived,还必须正确配置LVS的DR或者TUN。不然是用不了的。
! Configuration File for keepalived global_defs { # notification_email { # acassen@firewall.loc # failover@firewall.loc # sysadmin@firewall.loc # } # notification_email_from Alexa...
配置文件
如何绑定呢?
回复
http://wenku.baidu.com/view/7b5b160f011ca300a6c390d5.html
keepalive不是做高可用的吗,负载均衡是不是还需要一些组件来支持啊,例如apache,或者lvs
是啊,那你的配置下lvs,不要再纠结keepalive的配置了
lvs是linux2.6内核自带了
DR模式需要realserver也绑定vip地址
上面是 var/log/messages 的信息
[root@centOS03 ~]# tail /var/log/messages
Jan 22 18:40:46 centOS03 Keepalived_healthcheckers[2110]: Using LinkWatch kernel netlink reflector...
Jan 22 18:40:46 centOS03 Keepalived_healthcheckers[2110]: Activating healthchecker for service [192.168.200.101]:80
Jan 22 18:40:46 centOS03 Keepalived_healthcheckers[2110]: Activating healthchecker for service [192.168.200.100]:80
Jan 22 18:40:46 centOS03 kernel: IPVS: [wrr] scheduler registered.
Jan 22 18:40:51 centOS03 Keepalived_vrrp[2112]: VRRP_Instance(VI_1) Transition to MASTER STATE
Jan 22 18:40:56 centOS03 Keepalived_vrrp[2112]: VRRP_Instance(VI_1) Entering MASTER STATE
Jan 22 18:40:56 centOS03 Keepalived_vrrp[2112]: VRRP_Instance(VI_1) setting protocol VIPs.
Jan 22 18:40:56 centOS03 Keepalived_vrrp[2112]: VRRP_Instance(VI_1) Sending gratuitous ARPs on eth0 for 192.168.200.88
Jan 22 18:40:56 centOS03 Keepalived_healthcheckers[2110]: Netlink reflector reports IP 192.168.200.88 added
Jan 22 18:41:01 centOS03 Keepalived_vrrp[2112]: VRRP_Instance(VI_1) Sending gratuitous ARPs on eth0 for 192.168.200.88