第 10 章 重命名 Satellite 服务器或 Capsule 服务器
要重命名 Satellite 服务器或 Capsule 服务器,您必须使用 satellite-change-hostname
脚本。
如果重命名 Satellite 服务器,您必须重新注册所有 Satellite 客户端,并将每个 Capsule 服务器配置为指向新的 Satellite 主机名。如果使用自定义 SSL 证书,则必须使用新主机名重新生成它们。如果使用 virt-who,则必须使用新主机名更新 virt-who 配置文件。
如果重命名 Capsule 服务器,您必须重新注册所有 Capsule 客户端,并在 Satellite Web UI 中更新 Capsule 主机名。如果使用自定义 SSL 证书,则必须使用新主机名重新生成它们。
重命名过程会关闭被重命名的主机上的所有 Satellite 服务器服务。重命名完成后,所有服务都会重启。
10.1. 重命名 Satellite 服务器 复制链接链接已复制到粘贴板!
Satellite 服务器的主机名供 Satellite 服务器组件、所有 Capsule 服务器和注册到它的主机用于通信。此流程可确保您更新对新主机名的所有引用。
如果使用外部身份验证,您必须在运行 satellite-change-hostname
脚本后重新配置 Satellite 服务器以进行外部身份验证。satellite-change-hostname
脚本会破坏 Satellite 服务器的外部身份验证。有关配置外部身份验证的详情请参考 第 14 章 配置外部身份验证。
如果使用 virt-who,您必须在运行 satellite-change-hostname
脚本后使用新主机名更新 virt-who 配置文件。如需更多信息,请参阅 在 Red Hat Satellite 中配置虚拟机订阅 中的 修改 virt-who 配置 。
先决条件
-
hostname
和hostname -f
命令都必须返回 Satellite 服务器的 FQDN,或者satellite-change-hostname
脚本将无法完成。如果hostname
命令返回 Satellite 服务器的短名称而不是 FQDN,请使用hostnamectl set-hostname old_fqdn
在尝试使用satellite-change-hostname
脚本前正确设置旧 FQDN。 - 在更改主机名前对 Satellite 服务器执行备份。如果重命名过程不成功,则必须从备份中恢复它。如需更多信息,请参阅 第 8 章 备份 Satellite 服务器和 Capsule 服务器。
- 可选:如果 Satellite 服务器安装了自定义 SSL 证书,则必须为主机的新名称获取新证书。如需更多信息,请参阅从 连接的网络 安装 Satellite 服务器 中的 使用自定义 SSL 证书配置 Satellite 服务器。
流程
在 Satellite 服务器上,选择运行
satellite-change-hostname
脚本的适当方法,提供新的主机名和 Satellite 凭证:如果您的 Satellite 服务器安装了默认自签名 SSL 证书,请输入以下命令:
satellite-change-hostname new-satellite \ --username admin \ --password password
# satellite-change-hostname new-satellite \ --username admin \ --password password
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 如果您的 Satellite 服务器安装了自定义 SSL 证书:
satellite-change-hostname new-satellite \ --username admin \ --password password \ --custom-cert "/root/ownca/test.com/test.com.crt" \ --custom-key "/root/ownca/test.com/test.com.key"
# satellite-change-hostname new-satellite \ --username admin \ --password password \ --custom-cert "/root/ownca/test.com/test.com.crt" \ --custom-key "/root/ownca/test.com/test.com.key"
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
- 可选:如果您已为新的 Satellite 服务器主机名创建了自定义 SSL 证书,请运行 Satellite 安装脚本来安装证书。有关安装自定义 SSL 证书的更多信息,请参阅 从 连接的网络安装 Satellite 服务器 中的 将自定义 SSL 证书部署到 Satellite 服务器。
- 重新注册所有 Satellite 主机。如需更多信息,请参阅 管理主机 中的 注册主机。
在所有 Capsule 服务器上,运行 Satellite 安装脚本以更新对新主机名的引用:
satellite-installer \ --foreman-proxy-foreman-base-url https://new-satellite.example.com \ --foreman-proxy-trusted-hosts new-satellite.example.com \ --puppet-server-foreman-url https://new-satellite.example.com
# satellite-installer \ --foreman-proxy-foreman-base-url https://new-satellite.example.com \ --foreman-proxy-trusted-hosts new-satellite.example.com \ --puppet-server-foreman-url https://new-satellite.example.com
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 在 Satellite 服务器上,列出所有 Capsule 服务器:
hammer capsule list
# hammer capsule list
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 在 Satellite 服务器上,同步每个 Capsule 服务器的内容:
hammer capsule content synchronize \ --id capsule_id_number
# hammer capsule content synchronize \ --id capsule_id_number
Copy to Clipboard Copied! Toggle word wrap Toggle overflow