免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 31494 | 回复: 4
打印 上一主题 下一主题

keepalived虚IP获得了但是不能访问80端口 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2011-04-06 11:49 |只看该作者 |倒序浏览
本帖最后由 cnbird 于 2011-04-06 12:02 编辑

从配置
[root@localhost keepalived]# cat keepalived.conf
global_defs {
   router_id HAPROXY
    notification_email {
               yangning100661@123.com
        }
    notification_email_from keepalived@123.com
    smtp_server 127.0.0.1
}

vrrp_instance VI_1 {
    state BACKUP
    interface eth0
    virtual_router_id 177
    priority 199
    advert_int 1
    authentication {
        auth_type PASS
        auth_pass password
    }
    virtual_ipaddress {
        10.255.248.248
    }
}

virtual_server 10.255.248.248 80 {
    delay_loop 6
    lb_algo wrr
    lb_kind DR
    persistence_timeout 1800
    protocol TCP

    real_server 10.255.248.250 81 {
        weight 1
        TCP_CHECK {
                connect_port 81
                connect_timeout 3
        }
    }
    real_server 10.255.248.251 81 {
        weight 1
        TCP_CHECK {
                connect_port 81
                connect_timeout 3
        }
    }

}

主配置:
[root@localhost log]# cat /etc/keepalived/keepalived.conf
global_defs {
   router_id HAPROXY
    notification_email {
               yangning100661@123.com
        }
    notification_email_from keepalived@123.com
    smtp_server 127.0.0.1
}

vrrp_instance VI_1 {
    state MASTER
    interface eth0
    virtual_router_id 177
    priority 200
    advert_int 1
    authentication {
        auth_type PASS
        auth_pass password
    }
    virtual_ipaddress {
        10.255.248.248
    }
}

virtual_server 10.255.248.248 80 {
    delay_loop 6
    lb_algo wrr
    lb_kind DR
    persistence_timeout 1800
    protocol TCP

    real_server 10.255.248.250 81 {
        weight 1
        TCP_CHECK {
                connect_port 81
                connect_timeout 3
        }
    }
    real_server 10.255.248.251 81 {
        weight 1
        TCP_CHECK {
                connect_port 81
                connect_timeout 3
        }
    }

}

现在的问题是连接不到10.255.248.248的80端口

论坛徽章:
6
CU大牛徽章
日期:2013-04-17 10:59:39CU大牛徽章
日期:2013-04-17 11:01:45CU大牛徽章
日期:2013-04-17 11:02:15CU大牛徽章
日期:2013-04-17 11:02:36CU大牛徽章
日期:2013-04-17 11:02:582015年辞旧岁徽章
日期:2015-03-03 16:54:15
2 [报告]
发表于 2011-04-21 12:16 |只看该作者
ipvsadm 看看

论坛徽章:
0
3 [报告]
发表于 2017-02-05 15:20 |只看该作者
我的也是,怎么搞啊

论坛徽章:
1
2015年辞旧岁徽章
日期:2015-03-03 16:54:15
4 [报告]
发表于 2017-02-08 13:24 |只看该作者
如果配置文件如果没有问题的话, 就是你把nginx或是apache的服务重启就行了,就可以正常访问了。以后配置keep时先配置keep服务再配置aPACHE或是nginx服务就没有这样的问题了。

论坛徽章:
0
5 [报告]
发表于 2018-06-04 13:42 |只看该作者
DR模式下能使用不同端口吗?我表示怀疑@!
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

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

清除 Cookies - ChinaUnix - Archiver - WAP - TOP