Show Table of Contents
5.11. 使用 teamnl 控制 teamd
请使用控制工具 teamdctl 查询运行的
teamd 实例,以获取统计或配置信息。
请作为
root 使用以下命令查看成组 team0 的当前状态:
~]# teamdctl team0 state view
要了解更详细的信息,请运行:
~]# teamdctl team0 state view -v
运行以下命令获取 team0 的完整 JSON 格式状态转储(对机器处理有帮助):
~]# teamdctl team0 state dump
运行以下命令获取 team0 的 JSON 格式配置转储:
~]# teamdctl team0 config dump
运行以下命令查看作为成组 team0 一部分的端口 em1 配置:
~]# teamdctl team0 port config dump em1
5.11.1. 在网络成组中添加端口
请作为
root 运行以下命令在网络成组 team0 中添加端口 em1:
~]# teamdctl team0 port add em1
5.11.2. 从网络成组中删除端口
请作为
root 运行以下命令,从网络成组 team0 中删除接口 em1:
~]# teamdctl team0 port remove em1
5.11.3. 在网络成组中为端口应用配置
要在网络成组 team0 为端口 em1 应用 JSON 格式配置,请作为
root 运行以下格式的命令:
~]# teamdctl team0 port config update em1 JSON-config-string
其中 JSON-config-string 是 JSON 格式文本中的字符串文本配置。这样就可使用提供的 JSON 格式字符串更新端口配置。用来配置端口的有效 JSON 字符串示例类似如下:
{
"prio": -10,
"sticky": true
}
使用单引号括起 JSON 配置字符串,并忽略换行符号。
注:会覆盖旧的配置,同时会将省略的选项重置为默认值。有关成组守护进程控制工具命令示例,请查看
teamdctl(8) man page。
5.11.4. 查看网络成组中端口的配置
要复制网络成组 team0 中端口 em1 的配置,请作为
root 运行以下命令:
~]# teamdctl team0 port config dump em1
这会将该端口的 JSON 格式配置转储为标准输出。

Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.