Chinaunix首页 | 论坛 | 博客
  • 博客访问: 375709
  • 博文数量: 78
  • 博客积分: 3274
  • 博客等级: 中校
  • 技术积分: 686
  • 用 户 组: 普通用户
  • 注册时间: 2009-11-06 12:47
文章分类

全部博文(78)

文章存档

2017年(1)

2016年(2)

2015年(2)

2014年(1)

2013年(5)

2012年(22)

2011年(8)

2010年(31)

2009年(6)

分类:

2011-04-21 12:49:53

实验环境:Solaris10 on vmware虚拟机。


    在 vmware中给虚拟机添加两个新的网卡,用于实验。新添加的网卡分别为e1000g1何e1000g2 。因此在/etc目录下添加下面两个文件和修改hosts文件。

一 IPMP probe-based


bash-3.00# more /etc/hostname.e1000g1
sys11 netmask + broadcast + group mpgrp-one up \
addif sys11-test-e1000g1 deprecated netmask + broadcast + -failover up
bash-3.00# more /etc/hostname.e1000g2
sys11-data-e1000g2 netmask + broadcast + group mpgrp-one up \
addif sys11-test-e1000g2 deprecated netmask + broadcast + -failover up
bash-3.00# more /etc/hosts
#
# Internet host table
#
::1     localhost      
127.0.0.1       localhost      
192.168.128.134 s10x64u8v       loghost
192.168.128.50  sys11   #Data address for e1000g1
192.168.128.52  sys11-data-e1000g2      #Data address for e1000g2
192.168.128.55  sys11-test-e1000g1      #Test address for e1000g1
192.168.128.57  sys11-test-e1000g2      #Test address for e1000g2

重启机器后,ifconfig命令查看如下。
bash-3.00# ifconfig -a
lo0: flags=2001000849 mtu 8232 index 1
        inet 127.0.0.1 netmask ff000000
e1000g0: flags=1000843 mtu 1500 index 2
        inet 192.168.128.134 netmask ffffff00 broadcast 192.168.128.255
        ether 0:c:29:28:10:22
e1000g1: flags=1000843 mtu 1500 index 3
        inet 192.168.128.50 netmask ffffff00 broadcast 192.168.128.255
        groupname mpgrp-one
        ether 0:c:29:28:10:2c
e1000g1:1: flags=9040843 mtu 1500 index 3
        inet 192.168.128.55 netmask ffffff00 broadcast 192.168.128.255
e1000g2: flags=1000843 mtu 1500 index 4
        inet 192.168.128.52 netmask ffffff00 broadcast 192.168.128.255
        groupname mpgrp-one
        ether 0:c:29:28:10:36
e1000g2:1: flags=9040843 mtu 1500 index 4
        inet 192.168.128.57 netmask ffffff00 broadcast 192.168.128.255

》》》》另开一个命令窗口,使用tail -f /var/adm/messages命令查看系统信息。


使用if_mpadm命令进行failover测试。
bash-3.00# if_mpadm -d e1000g1
Offline failed as there is no other functional interface available in the multipathing group for failing over the network access.

上面错误的原因如下:
如果这台机器没有defaultrouter,在本子网内没有别的SUN的机器,怎么去检测网口是不是还alive?IPMP是通过两个手段去probe 的,一个是去探测默认路由,如果找不到默认路由,那么就去寻找仲裁主机,寻找仲裁主机的方法就是发到224.0.0.1这个地址的multicast,事 实上,只有SUN的主机能够相应这个地址的multicast,能够成为仲裁主机。(具体见)
因此,解决上面的错误的有两种办法:再另开一个solaris虚拟机,并配置该虚拟机和试验机在同一个网段;或给实验机添加默认网关。两种方法经测试都可以解决问题。下面采取添加默认网关的方法。

bash-3.00# netstat -rn

Routing Table: IPv4
  Destination           Gateway           Flags  Ref     Use     Interface
-------------------- -------------------- ----- ----- ---------- ---------
192.168.128.0        192.168.128.134      U         1          0 e1000g0  
192.168.128.0        192.168.128.50       U         1          0 e1000g1  
192.168.128.0        192.168.128.52       U         1          1 e1000g2  
192.168.128.0        192.168.128.50       U         1          0 e1000g1:1
192.168.128.0        192.168.128.52       U         1          0 e1000g2:1
224.0.0.0            192.168.128.134      U         1          0 e1000g0  
127.0.0.1            127.0.0.1            UH        4        116 lo0      


bash-3.00# route add default 192.168.128.1
add net default: gateway 192.168.128.1

bash-3.00# netstat -rn

Routing Table: IPv4
  Destination           Gateway           Flags  Ref     Use     Interface
-------------------- -------------------- ----- ----- ---------- ---------
default              192.168.128.1        UG        1          0          
192.168.128.0        192.168.128.134      U         1          2 e1000g0  
192.168.128.0        192.168.128.52       U         1          5 e1000g2  
192.168.128.0        192.168.128.50       U         1          1 e1000g1  
192.168.128.0        192.168.128.50       U         1          0 e1000g2:1
192.168.128.0        192.168.128.52       U         1          0 e1000g1:1
224.0.0.0            192.168.128.134      U         1          0 e1000g0  
127.0.0.1            127.0.0.1            UH        3         75 lo0      

bash-3.00# if_mpadm -d e1000g1
bash-3.00# ifconfig -a
lo0: flags=2001000849 mtu 8232 index 1
        inet 127.0.0.1 netmask ff000000
e1000g0: flags=1000843 mtu 1500 index 2
        inet 192.168.128.134 netmask ffffff00 broadcast 192.168.128.255
        ether 0:c:29:28:10:22
