第 2 章 安装胶囊服务器
在安装 Capsule Server 前,您必须确保您的环境满足安装要求。如需更多信息,请参阅为安装准备环境。
2.1. 注册到卫星服务器 复制链接链接已复制到粘贴板!
使用这个步骤将要安装到卫星服务器的基本操作系统注册。
Red Hat Subscription Manifestrequisites
- 在卫星服务器上,必须安装清单,并且必须包含您希望胶囊所属组织的适当存储库。
- 清单必须包含您要在其中安装胶囊的基本操作系统的存储库,以及您要连接到胶囊的任何客户端。
- 存储库必须同步。
如需有关清单和存储库的更多信息,请参阅管理内容 中的 管理红帽订阅 。
代理和网络先决条件
- 卫星服务器基础操作系统必须能够解析胶囊基础操作系统的主机名,反之亦然。
- 确保在胶囊服务器和卫星服务器之间可以使用客户端证书身份验证的 HTTPS 连接。不支持代理服务器和卫星服务器之间的 HTTP 代理。
- 您必须相应地配置主机和基于网络的防火墙。如需更多信息,请参阅 端口和防火墙要求。您可以使用主机注册功能、卫星 API 或 Hammer CLI 使用卫星注册主机。
流程
- 在 Satellite Web UI 中,导航到 Hosts > Register Host。
- 点击 Generate create registration 命令。
- 点击 文件 图标将命令复制到您的剪贴板中。
- 登录您要注册的主机并运行之前生成的命令。
-
检查
/etc/yum.repos.d/redhat.repo
文件,并确保启用了适当的软件仓库。
CLI 过程
使用 Hammer CLI 生成主机注册命令:
hammer host-registration generate-command \ --activation-keys "My_Activation_Key"
# hammer host-registration generate-command \ --activation-keys "My_Activation_Key"
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 如果您的主机不信任 Satellite 服务器的 SSL 证书,您可以通过在注册命令中添加
--insecure
标志来禁用 SSL 验证。hammer host-registration generate-command \ --activation-keys "My_Activation_Key" \ --insecure true
# hammer host-registration generate-command \ --activation-keys "My_Activation_Key" \ --insecure true
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 登录您要注册的主机并运行之前生成的命令。
-
检查
/etc/yum.repos.d/redhat.repo
文件,并确保启用了适当的软件仓库。
API 流程
使用 Satellite API 生成主机注册命令:
curl -X POST https://satellite.example.com/api/registration_commands \ --user "My_User_Name" \ -H 'Content-Type: application/json' \ -d '{ "registration_command": { "activation_keys": ["My_Activation_Key_1, My_Activation_Key_2"] }}'
# curl -X POST https://satellite.example.com/api/registration_commands \ --user "My_User_Name" \ -H 'Content-Type: application/json' \ -d '{ "registration_command": { "activation_keys": ["My_Activation_Key_1, My_Activation_Key_2"] }}'
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 如果您的主机不信任 Satellite 服务器的 SSL 证书,您可以通过在注册命令中添加
--insecure
标志来禁用 SSL 验证。curl -X POST https://satellite.example.com/api/registration_commands \ --user "My_User_Name" \ -H 'Content-Type: application/json' \ -d '{ "registration_command": { "activation_keys": ["My_Activation_Key_1, My_Activation_Key_2"], "insecure": true }}'
# curl -X POST https://satellite.example.com/api/registration_commands \ --user "My_User_Name" \ -H 'Content-Type: application/json' \ -d '{ "registration_command": { "activation_keys": ["My_Activation_Key_1, My_Activation_Key_2"], "insecure": true }}'
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 使用激活码来简化指定环境。如需更多信息,请参阅管理内容 中的 激活码 。
要以命令行参数输入密码,请使用
username:password
语法。请记住,这可以在 shell 历史记录中保存密码。有关注册的更多信息,请参阅在 管理主机 中将主机注册到 Red Hat Satellite。
- 登录您要注册的主机并运行之前生成的命令。
-
检查
/etc/yum.repos.d/redhat.repo
文件,并确保启用了适当的软件仓库。