分类:
2010-03-23 15:46:25
IPMP的另一个例子及用if_mpadm关闭网卡时报no other functional interface available的分析
参考Solaris 10 IPMP 配置过程 , 我的配置说明如下
e1000g1 : 192.168.0.3 (data ip)
e1000g2 : 192.168.0.4 (data ip)
192.168.0.2(test ip)
设置eeprom
[root@lx9162 /]#>more /etc/hostname.e1000g1
192.168.0.2 netmask + broadcast + group mpgrp up addif 192.168.0.3 deprecated netmask + broadcast + -failover up
[root@lx9162 /]#>more /etc/hostname.e1000g2
192.168.0.4 netmask + broadcast + group mpgrp deprecated - failover up
之前是按照上面的文档来配的,即2网卡都加了 –failover , 这样在做disable e1000g1或e1000g2的时候,会出错
[root@lx9162 /]#>if_mpadm -d e1000g1
Offline failed as there is no other functional interface available in the multipathing group for failing over the network access.
提示可在 里找到原因,
off-line failed as there is no other functional interface available in the multipathing group for failing over the network access.
This message means that other interfaces in the group are failed over already or the multipathing configuration was not suitable for completing a failover.
说白了没配置可切换的nic, 这个命令不知到往哪个nic切,所以放在IPMP group里的所有的nic都配为 –failover的话,就是balance模式,balance模式下就不需要切换了。所以/etc/hostname.e1000g2需要修改.
[root@lx9162 /]#>more /etc/hostname.e1000g2
192.168.0.4 netmask + broadcast + group mpgrp deprecated failover up ,表示如果group其他nic fail 的话,可以向他切换.
[root@lx9162 /]#>ifconfig -a
lo0: flags=2001000849
inet 127.0.0.1 netmask ff000000
e1000g0: flags=1000843
inet 10.198.91.62 netmask fffff800 broadcast 10.198.95.255
ether 0:13:72:52:59:2c
e1000g1: flags=1000843
inet 192.168.0.2 netmask ffffff00 broadcast 192.168.0.255
groupname mpgrp
ether 0:13:72:52:59:2d
e1000g1:1: flags=9040843
inet 192.168.0.3 netmask ffffff00 broadcast 192.168.0.255
e1000g2: flags=1040843
inet 192.168.0.4 netmask ffffff00 broadcast 192.168.0.255
groupname mpgrp
ether 0:4:23:ca:e9:f0
现在可以disable e1000g1了
[root@lx9162 /]#>if_mpadm -d e1000g1
[root@lx9162 /]#>ifconfig -a
lo0: flags=2001000849
inet 127.0.0.1 netmask ff000000
e1000g0: flags=1000843
inet 10.198.91.62 netmask fffff800 broadcast 10.198.95.255
ether 0:13:72:52:59:2c
e1000g1: flags=89000842
groupname mpgrp
ether 0:13:72:52:59:2d
e1000g1:1: flags=89040842
OFFLINE> mtu 1500 index 3 inet 192.168.0.3 netmask ffffff00 broadcast 192.168.0.255
e1000g2: flags=1040843
groupname mpgrp
ether 0:4:23:ca:e9:f0
e1000g2:1: flags=1000843
inet 192.168.0.2 netmask ffffff00 broadcast 192.168.0.255
可以看到data ip 从e1000g1切到了e1000g2.
-------------------------------------------------------------------------------------------------------------------
Nic的OFFLINE信息也表明该NIC出错了,可能已发生切换。
发生切换的NIC有时候的信息为failed, 也表示该NIC出错了,可能已发生切换。如下:
[root@vxvm56 /]#>ifconfig -a
lo0: flags=2001000849
inet 127.0.0.1 netmask ff000000
e1000g0: flags=1000843
inet 10.198.91.56 netmask fffff800 broadcast 10.198.95.255
ether 0:4:23:d2:b:da
e1000g1: flags=11000843
inet 192.168.1.1 netmask ffffff00 broadcast 192.168.1.255
groupname fzu1
ether 0:4:23:d2:b:db
e1000g1:1: flags=19040843
inet 192.168.1.2 netmask ffffff00 broadcast 192.168.1.255
e1000g2: flags=1000842
inet 0.0.0.0 netmask 0
ether 0:14:22:15:ba:ba
------------------------------------------------------------------------------------------------------------------
再enable e1000g1, ifconfig 恢复到以前状态。
[root@lx9162 /]#>if_mpadm -r e1000g1
[root@lx9162 /]#>ifconfig -a
lo0: flags=2001000849
inet 127.0.0.1 netmask ff000000
e1000g0: flags=1000843
inet 10.198.91.62 netmask fffff800 broadcast 10.198.95.255
ether 0:13:72:52:59:2c
e1000g1: flags=1000843
inet 192.168.0.2 netmask ffffff00 broadcast 192.168.0.255
groupname mpgrp
ether 0:13:72:52:59:2d
e1000g1:1: flags=9040843
e1000g2: flags=1040843
groupname mpgrp
ether 0:4:23:ca:e9:f0
[root@lx9162 /]#>more /etc/hostname.e1000g1
192.168.0.2 netmask + broadcast + group mpgrp up addif 192.168.0.3 deprecated netmask + broadcast + -failover up
[root@lx9162 /]#>more /etc/hostname.e1000g2
192.168.0.4 netmask + broadcast + group mpgrp deprecated failover up
参数说明:
addif 表示为接口添加子接口,在这里是指要在子接口上配置测试IP;
deprecated 指表示测试地址不用于外发包,防止应用程序使用该IP;
-failover 表示在接口出现故障时测试地址不进行故障转移;
standby 将接口标记为待机接口;
不明白的地方,按照/etc/hostname.e1000g1的配置,192.168.0.3是test ip , 为什么切换的反而是不是192.168.0.2呢?
-------------弄清楚了,切换的就是data ip,而不是test ip.这也很好理解,IPMP就是要把业务IP(data ip)从一个nic(当它fail时)切到另一个NIC。
e1000g1: flags=1000843
inet 192.168.0.3 netmask ffffff00 broadcast 192.168.0.255
groupname mpgrp
ether 0:13:72:52:59:2d
e1000g1:1: flags=9040843
mtu 1500 index 3 inet 192.168.0.2 netmask ffffff00 broadcast 192.168.0.255
e1000g2: flags=1040843
groupname mpgrp
ether 0:4:23:ca:e9:f0
deprecated说明该IP是test ip, 无此标志则该IP为Data ip (用于切换的)