Bonding工作情況

原文:http://blog.chinaunix.net/uid-24540106-id-1643137.html

 

1、工作在模式0時

通過查看bond0的工作狀態查詢能詳細的掌握bonding的工作情況,正常狀態下的/proc/net/bonding/bond0文件:
[root@support ~]# cat /proc/net/bonding/bond0 
Ethernet Channel Bonding Driver: v3.4.0-1 (October 7, 2008)

Bonding Mode: load balancing (round-robin)
MII Status: up
MII Polling Interval (ms): 100
Up Delay (ms): 0
Down Delay (ms): 0

Slave Interface: eth0
MII Status: up
Speed: 100 Mbps
Duplex: full
Link Failure Count: 1
Permanent HW addr: 00:30:48:56:da:72

Slave Interface: eth1
MII Status: up
Speed: 100 Mbps
Duplex: full
Link Failure Count: 2
Permanent HW addr: 00:30:48:56:da:73

從win7 ping,通過拔插網線查看結果,不存在丟包

通過日誌查看網卡工作情況
[root@support ~]# tail -f /var/log/messages
May 29 08:01:41 support kernel: e1000: eth0 NIC Link is Up 100 Mbps Full Duplex, Flow Control: RX/TX
May 29 08:01:41 support kernel: bonding: bond0: link status definitely up for interface eth0.
May 29 08:01:48 support kernel: e1000: eth1 NIC Link is Down
May 29 08:01:48 support kernel: bonding: bond0: link status definitely down for interface eth1, disabling it
May 29 08:02:18 support kernel: e1000: eth1 NIC Link is Up 100 Mbps Full Duplex, Flow Control: RX/TX
May 29 08:02:18 support kernel: bonding: bond0: link status definitely up for interface eth1.
May 29 08:08:49 support kernel: e1000: eth0 NIC Link is Down
May 29 08:08:49 support kernel: bonding: bond0: link status definitely down for interface eth0, disabling it
May 29 08:08:56 support kernel: e1000: eth0 NIC Link is Up 100 Mbps Full Duplex, Flow Control: RX/TX
May 29 08:08:56 support kernel: bonding: bond0: link status definitely up for interface eth0.

2、工作在模式1時

正常狀態下的/proc/net/bonding/bond0文件:
[root@support ~]# cat /proc/net/bonding/bond0 
Ethernet Channel Bonding Driver: v3.4.0-1 (October 7, 2008)

Bonding Mode: fault-tolerance (active-backup)
Primary Slave: None
Currently Active Slave: eth0
MII Status: up
MII Polling Interval (ms): 100
Up Delay (ms): 0
Down Delay (ms): 0

Slave Interface: eth0
MII Status: up
Speed: 100 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: 00:30:48:56:da:72

Slave Interface: eth1
MII Status: up
Speed: 100 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: 00:30:48:56:da:73

從win7 ping,通過拔插網線查看結果,發現在拔網線時,偶爾會存在丟掉一個包的情況。

通過日誌查看網卡工作情況
[root@support ~]# tail -f /var/log/messages
May 29 08:25:24 support kernel: e1000: eth0 NIC Link is Down
May 29 08:25:24 support kernel: bonding: bond0: link status definitely down for interface eth0, disabling it
May 29 08:25:24 support kernel: bonding: bond0: making interface eth1 the new active one.
May 29 08:25:32 support kernel: e1000: eth0 NIC Link is Up 100 Mbps Full Duplex, Flow Control: RX/TX
May 29 08:25:32 support kernel: bonding: bond0: link status definitely up for interface eth0.
May 29 08:27:02 support kernel: e1000: eth1 NIC Link is Down
May 29 08:27:02 support kernel: bonding: bond0: link status definitely down for interface eth1, disabling it
May 29 08:27:02 support kernel: bonding: bond0: making interface eth0 the new active one.
May 29 08:27:48 support kernel: e1000: eth1 NIC Link is Up 100 Mbps Full Duplex, Flow Control: RX/TX
May 29 08:27:48 support kernel: bonding: bond0: link status definitely up for interface eth1.

小結

在 測試過程中,發現丟包情況與設備有關,老式的網新易得服務器上做測試時,兩個網卡無論是接到同一個二層交換機,還是分別接到兩個二層交換機,在拔插網線, 偶爾會出現丟掉一個包的情況。但是在戴爾R710上,當使用模式1時,丟包比較多,甚至在被其他計算機ping時,會出現ping不同的情況。

另外,模式0只是實現了簡單的負載均衡及冗餘備份。如果要實現高效的負載均衡,提高網絡流量,需設置成模式4,而這需要交換機的支持,牽涉到交換機的鏈路聚合(LACP)功能。有待日後再研究。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章