由于服务器整框对外提供服务,对外出去的两个交换机做了 bond 的备份模式,这样所有服务器的网络默认都是从同一个交换机出去,导致master交换机很忙,但slave交换机缺很闲,资源得不到合理利用,这时,就需要手工将其中一半的服务器的bond切换到slave交换机上,使交换机资源得到合理利用和分流的效果,具体操作如下:
一、需要查看的相关配置文件:
- cat /etc/modprobe.conf
- cat /proc/net/bonding/bond0
二、整理整框的主机名:
- #cat list
- SERVER-HST-01
- SERVER-HST-02
- SERVER-HST-03
- SERVER-HST-04
- SERVER-HST-05
- SERVER-HST-06
- SERVER-HST-07
- SERVER-HST-08
三、查看该框主机当前激活的网卡:
- #for i in `cat list`;do ssh $i "grep Currently /proc/net/bonding/bond0";done
- Currently Active Slave: eth0
- Currently Active Slave: eth0
- Currently Active Slave: eth0
- Currently Active Slave: eth0
- Currently Active Slave: eth0
- Currently Active Slave: eth0
- Currently Active Slave: eth0
- Currently Active Slave: eth0
- Currently Active Slave: eth0
- Currently Active Slave: eth0
- Currently Active Slave: eth0
- Currently Active Slave: eth0
四、确认master&slave两个网卡的状态都是 up的状态,确保切换后不会出问题:
- #for i in `cat list`;do ssh $i "grep MII /proc/net/bonding/bond0";done
- MII Status: up
- MII Status: up
- MII Status: up
- MII Polling Interval (ms): 100
- MII Status: up
- MII Status: up
- MII Status: up
- MII Polling Interval (ms): 100
- MII Status: up
- MII Status: up
- MII Status: up
五、将其中一半的slave激活:
- #for i in `tail -4 list`;do ssh $i "ifenslave -c bond0 eth1";done
六、确认当前激活网卡已经均分:
- #for i in `cat list`;do ssh $i "grep Currently /proc/net/bonding/bond0";done
- Currently Active Slave: eth0
- Currently Active Slave: eth0
- Currently Active Slave: eth0
- Currently Active Slave: eth0
- Currently Active Slave: eth1
- Currently Active Slave: eth1
- Currently Active Slave: eth1
- Currently Active Slave: eth1
阅读(1779) | 评论(0) | 转发(0) |