链路聚合(bonding绑定)是将多个物理链路汇聚在一起,形成一个逻辑端口。这个技术帮助将服务器的负荷分担而提高容错。
我们按照标准链路汇聚控制协议设置链路聚合。这个服务是收费的,最新的价格可以看在这个网页的LACP标签。
为了设置LACP请在你的个人中心订购服务,准备你的服务器并在你的个人中心创建要设置LACP的询问。
准备的流程
在Ubuntu 14.04设置的系列
安装ifenslave包并联系我们。
apt-get install ifenslave
设置服务器
停止网络的服务:
# stop networking
在文件/etc/modules添加"bonding"行
为了加载bonding模式请运行modprobe:
# modprobe bonding
如果模块加载了,执行以下的指令,你就看见跟"bonding 147456 0"相似的消息:
# lsmod | grep bonding
bonding 147456 0
组建链路汇聚以后请在服务器上设置bonding(绑定)
编辑网络接口的设置:
# vim /etc/network/interfaces
例子(请把em1和em2换成为你的网络接口的名称):
auto em1
iface em1 inet manual
bond-master bond0
bond-primary em1
auto em2
iface em2 inet manual
bond-master bond0
auto bond0
iface bond0 inet static
address 92.223.103.25
gateway 92.223.103.1
netmask 255.255.255.0
bond-mode 4
bond-miimon 100
bond-lacp-rate 1
bond-slaves em1 em2
执行以下的指令以后变更就生效:
# start networking
如果执行上面描写的步骤以后bonding(绑定)不工作,试试重新启动操作系统。
绑定的状态可以这样的检查:
cat /proc/net/bonding/bond0
指令输出的例子:
Ethernet Channel Bonding Driver: v3.1.1 (September 26, 2006)
Bonding Mode: IEEE 802.3ad Dynamic link aggregation
Transmit Hash Policy: layer2 (0)
MII Status: up
MII Polling Interval (ms): 100
Up Delay (ms): 0
Down Delay (ms): 0
802.3ad info
LACP rate: fast
Active Aggregator Info:
Aggregator ID: 1
Number of ports: 2
Actor Key: 17
Partner Key: 1
Partner Mac Address: 00:77:54:71:a8:6f
Slave Interface: eth0
MII Status: up
Link Failure Count: 0
Permanent HW addr: 00:99:97:60:9d:48
Aggregator ID: 1
Slave Interface: eth1
MII Status: up
Link Failure Count: 0
Permanent HW addr: 00:00:85:60:9d:49
Aggregator ID: 1
注意!设置的时候要跟Ubuntu的文件核对。(寻找"LACP")