Skip to content

6. 个性化配置

6.1 使用网口聚合加速部署

使用网口聚合增加管理节点的上传带宽,可以增加部署速度。

  1. 在管理节点上,安装 ifenslave 模块。
shell
sudo apt install ifenslave
  1. 加载 bonding 模块。
shell
# 载入模块
sudo modprobe bonding
# 查看模块是否载入成功
sudo lsmod | grep bonding
  1. 配置网口聚合。 以 bond6 模式为例,配置双网口的bond,要聚合的网口名字为et0 和 eth1。 修改/etc/netplan/00-installer-config.yaml 文件如下:
配置文件
yaml
network:
  version: 2
  ethernets:
    eth1:
      dhcp4: false
    eth2:
      dhcp4: false
  bonds:
    bond0:
      addresses: [192.168.1.88/24]
      gateway4: 192.168.1.1
      nameservers:
        addresses:
          - 114.114.114.114
      interfaces:
        - eth0
        - eth1
      parameters: # 参数
        mode: balance-alb # bond模式

修改配置文件后,执行如下命令,使之生效

bash
sudo netplan apply
  1. 查看状态
bash
# 查看bonding状态
cat /proc/net/bonding/bond0 
sudo ethtool bond0

查看bond后的网口bond0的配置和状态信息,包括速度、双工模式、连接状态和硬件特性等。

  1. 删除bond

先注释掉/etc/netplan/00-installer-config.yaml文件中添加的内容

bash
sudo ifconfig bond0 down
sudo rmmod bonding

检查bond是否删除成功

bash
ifconfig bond0

Copyright © 2025 The PODsys Project. All rights reserved.