e1000g1: flags=89000842 mtu 0 index 3
        inet 0.0.0.0 netmask 0
        groupname mpgrp-one
        ether 0:c:29:28:10:2c
e1000g1:1: flags=89040842 mtu 1500 index 3
        inet 192.168.128.55 netmask ffffff00 broadcast 192.168.128.255
e1000g2: flags=1000843 mtu 1500 index 4
        inet 192.168.128.52 netmask ffffff00 broadcast 192.168.128.255
        groupname mpgrp-one
        ether 0:c:29:28:10:36
e1000g2:1: flags=9040843 mtu 1500 index 4
        inet 192.168.128.57 netmask ffffff00 broadcast 192.168.128.255
e1000g2:2: flags=1000843 mtu 1500 index 4
        inet 192.168.128.50 netmask ffffff00 broadcast 192.168.128.255
bash-3.00# if_mpadm -r e1000g1
bash-3.00# ifconfig -a
lo0: flags=2001000849 mtu 8232 index 1
        inet 127.0.0.1 netmask ff000000
e1000g0: flags=1000843 mtu 1500 index 2
        inet 192.168.128.134 netmask ffffff00 broadcast 192.168.128.255
        ether 0:c:29:28:10:22
e1000g1: flags=1000843 mtu 1500 index 3
        inet 192.168.128.50 netmask ffffff00 broadcast 192.168.128.255
        groupname mpgrp-one
        ether 0:c:29:28:10:2c
e1000g1:1: flags=9040843 mtu 1500 index 3
        inet 192.168.128.55 netmask ffffff00 broadcast 192.168.128.255
e1000g2: flags=1000843 mtu 1500 index 4
        inet 192.168.128.52 netmask ffffff00 broadcast 192.168.128.255
        groupname mpgrp-one
        ether 0:c:29:28:10:36
e1000g2:1: flags=9040843 mtu 1500 index 4
        inet 192.168.128.57 netmask ffffff00 broadcast 192.168.128.255


》》》》messages中的信息
Feb 16 09:24:39 s10x64u8v in.mpathd[202]: [ID 832587 daemon.error] Successfully failed over from NIC e1000g1 to NIC e1000g2
Feb 16 09:24:58 s10x64u8v in.mpathd[202]: [ID 620804 daemon.error] Successfully failed back to NIC e1000g1
Feb 16 09:32:08 s10x64u8v in.mpathd[202]: [ID 832587 daemon.error] Successfully failed over from NIC e1000g1 to NIC e1000g2
Terminated



二 IPMP link-based

bash-3.00# more /etc/hostname.e1000g1
sys11 netmask + broadcast + group mpgrp-0 up
bash-3.00# more /etc/hostname.e1000g2
sys11-data-e1000g2 netmask + broadcast + group mpgrp-0 up
bash-3.00# ifconfig -a
lo0: flags=2001000849 mtu 8232 index 1
        inet 127.0.0.1 netmask ff000000
e1000g0: flags=1000843 mtu 1500 index 2
        inet 192.168.128.134 netmask ffffff00 broadcast 192.168.128.255
        ether 0:c:29:28:10:22
e1000g1: flags=1000843 mtu 1500 index 3
        inet 192.168.128.50 netmask ffffff00 broadcast 192.168.128.255
        groupname mpgrp-0
        ether 0:c:29:28:10:2c
e1000g2: flags=1000843 mtu 1500 index 4
        inet 192.168.128.52 netmask ffffff00 broadcast 192.168.128.255
        groupname mpgrp-0
        ether 0:c:29:28:10:36
bash-3.00# if_mpadm -d e1000g1
bash-3.00# ifconfig -a
lo0: flags=2001000849 mtu 8232 index 1
        inet 127.0.0.1 netmask ff000000
e1000g0: flags=1000843 mtu 1500 index 2
        inet 192.168.128.134 netmask ffffff00 broadcast 192.168.128.255
        ether 0:c:29:28:10:22
e1000g1: flags=89000842 mtu 0 index 3
        inet 0.0.0.0 netmask 0
        groupname mpgrp-0
        ether 0:c:29:28:10:2c
e1000g2: flags=1000843 mtu 1500 index 4
        inet 192.168.128.52 netmask ffffff00 broadcast 192.168.128.255
        groupname mpgrp-0
        ether 0:c:29:28:10:36
e1000g2:1: flags=1000843 mtu 1500 index 4
        inet 192.168.128.50 netmask ffffff00 broadcast 192.168.128.255
bash-3.00# if_mpadm -r e1000g1
bash-3.00# ifconfig -a
lo0: flags=2001000849 mtu 8232 index 1
        inet 127.0.0.1 netmask ff000000
e1000g0: flags=1000843 mtu 1500 index 2
        inet 192.168.128.134 netmask ffffff00 broadcast 192.168.128.255
        ether 0:c:29:28:10:22
e1000g1: flags=1000843 mtu 1500 index 3
        inet 192.168.128.50 netmask ffffff00 broadcast 192.168.128.255
        groupname mpgrp-0
        ether 0:c:29:28:10:2c
e1000g2: flags=1000843 mtu 1500 index 4
        inet 192.168.128.52 netmask ffffff00 broadcast 192.168.128.255
        groupname mpgrp-0
        ether 0:c:29:28:10:36

》》》》message中的信息:
Feb 16 10:30:42 s10x64u8v in.mpathd[178]: [ID 832587 daemon.error] Successfully failed over from NIC e1000g1 to NIC e1000g2
Feb 16 10:31:00 s10x64u8v in.mpathd[178]: [ID 620804 daemon.error] Successfully failed back to NIC e1000g1


阅读(1576) | 评论(0) | 转发(0) |
0

上一篇:prstat man page

下一篇:ZZ:IPMP的另一个例子

给主人留下些什么吧!~~