- 论坛徽章:
- 0
|
本帖最后由 root_wxt 于 2012-06-05 10:15 编辑
既然drbd设备的速度下降到40M/s,改用10G的网络环境应该会得到提升,可惜没有10G的网络环境,无法测试,所以很自然的想到了bonding,于是我在vbox1和vbox2的Dom0主机上各增加一块千兆网卡,采用active-backup模式,效果很好,随机关闭eth0或eth1系统不间断运行,此模式表现良好,提高可靠性可以采用此模式,但我想倍增网络带宽,可惜的是采用其它几种模式都不能达到增加带宽的目的,速度不是等于active-bakup,就是低于它(模式4要交换机支持,未测试)。很晕,bonding高手,现身说个法?以下是基本安装记录:
图乱了,图大家可以参考:http://wiki.xen.org/wiki/Xen_Networking
Xen Networking with bonding for Debian Squeeze setting
PRT0 PRT1 PRT2 PRT3
| | | |
+--------------+---+---------------------------+---+--------------+
| | | | | |
| eth0 eth1 eth2 eth3 |
| | | | | |
| +-+-+ +-+-+ |
| | | |
| +--------------+--------------+ +--------------+--------------+ |
| | | | | | | |
| | bond0 | | bond1 | |
| | | | | |
| | xenbr0 vif1.0 vif1.1 | | vif2.0 vif2.1 xenbr1 | |
| | | \ | | / | | |
| +---^------------+---------\--+ +--/---------+------------^---+ |
| | | \ / | | |
| | +------+-------------X-------------+------+ | |
| | | | / \ | | | |
| | | +----+---------/--+ +--\---------+----+ | | |
| | | | | / | | \ | | | | |
| | | | eth0 eth1 | | eth0 eth1 | | | |
| | | | | | | | | | | | | |
| +-+-+ | | +-+-+ +-+-+ | | +-+-+ +-+-+ | | +-+-+ |
| | | | | | | | | | | | | | | | | | | |
| www ssh | | www ssh ftp pop | | www ssh ftp pop | | ftp pop |
| | | | | | | |
| Domain0 | | Domain1 | | Domain2 | | Domain0 |
+-----------+ +-----------------+ +-----------------+ +-----------+
# apt-get install ifenslave-2.6
配置网卡
bonding采用active-backup模式
修改/etc/network/interfaces
auto bond0
iface bond0 inet static
address 192.168.1.15
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
gateway 192.168.1.1
bond-mode active-backup
bond_miimon 100
bond_downdelay 200
bond_updelay 200
slaves eth0 eth1
auto xenbr0
iface xenbr0 inet static
bridge_ports bond0
address 192.168.1.15
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
gateway 192.168.1.1
# dns-* options are implemented by the resolvconf package, if installed
dns-nameservers 61.177.7.1
# service networking restart
配置/etc/xen/xend-config.sxp
注释掉(network-script network-bridge),不允许系统自动桥接,否则系统会冲突
PV DomU的网卡配置
vif = ['vifname=mail,ip=192.168.1.21,bridge=xenbr0']
以下是bonding的几种模式,一并列出来,供参考
mode=0 (balance-rr)
Round-robin policy: Transmit packets in sequential order from the first available slave through the last. This mode provides load balancing and fault tolerance.
mode=1 (active-backup)
One slave interface is active at any time. If one interface fails, another interface takes over the MAC address and becomes the active interface. Provides fault tolerance only. Doesn’t require special switch support
mode=2 (balance-xor)
Tranmissions are balanced across the slave interfaces based on ((source MAC) XOR (dest MAC)) modula slave count. The same slave is selected for each destination MAC. Provides load balancing and fault tolerance.
mode=3 (broadcast)
Transmits everything on all slave interfaces. Provides fault tolerance.
mode=4 (802.3ad)
This is classic IEEE 802.3ad Dynamic link aggregation. This requires 802.3ad support in the switch and driver support for retrieving the speed and duplex of each slave.
mode=5 (balance-tlb)
Adaptive Transmit Load Balancing. Incoming traffic is received on the active slave only, outgoing traffic is distributed according to the current load on each slave. Doesn’t require special switch support
mode=6 (balance-alb)
Adaptive Load Balancing - provides both transmit load balancing (TLB) and receive load balancing for IPv4 via ARP negotiation. Doesn’t require special switch support, but does require the ability to change the MAC address of a device while it is open. |
|