- Linux ネットワーク冗長化確認
- bonding ドライバ
- ネットワーク帯域の測定
- Linux サーバ 2台
- CentOS-6.3 Linux 2.6.32-279.22.1.el6.x86_64
- オンボード イーサネット 2口 + 拡張ボード NIC = 合計3口
- GbE (ギガビットイーサネット) スイッチ : Netgear GS110T
+-------+ +------------+ +-------+
|Linux | |GbE Switch | |Linux |
| +---+ +---+ +---+ +---+ |
| |GbE|-----|GbE| |GbE|-----|GbE| |
| +---+ +---+ +---+ +---+ |
| | | | | |
| +---+ +---+ +---+ +---+ |
| |GbE|-----|GbE| |GbE|-----|GbE| |
| +---+ +---+ +---+ +---+ |
| | | | | |
| +---+ +---+ +---+ +---+ |
| |GbE|-----|GbE| |GbE|-----|GbE| |
| +---+ +---+ +---+ +---+ |
| | | | | |
+-------+ +------------+ +-------+
bonding-mode |
モード |
ネットワークスイッチ設定 |
0 |
ラウンドロビン |
不要 |
1 |
アクティブー/バックアップ |
不要 |
2 |
balance-xor |
不要 |
3 |
broadcast |
不要 |
4 |
LACP または 802.3ad |
必要 |
5 |
balance-tlb |
不要 |
6 |
balance-alb |
不要 |
- LACP
- Link Aggregation Control Protocol
BOOTPROTO=none
NM_CONTROLLED=no
ONBOOT=yes
TYPE=Ethernet
IPV6INIT=no
USERCTL=no
DEVICE=eth0
NAME="System eth0"
<<MASTER=bond0>>
<<SLAVE=yes>>
DEVICE=bond0
NAME="bonding device"
BRIDGE=br0
BONDING_OPTS="mode=0 miimon=100 updelay=5000"
- bonding モード指定
- 今回はブリッジ接続
- ブリッジ接続が必要ない場合は、IP設定
DEVICE=br0
TYPE=Bridge
NAME="bridge device"
IPADDR=192.168.61.6
NETMASK=255.255.255.0
BROADCAST=192.168.61.255
GATEWAY=192.168.61.1
- /proc/net/bonding/bond0 を使う
# cat /proc/net/bonding/bond0
Ethernet Channel Bonding Driver: v3.6.0 (September 26, 2009)
Bonding Mode: IEEE 802.3ad Dynamic link aggregation
MII Polling Interval (ms): 100
Up Delay (ms): 5000
Down Delay (ms): 0
802.3ad info
LACP rate: fast
Aggregator selection policy (ad_select): stable
Slave Interface: eth0
MII Status: up
Speed: 1000 Mbps
Duplex: full
Slave Interface: eth1
MII Status: up
Speed: 1000 Mbps
Duplex: full
Slave Interface: eth2
MII Status: up
Speed: 1000 Mbps
Duplex: full
netperf によるネットワークスピードの測定
# netserver
# netperf -H ml110a
TCP STREAM TEST from 0.0.0.0 (0.0.0.0) port 0 AF_INET to ml110a.nona.to (192.168.61.5) port 0 AF_INET
Recv Send Send
Socket Socket Message Elapsed
Size Size Size Time Throughput
bytes bytes bytes secs. 10^6bits/sec
87380 16384 16384 10.02 941.43
- 経過時間: 10.02 秒
- スループット: 941.43 Mbit/秒
- 設定ファイル /etc/sysconfig/network-scripts/ifcfg-bond0
- 編集コマンド1
# vi /etc/sysconfig/network-scripts/ifcfg-bond0
# nano /etc/sysconfig/network-scripts/ifcfg-bond0
# service network restart
# tail -f /var/log/messages
bonding: bond0: link status definitely down for interface eth0, disabling it
e1000e: eth0 NIC Link is Up 1000 Mbps Full Duplex, Flow Control: None
bonding: bond0: link status up for interface eth0, enabling it in 5000 ms.
bond0: link status definitely up for interface eth0, 1000 Mbps full duplex.
# ping ml110b
# netperf -H 192.168.61.5 -- -P 12866 -L 192.168.61.221 & \
netperf -H 192.168.61.5 -- -P 12867 -L 192.168.61.222 & \
netperf -H 192.168.61.5 -- -P 12868 -L 192.168.61.223 & \
netperf -H 192.168.61.5 -- -P 12868 -L 192.168.61.224 & \
netperf -H 192.168.61.5 -- -P 12868 -L 192.168.61.225 & \
netperf -H 192.168.61.5 -- -P 12868 -L 192.168.61.226 &
TCP STREAM TEST from 192.168.61.224 (192.168.61.224) port 12868 AF_INET to 192.168.61.5 (192.168.61.5) port 12868 AF_INET
TCP STREAM TEST from 192.168.61.226 (192.168.61.226) port 12868 AF_INET to 192.168.61.5 (192.168.61.5) port 12868 AF_INET
TCP STREAM TEST from 192.168.61.225 (192.168.61.225) port 12868 AF_INET to 192.168.61.5 (192.168.61.5) port 12868 AF_INET
TCP STREAM TEST from 192.168.61.222 (192.168.61.222) port 12867 AF_INET to 192.168.61.5 (192.168.61.5) port 12867 AF_INET
TCP STREAM TEST from 192.168.61.221 (192.168.61.221) port 12866 AF_INET to 192.168.61.5 (192.168.61.5) port 12866 AF_INET
TCP STREAM TEST from 192.168.61.223 (192.168.61.223) port 12868 AF_INET to 192.168.61.5 (192.168.61.5) port 12868 AF_INET
Recv Send Send
Socket Socket Message Elapsed
Size Size Size Time Throughput
bytes bytes bytes secs. 10^6bits/sec
87380 16384 16384 10.03 629.74
87380 16384 16384 10.03 311.59
87380 16384 16384 10.27 657.43
87380 16384 16384 10.01 363.48
87380 16384 16384 10.02 298.03
87380 16384 16384 10.04 641.70