您的位置:首页 > 其它

多网卡负载均衡(双网卡做bonding模式)

2012-09-11 10:03 127 查看
如果节点上有多个网络接口时可以通过bonding将多个网络接口虚拟为一个网络接口,bonding可以提供高可用及负载均衡功能,从而提高节点的网络接口性能及可用性。

1、使用如下命令安装

T01-MON11:~# apt-get install ifenslave-2.6

2、修改网络接口配置文件/etc/network/interfaces。

auto lo

iface lo inet loopback

auto bond0

iface bond0 inet static

address 192.168.0.189

netmask 255.255.0.0

gateway 192.168.1.1

slaves eth0 eth1 ①

bond-mode balance-rr ②

bond-miimon 100

其中:

① slaves eth0 eth1,说明绑定两个“从网卡”eth0和eth1到bond0逻辑接口,如果要绑定多个网络接口,继续在该行附加网络接口名字即可。

② bond-mode balance-rr,指定绑定模式为采用Round-robin策略的负载均衡模式,两个网络接口会均匀分担网络负载,另一个常用模式为active-backup,也就是hot standby模式,支持网络接口failover。

如果重新启动网络时出现bonding: Warning:的提示,则需要在/etc/modprobe.d目录下新建名为文件aliases-bond.conf的,并加入如下内容。

alias bond0 bonding
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: