免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 2734 | 回复: 1

请高人帮忙看看keepalived配置文件中的错误 [复制链接]

论坛徽章:
8
数据库技术版块每日发帖之星
日期:2015-12-22 06:20:00数据库技术版块每日发帖之星
日期:2015-12-23 06:20:00数据库技术版块每周发帖之星
日期:2016-02-03 16:55:09数据库技术版块每日发帖之星
日期:2016-07-15 06:20:00IT运维版块每日发帖之星
日期:2016-08-13 06:20:00数据库技术版块每日发帖之星
日期:2016-08-15 06:20:00IT运维版块每日发帖之星
日期:2016-08-16 06:20:00IT运维版块每日发帖之星
日期:2016-08-17 06:20:00
发表于 2015-12-28 20:23 |显示全部楼层
本帖最后由 zhancat200801 于 2015-12-28 20:33 编辑

大家好,本人在虚拟机上学习keepalived,配置文件如下,目前的问题是无法实现轮询,多次刷新只能访问其中一台真实web服务器。

哪位高人麻烦能帮忙看看是什么原因呢?多谢!

global_defs {
   notification_email {
      2234343@qq.com
   }
   notification_email_from 777743@qq.com
   smtp_server smtp.qq.com
   smtp_connect_timeout 30
   router_id LVS_DEVEL
}
# VIP1
vrrp_instance LVS_HA {
    state MASTER
    interface eth0
    #lvs_sync_daemon_inteface eth0
    virtual_router_id 151
    priority 100
    advert_int 5
    #nopreempt
    authentication {
        auth_type PASS
        auth_pass 2222
    }
    virtual_ipaddress {
        192.168.1.100
    }
}

virtual_server 192.168.1.100 80 {
    delay_loop 6
    lb_algo rr
    lb_kind DR
    netmask 255.255.255.0
    persistence_timeout 60
    protocol TCP
    real_server 192.168.1.107 80 {
        weight 1
        #notify_down /data/sh/mysql.sh
        TCP_CHECK {
           connect_timeout 10
           nb_get_retry 3
           delay_before_retry 3
           connect_port 80
        }
    }

     real_server 192.168.1.105 80 {
        weight 1
        #notify_down /data/sh/mysql.sh
        TCP_CHECK {
           connect_timeout 10
           nb_get_retry 3
           delay_before_retry 3
           connect_port 80
        }
    }

}

我的IP地址设置如下:
LVS-主:192.168.1.109
LVS-备:192.168.1.106
web服务器1:192.168.1.107
web服务器2:192.168.1.105
VIP:192.168.1.100

有一个问题是两台LVS服务器上,是否需要也绑定VIP到lo:0上?我目前的做法是绑定了,但不知道是否正确。请高人帮忙,谢谢!

论坛徽章:
36
IT运维版块每日发帖之星
日期:2016-04-10 06:20:00IT运维版块每日发帖之星
日期:2016-04-16 06:20:0015-16赛季CBA联赛之广东
日期:2016-04-16 19:59:32IT运维版块每日发帖之星
日期:2016-04-18 06:20:00IT运维版块每日发帖之星
日期:2016-04-19 06:20:00每日论坛发贴之星
日期:2016-04-19 06:20:00IT运维版块每日发帖之星
日期:2016-04-25 06:20:00IT运维版块每日发帖之星
日期:2016-05-06 06:20:00IT运维版块每日发帖之星
日期:2016-05-08 06:20:00IT运维版块每日发帖之星
日期:2016-05-13 06:20:00IT运维版块每日发帖之星
日期:2016-05-28 06:20:00每日论坛发贴之星
日期:2016-05-28 06:20:00
发表于 2016-01-18 17:59 |显示全部楼层
回复 1# zhancat200801

是否能轮询,按理说和 KeepAlived 没啥关系吧。你单独配置的 LVS,能否实现轮询的。

如果 KeepAlived 影响了轮询的话,那么看下 health check 的结果


   
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP