共计 1220 个字符,预计需要花费 4 分钟才能阅读完成。
最近在生产环境使用 lvs + keepalived 的过程中遇到一个问题就是我的 keepalived 配置文件中使用了超过 20 个虚拟地址,一超过 20 个的时候就发现 keepalived 出现问题,会随机逐步把超过的 IP 给踢出集群。
所以当时的问题就是:
- 为什么 keepalived 超过 20 个虚拟地址会有问题?
- 是不是我的配置导致的?
经过一番谷歌,查询到如下 Keepalived for more than 20 virtual addresses,题主和我遇到了相同的问题,
keepalived 有个分配给 vrrp_instance
最大的虚拟 IP 的限制,数量是 20。
解决办法就是使用 virtual_ipaddress_excluded
,示例:
vrrp_instance VI_1 {interface eth0
state MASTER
virtual_router_id 51
priority 101
virtual_ipaddress {10.200.85.100
}
virtual_ipaddress_excluded {10.200.85.101
. all the way to
10.200.85.200
}
}
virtual_ipaddress_excluded
contains a list of IP addresses that keepalived will bring up and down on the server, however they are not included in the VRRP packet itself so they don’t count towards the 20 IP address limit.
CentOS 6.3 下 Haproxy+Keepalived+Apache 配置笔记 http://www.linuxidc.com/Linux/2013-06/85598.htm
Haproxy + KeepAlived 实现 WEB 群集 on CentOS 6 http://www.linuxidc.com/Linux/2012-03/55672.htm
Keepalived+Haproxy 配置高可用负载均衡 http://www.linuxidc.com/Linux/2012-03/56748.htm
Haproxy+Keepalived 构建高可用负载均衡 http://www.linuxidc.com/Linux/2012-03/55880.htm
CentOS 7 上配置 LVS + Keepalived + ipvsadm http://www.linuxidc.com/Linux/2014-11/109237.htm
Keepalived 高可用集群搭建 http://www.linuxidc.com/Linux/2014-09/106965.htm
Keepalived 的详细介绍 :请点这里
Keepalived 的下载地址 :请点这里
本文永久更新链接地址 :http://www.linuxidc.com/Linux/2015-06/118587.htm