Red Hat Training

A Red Hat training course is available for Red Hat Satellite

第 2 章 配置 Red Hat Satellite 服务

在这个示例配置中,Satellite 负责在 172.17.13.0/24 子网中部署主机。本小节论述了如何配置 DNS、DHCP 和 TFTP,以便为要在该子网中部署的客户端提供服务。

2.1. 配置 DNS、DHCP 和 TFTP

本小节论述了如何将 Satellite 配置为运行 BIND(named),以便为 example.org 域和 172.17.13.x 子网提供权威 DNS 服务。这需要在 example.org 区域文件中设定用于正向查找的 DNS 区域。另外,还需要为 172.17.13.x 子网创建用于反向查找的 DNS 区域,该信息将包含在 13.17.172.in-addr.arpa 反向区域文件中。这样可保证使用 Satellite 部署的主机使用正确的名称解析参数。本小节还论述了如何配置 TFTP 代理服务器,以便使用 PXE 引导该主机。
这个网络中的客户端将有如下特征:
  • DHCP 可访问的 IP 地址范围是 172.17.13.100 到 172.17.13.150 。
  • 在 DNS 中使用 Satellite(172.17.13.2 中的 satellite.example.org)。
  • 从 Satellite(172.17.13.2 中的 satellite.example.org)接收 pxelinux.0 文件,以便启用 PXE 引导。
  • 主机名 hostname.example.org,部署主机时会配置 hostname

重要

这个示例在 Satellite 服务器中启用了 DHCP 服务。执行前请咨询网络管理员。

2.1.1. Satellite 配置选项

下表论述了正确配置 Satellite 服务所需的各种选项及选项值。katello-installer 命令使用 Puppet;并因此安装附加软件包(bind、dhcp、xinetd 等等),然后将其配置为添加请求的功能。
有关可用选项的完整列表,请运行 katello-installer --help

表 2.1. Satellite 配置选项

选项
描述
选项值
--foreman-admin-username 初始管理员的用户名。 (用户指定)
--foreman-admin-password 初始管理员的密码。 (用户指定)
--capsule-dns 启用 DNS 代理服务器功能。 yes
--capsule-dns-interface named 应侦听的接口。 eth0
--capsule-dns-zone Satellite 托管的正向 DNS 区域。 example.org
--capsule-dns-forwarders 向其转发未知查询的 DNS 服务器。 172.17.13.1
--capsule-dns-reverse Satellite 托管的反向 DNS 区域,通常是 IP 地址前三位八进制数(172.17.13)的反向排列,并附加 ".in-addr.arpa"。 13.17.172.in-addr.arpa
--capsule-dhcp 启用 DHCP 代理服务器功能。 yes
--capsule-dhcp-interface DHCP 要侦听的接口。 eth0
--capsule-dhcp-range 为客户端提供的 IP 地址范围。 172.17.13.100 172.172.13.150
--capsule-dhcp-gateway 为客户端提供的默认网关 IP 。 172.17.13.1
--capsule-dhcp-nameservers 客户端用来解析名称的主机。在这个部署模式中应使用 Satellite 的 IP 进行配置。 172.17.13.2
--capsule-tftp 启用 TFTP 代理服务器功能。使用 PXE 引导客户端时需要这个功能。 yes
--capsule-tftp-servername 设定 TFTP 主机名。将其设定为与服务器主机名映射(satellite.example.org)。 $(hostname)
--capsule-puppet 启用 Puppet Master。 yes
--capsule-puppetca 启用 Puppet CA。 yes

2.1.2. 配置 Satellite 服务

作为 root 运行下列 katello-installer 命令,使用指定选项在 Satellite 服务器中配置所需服务。请记住使用所需管理员用户名和密码替换相应内容。

重要

  • 如果已按照《安装指南》说明安装 Satellite,请勿在下面的命令中包含 --foreman-admin-username--foreman-admin-password 选项。
  • 如果没有指定管理员用户名和密码,则会创建默认用户 admin,并自动生成密码。安装进程结尾会显示该证书。请记录这个密码。也可以在 /etc/katello-installer/answers.katello-installer.yaml 文件的 admin_password 密码部分检索该密码。
katello-installer \n--foreman-admin-username admin-username \n--foreman-admin-password admin-password \n--capsule-dns true \n--capsule-dns-interface eth0 \n--capsule-dns-zone example.org \n--capsule-dns-forwarders 172.17.13.1 \n--capsule-dns-reverse 13.17.172.in-addr.arpa \n--capsule-dhcp true \n--capsule-dhcp-interface eth0 \n--capsule-dhcp-range "172.17.13.100 172.17.13.150" \n--capsule-dhcp-gateway 172.17.13.1 \n--capsule-dhcp-nameservers 172.17.13.2 \n--capsule-tftp true \n--capsule-tftp-servername $(hostname) \n--capsule-puppet true \n--capsule-puppetca true
在安装过程最后阶段,katello-installer 会显示安装状态。
 成功!
  * Katello 正在 https://satellite.example.org 中运行
      默认证书为 'admin:*******'
  * Capsule 正运行于 https://satellite.example.org:9090
  * 要在另一台独立机器中继续安装附加 capsule,请运行:"

      capsule-certs-generate --capsule-fqdn "$CAPSULE" --certs-tar "~/$CAPSULE-certs.tar"

  完整日志请参考 /var/log/katello-installer/katello-installer.log
使用网页浏览器浏览 https://satellite.example.org,显示 Satellite 主页。这个示例使用默认机构(Default_Organization)和默认位置。