Centos 6 伺服器做bond mode=6

來源:互聯網
上載者:User

標籤:centos 6 伺服器做bond mode=6


一般我見過的公司有 做mode=4 的,接下來我要實踐的是做mode=6 的一種模式(Bonding Mode: adaptive load balancing)



系統內容:

$ cat /etc/issueCentOS release 6.7 (Final)Kernel \r on an \m


需要一個bond口 自訂建立

$ cat /etc/sysconfig/network-scripts/ifcfg-bond0 DEVICE=bond0BONDING_OPTS="mode=6 miimon=100"BOOTPROTO=noneONBOOT=yesIPADDR=NETMASK=255.255.255.0GATEWAY=USERCTL=no


改變eth0 和 eth0 的配置

$ cat /etc/sysconfig/network-scripts/ifcfg-eth0DEVICE=eth0BOOTPROTO=noneONBOOT=yesMASTER=bond0SLAVE=yesUSERCTL=no
$ cat /etc/sysconfig/network-scripts/ifcfg-eth1DEVICE=eth1BOOTPROTO=noneONBOOT=yesMASTER=bond0SLAVE=yesUSERCTL=no



在建立一個檔案 並寫入一行配置

$ cat /etc/modprobe.d/bonding.conf alias bond0 bonding




注意一定要載入了bonding模組,一般預設是載入的。可以用以下命令查看

$ lsmod | grep bondingbonding               131724  0


載入命令(載入了就不需要打,打了也麼關係)

modprobe bonding



重啟網卡 /etc/init.d/network restart


測試命令:

ifocnfig -a

cat /proc/net/bonding/bond0

重要查看網路流量的資訊

$ cat /proc/net/bonding/bond0

Ethernet Channel Bonding Driver: v3.7.1 (April 27, 2011)


Bonding Mode: adaptive load balancing

Primary Slave: None

Currently Active Slave: eth1

MII Status: up

MII Polling Interval (ms): 100

Up Delay (ms): 0

Down Delay (ms): 0


Slave Interface: eth0

MII Status: up

Speed: 1000 Mbps

Duplex: full

Link Failure Count: 0

Permanent HW addr: 24:6e:96:0b:35:b8

Slave queue ID: 0


Slave Interface: eth1

MII Status: up

Speed: 1000 Mbps

Duplex: full

Link Failure Count: 0

Permanent HW addr: 24:6e:96:0b:35:b9

Slave queue ID: 0


上述可以看到 當前Active的是 eth1 


測試經驗: 

1 ifdown 其中一個口,其中一個起來(如果起來速度慢 一致ping bond地址 如果很慢 可能使交換器的收斂策略有關,要和你們網路工程師瞭解了)


2 直接reboot 機器看是否綁定也生效也正常


特點: 

1 bond口的mac 地址和正在使用的Currently Active Slave 網卡地址樣

$ ifconfig -a | grep -i hwbond0     Link encap:Ethernet  HWaddr 24:6E:96:0B:36:00  eth0      Link encap:Ethernet  HWaddr 24:6E:96:0B:36:01  eth1      Link encap:Ethernet  HWaddr 24:6E:96:0B:36:00


2 流量是負載分擔的

bond口流量=eth1 + eth0

650) this.width=650;" src="http://s3.51cto.com/wyfs02/M02/7F/7F/wKioL1cgv42iG6x4AAAs9sZ6CZk091.png" title="bond.png" alt="wKioL1cgv42iG6x4AAAs9sZ6CZk091.png" />


3 交換器上不用做任何配置(mode=6 交換器上一定不要做port channel 連接埠綁定)



本文出自 “崔德華營運打工從業路” 部落格,請務必保留此出處http://cuidehua.blog.51cto.com/5449828/1768388

Centos 6 伺服器做bond mode=6

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.