最近遇到一个很奇怪的问题,在做两台服务器负载均衡的时候,vip已经添加了,而且能ping通了,但是页面访问不了,也就是说80端口一直不通,ipvsadm -lnc查看链接状态全部是SYN_RECV。网上找了好长时间,也没有解决办法,有的说vip没有监听,有的说广播风暴。额~基本上都不靠谱。下面说一下我的处理方法,绝对管用!!!

环境:

   keepalived + win2008R2*2

1、配置keepalived(DR模式)

2、在windows服务器添加loopback网卡

3、在windows服务器上执行以下4条命令(这个是最最关键的

netsh interface ipv4 set interface "实节点网卡名字" weakhostreceive=enabled
netsh interface ipv4 set interface "
实节点网卡名字" weakhostsend=enabled
netsh interface ipv4 set interface "
实节点环回网卡名字" weakhostreceive=enabled
netsh interface ipv4 set interface "
实节点环回网卡名字" weakhostsend=enabled

每执行一行都会提示“正确”


解释一下

实节点网卡名字:vip最后分发到的ip对应的网卡名字,我的是“本地连接”

实节点环回网卡名字:是你添加的回环网卡,一般都是“loopback”