免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
123
最近访问板块 发新帖
楼主: lth0721
打印 上一主题 下一主题

lvs/DR 集群问题 [复制链接]

论坛徽章:
0
21 [报告]
发表于 2009-02-15 22:39 |只看该作者
原帖由 lth0721 于 2009-2-13 21:27 发表
"每台服务器都独立的IP地址,但都用IP Alias配置上同一VIP地址."

我想问一下为什么都要用IP Alias设置同一个VIP,不能直接设置在一个接口上吗?
比如我有2张网卡,eth0地址都在一个网段,我不可以把同一个vip都 ...

不能,因为设置到实际的接口上必然会arp广播(否则交换机认不到这个接口),所以只能借助其他接口上配置的ip进行alias。alias vip的作用只是 *欺骗本机操作系统*。。。
呀呀呀,你不能看看书啊,我快抓狂了。。。

论坛徽章:
0
22 [报告]
发表于 2009-02-16 09:20 |只看该作者
必然会响应。。
那我设置的这个没起作用啊?

echo "1" >/proc/sys/net/ipv4/conf/eth1/arp_ignore
echo "2" >/proc/sys/net/ipv4/conf/eth1/arp_announce
echo "1" >/proc/sys/net/ipv4/conf/all/arp_ignore
echo "2" >/proc/sys/net/ipv4/conf/all/arp_announce
能解释下这个的意思吗?难道我理解错了
或者给个参考书籍嘛

论坛徽章:
0
23 [报告]
发表于 2009-02-16 09:29 |只看该作者
其实看一下lvs的官方文档(还是中文的)和keepalived的文档就可以了,感觉楼主还是有些概念不是特别清楚。当然,刚刚开始的时候可能是有些困难。

论坛徽章:
0
24 [报告]
发表于 2009-02-16 10:57 |只看该作者
我去那个官网看了 实在是不敢恭维啊,资料也很少啊 只有一点概念性的介绍文章,好像并没有详细说为什么要以alias的方式设置vip的原因啊

论坛徽章:
0
25 [报告]
发表于 2009-02-16 11:15 |只看该作者

回复 #25 lth0721 的帖子

看看这里:http://www.ibm.com/developerwork ... vs/part3/index.html

关于DR模式,还是很清楚的说明了“为什么要以alias的方式设置vip的原因”

论坛徽章:
0
26 [报告]
发表于 2009-02-17 00:24 |只看该作者
LVS-HOWTO里面6.7. The Cure: 2.6.x kernels - arp_ignore/arp_announce有这样一个说法:
On the realservers the VIP will still be on lo (as for the hidden method). If the reply packets to the client are routed through eth0, then the arp announcements/requests are made through eth0 and you will apply the arp_ignore/arp_announce sysctls to eth0, not to lo (you cannot use arp_ignore/arp_announce on lo).

/etc/sysctl.conf
net.ipv4.conf.eth0.arp_ignore = 1
net.ipv4.conf.eth0.arp_announce = 2
net.ipv4.conf.all.arp_ignore = 1
net.ipv4.conf.all.arp_announce = 2

但好像网上不少安装文档关于non-arp的设置都是这样的(一般VIP设置为l0:0):
net.ipv4.conf.l0.arp_ignore = 1
net.ipv4.conf.l0.arp_announce = 2
net.ipv4.conf.all.arp_ignore = 1
net.ipv4.conf.all.arp_announce = 2

应该不少人都看到过这两种不同的设置把,哪位大侠能说一下呢?

论坛徽章:
0
27 [报告]
发表于 2009-02-17 09:25 |只看该作者
就是啊 按这个说法
net.ipv4.conf.l0.arp_ignore = 1
net.ipv4.conf.l0.arp_announce = 2
这个是根本不会起作用的

论坛徽章:
0
28 [报告]
发表于 2009-02-17 09:30 |只看该作者
原帖由 szszszsz 于 2009-2-17 00:24 发表
LVS-HOWTO里面6.7. The Cure: 2.6.x kernels - arp_ignore/arp_announce有这样一个说法:
On the realservers the VIP will still be on lo (as for the hidden method). If the reply packets to the client ...

哦 看你这段话好像是也可以把vip设置在eth0上

[ 本帖最后由 lth0721 于 2009-2-17 09:42 编辑 ]

论坛徽章:
0
29 [报告]
发表于 2009-02-17 10:20 |只看该作者
the new way arp_announce: see arp_announce (http://www.ssi.bg/~ja/#arp_announce) which sets arp_ignore and arp_announce on the arping interfaces. This typically means eth0, but if you have eth1 as well, you need to set it there too. (If you have multiple NICs; eth0..ethn, you only need fix the NIC that hears the arp requests.) Setting these parameters on lo has no effect as far as I understand from testing, reading the code and reading correspondance from Jullian, i.e. you aren't interested in these settings.

看来这些大虾都不知道为什么设置在那上面没有

论坛徽章:
0
30 [报告]
发表于 2009-02-21 00:59 |只看该作者
提示: 作者被禁止或删除 内容自动屏蔽
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

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

清除 Cookies - ChinaUnix - Archiver - WAP - TOP