Linux 配置双网卡绑定实现负载均衡(2)

Bonding Mode: adaptive load balancing
Primary Slave: None
Currently Active Slave: ens33
MII Status: up
MII Polling Interval (ms): 100
Up Delay (ms): 0
Down Delay (ms): 0

Slave Interface: ens33
MII Status: up
Speed: 1000 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: 00:0c:29:34:7a:4a
Slave queue ID: 0

Slave Interface: ens34
MII Status: up
Speed: 1000 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: 00:0c:29:34:7a:54
Slave queue ID: 0

2.6、验证测试
•物理上关闭一个网卡(拔网线)

# 关闭前,速率是2000Mb/s
$ ethtool bond0
Settings for bond0:
    Supported ports: [ ]
    Supported link modes:  Not reported
    Supported pause frame use: No
    Supports auto-negotiation: No
    Advertised link modes:  Not reported
    Advertised pause frame use: No
    Advertised auto-negotiation: No
    Speed: 2000Mb/s
    Duplex: Full
    Port: Other
    PHYAD: 0
    Transceiver: internal
    Auto-negotiation: off
Cannot get wake-on-lan settings: Operation not permitted
    Link detected: yes

# 关闭后,速率速率变成1000Mb/s
$ ethtool bond0
Settings for bond0:
    Supported ports: [ ]
    Supported link modes:  Not reported
    Supported pause frame use: No
    Supports auto-negotiation: No
    Advertised link modes:  Not reported
    Advertised pause frame use: No
    Advertised auto-negotiation: No
    Speed: 1000Mb/s
    Duplex: Full
    Port: Other
    PHYAD: 0
    Transceiver: internal
    Auto-negotiation: off
Cannot get wake-on-lan settings: Operation not permitted
    Link detected: yes

注意:不可以使用ifdown 关闭网卡,会导致网络中断

3、总结

Linux bonding一共有7种工作模式(mode),如果是想要加大网卡的吞吐量,通常会使用mode=6的模式,如果是注重网络的稳定,通常会使用mode=1的模式;

Linux公社的RSS地址:https://www.linuxidc.com/rssFeed.aspx

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/12629.html