• team


    链路聚合(聚合链路 网卡绑定)
                  多张网卡绑定在一起(至少两张),虚拟出一个网卡team0与外部通讯。
                  作用:提高网卡设备的可靠性,提供冗余,解决网卡的单点故障。

                 构建思路:
                              eth1,eth2,team0组成一个队,只在team0上配置IP,eth1,eth2上
                              不配置地址。eth1和eth2是team0的slave成员,team0每5秒检测一次
                              自己的slave是否存在,如果其中一个slave故障,team0会把数据包转给
                              另外一个slave成员,同时tema0会每2秒向故障的slave发送hello包,
                              检测故障网卡是否已恢复。故障网卡恢复时不会进行抢占,只有其它的
                              slave故障时它才会再次接收转发数据任务。

    创建虚拟网卡的格式:
                           # nmcli connection 添加 类型 team 配置文件名 team0 网卡名 team0
                              每次开机自动启用 链路聚合管理方式为 热备份方式

    添加slave成员的格式:
                          # nmcli connection 添加 类型 team-成员 配置文件名 team0-1 网卡名
                             eth1 主设备为 team0

    1.建立虚拟网卡team0

    [root@server0 ~]# nmcli connection add type team con-name team0 ifname team0 autoconnect yes config '{"runner": {"name": "activebackup"}}'
                                          #要创建聚合链路这里的type用team,常用的类型还有ethernet和bridge
                                          #con-name team0 虚拟网卡配置文件名字是team0
                                          #ifname team0 创建的虚拟网卡名称是team0
                                          #autoconnect yes 开机自动启动
                                          #config '{"runner": {"name": "activebackup"}}' 定义team工作模式为activebackup 
                                          #工作模式的内容较长不容易记忆,可以查看man帮助 man teamd.conf 全文搜索/example

    [root@server0 ~]# ifconfig             #查看生成的虚拟网卡team0
                                           #生成配置文件位置:/etc/sysconfig/network-scripts/
                                           #目录下文件名称为ifcfg-tema0

    2.添加slave成员team0-1和team0-2

    [root@server0 ~]# nmcli connection add type team-slave con-name  team0-1 ifname eth1 autoconnect yes master team0 
                                         #要添加的是slave成员所以type的类型是team-slave
                                         #ifname eth1需把网卡名称为eth1的设备添加成slave
                                         #con-name  team0-1记录eth1身份的配置文件名team0-1 
                                         #autoconnect yes 开机自启动
                                         #master team0,eth1设备的master是team0
    
    [root@server0 ~]# nmcli connection add type team-slave con-name team0-2 ifname eth2 autoconnect yes master team0 
    #生成配置文件位置:/etc/sysconfig/network-scripts/

    3.为tema0配置IP地址

    [root@server0 ~]# nmcli connection modify team0 ipv4.method manual ipv4.addresses 192.168.1.1/24 connection.autoconnect yes

    4 激活地址

    [root@server0 ~]# nmcli connection up  team0 
    [root@server0 ~]# nmcli connection up  team0-1 
    [root@server0 ~]# nmcli connection up  team0-2


    如果无法激活,删除所有配置重新来过

    [root@server0 ~]# nmcli connection delete team0
    [root@server0 ~]# nmcli connection delete team0-1
    [root@server0 ~]# nmcli connection delete team0-2

     

    5 查看tema0的状态

    [root@server0 ~]# teamdctl team0  state
    setup:
      runner: activebackup                #工作模式是activebackup
    ports:
      eth1
        link watches:
          link summary: up
          instance[link_watch_0]:
            name: ethtool
            link: up                      #eth1当前为up状态
      eth2
        link watches:
          link summary: up
          instance[link_watch_0]:
            name: ethtool
            link: up                      #eth2当前为up状态
    runner:
      active port: eth2                   #当前活跃设备为eth2
    
    [root@server0 ~]# ifconfig eth2 down  #禁用eth2网卡,查看自动切换的状态
    [root@server0 ~]# teamdctl team0 state
  • 相关阅读:
    登入界面的创建
    什么是IO流 以及文件输入输出
    java 的面向对象
    Mac 终端命令大全
    jQuery 的属性
    商城管理系统
    Java IO学习第二天部分详解
    Java IO学习第一天部分详解
    用JAVA描述一个车与修车厂两个事物
    JAVA基础(数组)数组排序和查找数组中是否还有某一个数
  • 原文地址:https://www.cnblogs.com/sven-pro/p/13227249.html
Copyright © 2020-2023  润新知