Chinaunix首页 | 论坛 | 博客
  • 博客访问: 116051
  • 博文数量: 90
  • 博客积分: 1370
  • 博客等级: 中尉
  • 技术积分: 1005
  • 用 户 组: 普通用户
  • 注册时间: 2011-12-20 20:37
文章分类

全部博文(90)

文章存档

2012年(90)

分类: IT业界

2012-01-04 20:51:55

IPMP

IPMPIPNetwork Multipathing)是Solaris产品中的一个主要特性,其目的在于:一、增加网络的吞吐量,可方便快捷的将几个网络接口绑定在一起使用,从而起到增加带宽的作用。二、实现网络接口的有效性,通过IPMP,可以做到网络接口的冗余使用,即使宕掉一块网卡,其他的网卡均能有效运行,并且坏掉的网卡上的业务IP不会丢失,将平滑转移到其他网卡上。
配置方法:


1
、配置/etc/hosts
#
# Internet host table
#
127.0.0.1        localhost        
10.4.128.226        s10        loghost   # Primary Interface Address
#Modifications made for IPMP
10.4.128.228        s102      # Second Interface Address
10.4.128.230        s103      # Third Interface Address
10.4.128.225        test1     # Primary Test Address
10.4.128.227        test2     # Second Test Address
10.4.128.232        test3     # Third Test Address

可能你会有疑问,为什么需要这么多的IP地址,其实很简单,每个网卡必须都有一个IP地址,所以三个网卡就是三个IP地址,那么你必须赋予一个接口一个测试地址.这个地址必须是可以路由的地址,用来监控每个接口的状态,错误检测以及恢复,如此算来,一个是6个地址。

2
、配置MAC地址,以免冲突
你需要在eeprom里修改local-mac-address?的值为true
具体命令如下:
# eeprom local-mac-address?=true

3
、配置网卡地址
这时候你需要配置hostname.xxxxxx是你对应的三个网卡设备名,我的网卡设备名分别是pcn0pcn1pcn2。将下面列出的内容写如你对应的文件中。
# cat /etc/hostname.pcn0
s10 netmask + broadcast + group mpgrp up \
addif test1 deprecated netmask + broadcast + -failover up

# cat /etc/hostname.pcn1
s102 netmask + broadcast + group mpgrp up \
addif test2 deprecated netmask + broadcast + -failover up

# cat /etc/hostname.pcn2
s103 netmask + broadcast + group mpgrp up \
addif test3 deprecated netmask + broadcast + -failover up

4
、重新启动
#init 6

5
、测试容余
强行使网卡failover
#if_mpadm -d pcn2

这时你会观察到,pcn2上的地址和pcn0上的地址都转移到了pcn1
重新启用网卡
#if_mpadm -r pcn2

因为我是用虚拟机搭建的环境,没有做进一步的测试。如果大家有实验环境的话,可以拔网线试试,或者上传一个比较大的文件测试一下读写速度。


补充一个 standby的方式
# cat /etc/hostname.pcn0
s10 netmask + broadcast + group test up \
addif test1 deprecated netmask + broadcast + -failover up

第一快网卡同样配置
# cat /etc/hostname.pcn1
s102 netmask + broadcast + deprecated group test –failover standby up 

注意 –failover要在 standby前面
standby 要在up

注意比较和前面的不同

阅读(631) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~