免费注册 查看新帖 |

Chinaunix

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

Solaris9中IPMP的配置和故障规避 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2008-09-14 13:46 |只看该作者 |倒序浏览
关键词
IPMP
                                          
比如SUN V240的机器,使用bge0和bge1两个网口做IPMP。一般情况下bge0配了一个IP地址,比如10.41.80.132。此时如下配置IPMP。
1. 修改/etc/hosts文件:
10.41.80.132    SUN240        loghost
10.41.80.31     SUN240-bge0-test
10.41.80.32     SUN240-bge1-test
2. 修改/etc/hostname.bge0文件:
SUN240
SUN240 netmask + broadcast + group IPMP1 up
addif SUN240-bge0-test netmask + broadcast + deprecated -failover up
3. 增加一个文件/etc/hostname.bge1文件:
SUN240-bge1-test netmask + broadcast + group IPMP1 deprecated -failover up
4. 增加一个路由,有两种方法:
1) 创建或修改/etc/defaultrouter,增加一个能ping通的IP地址,比如10.41.80.254
2) 在rc3.d目录中增加一个脚本文件,内容为:route add -host 10.41.80.254 10.41.80.254
5. 重起小型机,那么IPMP就会生效。
下面来解释一下上面的一些东西:
● hosts文件中后两个地址和对应的host可以随便起,只要不和网络中地址冲突,且IP属于同一个网段的即可;
● hostname.bge0中第一行要不要无所谓;
● hostname.bge0第二行中的IPMP1是IPMP的组名,可以随便取;
● 这样配完的IPMP的有效地址是10.41.80.132,即hostname.bge0文件中第二行的第一个字段(是个host名,呵呵)对应的地址
在绝大多数的文档中,都说明要增加的路由地址,且要求这个地址不能断。那么这个地址断的情况如何呢?测试的情况如下。
这是正常的情况下的网卡状态:
[email=root@SUN240]root@SUN240[/email]
# ifconfig -a
lo0: flags=1000849 mtu 8232 index 1
        inet 127.0.0.1 netmask ff000000
bge0: flags=1000843 mtu 1500 index 2
        inet 10.41.80.132 netmask fffffc00 broadcast 10.41.83.255
        groupname IPMP1
        ether 0:3:ba:f4:55:b1
bge0:1: flags=9040843 mtu 1500 index 2
        inet 10.41.80.31 netmask fffffc00 broadcast 10.41.83.255
bge1: flags=9040843 mtu 1500 index 3
        inet 10.41.80.32 netmask fffffc00 broadcast 10.41.83.255
        groupname IPMP1
        ether 0:3:ba:f4:55:b2
不论路由按照哪种方式配置,只要这个地址断开,那么IPMP在几秒钟之内就会FAIL:
[email=root@SUN240]root@SUN240[/email]
# Nov 22 00:28:58 SUN240 in.mpathd[100]: All Interfaces in group IPMP1 have failed
此时的网络状态如下,可以看到IPMP组中网卡都FAIL了:
[email=root@SUN240]root@SUN240[/email]
# ifconfig -a
lo0: flags=1000849 mtu 8232 index 1
        inet 127.0.0.1 netmask ff000000
bge0: flags=11000843 mtu 1500 index 2
        inet 10.41.80.132 netmask fffffc00 broadcast 10.41.83.255
        groupname IPMP1
        ether 0:3:ba:f4:55:b1
bge0:1: flags=19040843 mtu 1500 index 2
        inet 10.41.80.31 netmask fffffc00 broadcast 10.41.83.255
bge1: flags=19040843 mtu 1500 index 3
        inet 10.41.80.32 netmask fffffc00 broadcast 10.41.83.255
        groupname IPMP1
        ether 0:3:ba:f4:55:b2
[email=root@SUN240]root@SUN240[/email]
# Nov 22 00:28:58 SUN240 last message repeated 1 time
路由地址恢复后,IPMP恢复:
Nov 22 00:30:12 SUN240 in.mpathd[100]: Successfully failed back to NIC bge0
Nov 22 00:30:12 SUN240 in.mpathd[100]: NIC repair detected on bge0 of group IPMP1
Nov 22 00:30:12 SUN240 in.mpathd[100]: At least 1 interface (bge0) of group IPMP1 has repaired
Nov 22 00:30:13 SUN240 in.mpathd[100]: Successfully failed back to NIC bge1
Nov 22 00:30:13 SUN240 in.mpathd[100]: NIC repair detected on bge1 of group IPMP1
此时网卡状态恢复:
[email=root@SUN240]root@SUN240[/email]
# ifconfig -a
lo0: flags=1000849 mtu 8232 index 1
        inet 127.0.0.1 netmask ff000000
bge0: flags=1000843 mtu 1500 index 2
        inet 10.41.80.132 netmask fffffc00 broadcast 10.41.83.255
        groupname IPMP1
        ether 0:3:ba:f4:55:b1
bge0:1: flags=9040843 mtu 1500 index 2
        inet 10.41.80.31 netmask fffffc00 broadcast 10.41.83.255
bge1: flags=9040843 mtu 1500 index 3
        inet 10.41.80.32 netmask fffffc00 broadcast 10.41.83.255
        groupname IPMP1
        ether 0:3:ba:f4:55:b2
在实际中路由地址中断的可能性还是很大的,如何避免因为这个地址断开导致IPMP不可用?方法其实很简单:增加多个路由地址。推荐修改rc3.d目录中的脚本文件,内容为:
route add -host 10.41.80.20 10.41.80.20
route add -host 10.41.80.21 10.41.80.21
route add -host 10.41.80.22 10.41.80.22
route add -host 10.41.80.23 10.41.80.23
...
其中各个地址是要在网络中实际存在的。
这样的效果非常的明显,经过测试,中断多个路由地址,只要还有一个存在,可以ping通,IPMP就不会中断。测试也表明这个脚本文件中的路由地址至少配置到5个是没有问题的,一般来说这就足够安全了。


本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/8721/showart_1192995.html
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

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

清除 Cookies - ChinaUnix - Archiver - WAP - TOP