日常工作问题解决:rhel7下使用teamd配置双网卡绑定
1、情景描述
因为业务发展,需要部署一套ORACLE 11g RAC实现高可用,所以公司新分配两台物理机,每台物理机配置4张网卡,2张千兆,2张万兆
现规划如下:
2张千兆网卡,做双网卡绑定使用主备模式,作为心跳
2张万兆网卡,做双网卡绑定使用负载均衡模式,作为业务
使用rhel7下的NetworkManager服务组中的team服务来实现双网卡绑定链路聚合。
2、准备工作
2.1 确认网卡信息
使用ifconfig命令查看确认网卡信息
[root@db1 ~]$ ifconfig
enp2s0f0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
ether 32:6e:d8:f5:d7:32 txqueuelen 1000 (Ethernet)
RX packets 5924926 bytes 5114985550 (4.7 GiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 4857883 bytes 3559876055 (3.3 GiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
device memory 0x96d00000-96dfffff
enp2s0f1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
ether 32:6e:d8:f5:d7:32 txqueuelen 1000 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
device memory 0x96c00000-96cfffff
enp5s0f0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
ether 46:be:3b:ac:2c:2e txqueuelen 1000 (Ethernet)
RX packets 1098 bytes 120567 (117.7 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
enp5s0f1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
ether 46:be:3b:ac:2c:2e txqueuelen 1000 (Ethernet)
RX packets 49209 bytes 17138608 (16.3 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 55533 bytes 20284230 (19.3 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1000 (Local Loopback)
RX packets 606440 bytes 534199950 (509.4 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 606440 bytes 534199950 (509.4 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
发现4张网卡enp2s0f0、enp2s0f01、enp5s0f0、enp5s0f1
使用ethtool确认网卡信息:
[root@db1 ~]$ ethtool enp2s0f0
Settings for enp2s0f0:
Supported ports: [ TP ]
Supported link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Full
Supported pause frame use: Symmetric
Supports auto-negotiation: Yes
Advertised link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Full
Advertised pause frame use: Symmetric
Advertised auto-negotiation: Yes
Speed: 1000Mb/s # 速度为1000mb/s,确认为千兆网卡
Duplex: Full
Port: Twisted Pair
PHYAD: 1
Transceiver: internal
Auto-negotiation: on
MDI-X: off (auto)
Cannot get wake-on-lan settings: Operation not permitted
Current message level: 0x00000007 (7)
drv probe link
Link detected: yes
[root@db1 ~]$ ethtool enp5s0f0
Settings for enp5s0f0:
Supported ports: [ FIBRE ]
Supported link modes: 10000baseT/Full
Supported pause frame use: Symmetric
Supports auto-negotiation: No
Advertised link modes: 10000baseT/Full
Advertised pause frame use: Symmetric
Advertised auto-negotiation: No
Speed: 10000Mb/s # 速度为10000mb/s,确认为万兆网卡
Duplex: Full
Port: FIBRE
PHYAD: 0
Transceiver: internal
Auto-negotiation: off
Cannot get wake-on-lan settings: Operation not permitted
Current message level: 0x00000007 (7)
drv probe link
Link detected: yes
2.2 删除原有网卡配置信息
[root@db1 ~]$ nmcli connection show
名称 UUID 类型 设备
beatteam0 0445cabf-c120-453a-a747-2aca7e8618a0 team beatteam0
beatteam0-port0 851acd5f-8b5b-46be-a507-a70319074085 802-3-ethernet enp2s0f0
beatteam0-port1 775ff22d-cee7-4f3b-add3-dc4ad56f5c6f 802-3-ethernet enp2s0f1
serviceteam0 00f01df1-0185-4e31-bd6d-42e4e18d771f team serviceteam0
serviceteam0-port0 65d46a63-4c94-4482-b2ee-39d39e0cbdb4 802-3-ethernet enp5s0f0
serviceteam0-port0 41a55302-5c94-4a17-a0fc-d6b9c12f4624 802-3-ethernet enp5s0f1
virbr0 1c4011cb-4d0a-4880-9a4a-05284536fbcb bridge virbr0
[root@db1 ~]$ nmcli connection delete 41a55302-5c94-4a17-a0fc-d6b9c12f4624
# nmcli connection delete 设备UUID 删除UUID对应的网卡配置
确认所有将要使用的四张网卡信息已经全部删除以后,准备工作完成
3、配置网卡绑定
3.1 配置千兆网卡双网卡热备用作心跳
[root@db1 ~]$nmcli connection add type team con-name beatteam0 ifname beatteam0 config '{"runner":{"name":"activebackup"}}'
# 创建双网卡聚合team,team名为beatteam0,虚拟网卡名为beatteam0,方式为activebackup--热备
[root@db1 ~]$nmcli connection modify beatteam0 ipv4.addresses 192.168.10.21/24 # 配置IPV4地址和掩码
[root@db1 ~]$nmcli connection modify beatteam0 ipv4.gateway “192.168.10.1” # 配置IPV4网关
[root@db1 ~]$nmcli connection modify beatteam0 ipv4.dns '192.168.10.21 8.8.8.8' # 配置IPV4DNS
[root@db1 ~]$nmcli connection modify beatteam0 ipv4.method manual # 配置IPV4协议
[root@db1 ~]$nmcli connection add type team-slave con-name beatteam0-port0 ifname enp2s0f0 master beatteam0
# 将enp2s0f0加入beatteam0,命名为beatteam0-port0
[root@db1 ~]$nmcli connection add type team-slave con-name beatteam0-port1 ifname enp2s0f1 master beatteam0
# 将enp2s0f1加入beatteam0,命名为beatteam0-port1
[root@db1 ~]$systemctl restart network # 重启网络服务
[root@db1 ~]$ nmcli connection show # 查看网络连接信息,发现已经添加成功
名称 UUID 类型 设备
beatteam0 0445cabf-c120-453a-a747-2aca7e8618a0 team beatteam0
beatteam0-port0 851acd5f-8b5b-46be-a507-a70319074085 802-3-ethernet enp2s0f0
beatteam0-port1 775ff22d-cee7-4f3b-add3-dc4ad56f5c6f 802-3-ethernet enp2s0f1
[root@db1 ~]# teamdctl beatteam0 state # 查看team状态,发现争产
setup:
runner: activebackup # 热备状态
ports:
enp2s0f0
link watches:
link summary: up
instance[link_watch_0]:
name: ethtool
link: up # 启动状态
down count: 0
enp2s0f1
link watches:
link summary: up
instance[link_watch_0]:
name: ethtool
link: up # 启动状态
down count: 0
runner:
active port: enp2s0f0 # enp2s0f0为激活网卡
3.2 配置网兆网卡双网卡负载均衡用作业务
[root@db1 ~]$nmcli connection add type team con-name serviceteam0 ifname serviceteam0 config '{"runner":{"name":"loadbalance"}}'
# 创建双网卡聚合team,team名为serviceteam0,虚拟网卡名为serviceteam0,方式为activebackup--热备
[root@db1 ~]$nmcli connection modify serviceteam0 ipv4.addresses 192.168.20.51/24 # 配置IPV4地址和掩码
[root@db1 ~]$nmcli connection modify serviceteam0 ipv4.gateway “192.168.20.1” # 配置IPV4网关
[root@db1 ~]$nmcli connection modify serviceteam0 ipv4.dns '192.168.20.51 8.8.8.8' # 配置IPV4DNS
[root@db1 ~]$nmcli connection modify serviceteam0 ipv4.method manual # 配置IPV4协议
[root@db1 ~]$nmcli connection add type team-slave con-name serviceteam0-port0 ifname enp5s0f0 master serviceteam0
# 将enp5s0f0加入serviceteam0,命名为serviceteam0-port0
[root@db1 ~]$nmcli connection add type team-slave con-name serviceteam0-port1 ifname enp5s0f1 master serviceteam0
# 将enp5s0f1加入serviceteam0,命名为serviceteam0-port1
[root@db1 ~]$systemctl restart network # 重启网络服务
[root@db1 ~]$ nmcli connection show # 查看网络连接,发现已经添加成功
名称 UUID 类型 设备
beatteam0 0445cabf-c120-453a-a747-2aca7e8618a0 team beatteam0
beatteam0-port0 851acd5f-8b5b-46be-a507-a70319074085 802-3-ethernet enp2s0f0
beatteam0-port1 775ff22d-cee7-4f3b-add3-dc4ad56f5c6f 802-3-ethernet enp2s0f1
serviceteam0 00f01df1-0185-4e31-bd6d-42e4e18d771f team serviceteam0
serviceteam0-port0 65d46a63-4c94-4482-b2ee-39d39e0cbdb4 802-3-ethernet enp5s0f0
serviceteam0-port0 41a55302-5c94-4a17-a0fc-d6b9c12f4624 802-3-ethernet enp5s0f1
virbr0 1c4011cb-4d0a-4880-9a4a-05284536fbcb bridge virbr0
[root@db1 ~]# teamdctl serviceteam0 state # 查看serviceteam0的team状态,
setup:
runner: loadbalance # 运行模式为loadbalance,负载均衡
ports:
enp5s0f0
link watches:
link summary: up
instance[link_watch_0]:
name: ethtool
link: up # 连接启动,状态正常
down count: 0
enp5s0f1
link watches:
link summary: up
instance[link_watch_0]:
name: ethtool
link: up # 连接启动,状态正常
down count: 0
按此办法配置另一台主机,配置完成。
日常工作问题解决:rhel7下使用teamd配置双网卡绑定的更多相关文章
- Debian 16.04 配置双网卡绑定bond
Debian 16.04 配置双网卡绑定bond Debian 16.04 bonding多网卡配置 安装负载均衡软件 fenslave root@ubuntu:~# apt-get install ...
- CentOS7配置双网卡绑定
配置team0配置文件: [root@CentOS7 ~]# cat /etc/sysconfig/network-scripts/ifcfg-team0DEVICE=team0DEVICETYPE= ...
- CentOS 6.X 双网卡绑定配置
相关环境 主机:Dell PowerEdge R720服务器(背板有4个GE网口) 操作系统:CentOS(RHEL)6.X 网线连接 使用6类网线 将Dell R720 GE网口 0,与交换机A相连 ...
- CentOS 7使用nmcli配置双网卡聚合
进入CentOS 7以后,网络方面变化比较大,例如eth0不见了,ifconfig不见了,其原因是网络服务全部都由NetworkManager管理了,下面记录下今天下午用nmcli配置的网卡聚合,网络 ...
- 转:CentOS 7使用nmcli配置双网卡聚合LACP
进入CentOS 7以后,网络方面变化比较大,例如eth0不见了,ifconfig不见了,其原因是网络服务全部都由NetworkManager管理了,下面记录下今天下午用nmcli配置的网卡聚合,网络 ...
- (转)深度分析Linux下双网卡绑定七种模式
现在一般的企业都会 使用双网卡接入,这样既能添加网络带宽,同时又能做相应的冗余,可以说是好处多多.而一般企业都会使用linux操作系统下自带的网卡绑定模式,当然现在 网卡产商也会出一些针对window ...
- Linux下双网卡绑定(bonding技术)
Linux网卡绑定探析 2013-08-20 15:39:31 现在很多服务器都自带双千兆网口,利用网卡绑定既能增加网络带宽,同时又能做相应的冗余,目前应用于很多的场景.linux操作系统下自带的 ...
- 深度分析Linux下双网卡绑定七种模式
现在一般的企业都会使用双网卡接入,这样既能添加网络带宽,同时又能做相应的冗余,可以说是好处多多.而一般企业都会使用linux操作系统下自带的网卡绑定模式,当然现在网卡产商也会出一些针对windows操 ...
- 做双网卡绑定_______物理机在双网卡的情况下做多IP绑定
公司的环境是这样的: 一台物理机需要做双网卡绑定,同时呢,在双网卡绑定的同时还要做多IP. 其实整个过程可以分为两个步骤: 第一个,物理机先做双网卡. 第二个,在bond上做多IP实例. 双网卡绑定的 ...
随机推荐
- learning scala generic classes
package com.aura.scala.day01 object genericClasses { def main(args: Array[String]): Unit = { val sta ...
- 【算法】变邻域搜索算法(Variable Neighborhood Search,VNS)超详细一看就懂的解析
更多精彩尽在微信公众号[程序猿声] 变邻域搜索算法(Variable Neighborhood Search,VNS)一看就懂的解析 00 目录 局部搜索再次科普 变邻域搜索 造轮子写代码 01 局部 ...
- 接口测试命令Httpie的使用
相比于curl命令,Httpie提供更清晰友好的界面,并支持授权,代理等操作 主要特性 直观的语法 格式化和色彩化的终端输出 内置 JSON 支持 支持上传表单和文件 HTTPS.代理和认证 任意请求 ...
- 开启php的PDO扩展,mysql扩展
打开php.ini配置文件,找到extension=php_pdo.dll 和 extension=php_pdo_mysql.dll ,去掉前面“;”的注释,修改后的两行配置内容如下: extens ...
- Tkinter 之ListBox列表标签
一.参数说明 参数 作用 background (bg) 设置背景颜色 borderwidth (bd) 指定 Listbox 的边框宽度,通常是 2 像素 cursor 指定当鼠标在 Listbo ...
- Git 工作流
一.分类 1.集中式工作流 像 SVN 一样,集中式工作流以中央仓库作为项目所有修改的单点实体.所有修改都提交到 Master 这个分支上. 这种方式与 SVN 的主要区别就是开发人员有本地库.Git ...
- Mac下不能成功打开uiautomatorviewer的问题解决
在终端运行uiautomatorviewer之后出现下面的错误,检查以后发现环境变量也配置好了 Error: Could not create the Java Virtual Machine. Er ...
- P5658 括号树
P5658 括号树 题解 太菜了啥都不会写只能水5分数据 啥都不会写只能翻题解 题解大大我错了 我们手动找一下规律 我们设 w[ i ] 为从根节点到结点 i 对答案的贡献,也就是走到结点 i ,合 ...
- ISO/IEC 9899:2011 条款6.2.4——对象的存储持久性
6.2.4 对象的存储持久性 1.一个对象具有一个存储持久性来确定其生命周期.一共有四种存储持久性:静态的,线程的,自动的,以及分配的.分配存储在7.22.3中描述. 2.一个对象的生命周期是程序执行 ...
- Qt编写自定义控件45-柱状标尺控件
一.前言 这个控件写了很久了,是最早期的一批控件中的一个,和温度计控件类似,都是垂直的进度条,可以设置不同的背景颜色,左侧的刻度也可以自由设定,还提供了动画效果,其实就是开启定时器慢慢的进度到设定的目 ...