使用负载均衡器配置 Capsules


Red Hat Satellite 6.17

在 Capsules 之间分发负载

Red Hat Satellite Documentation Team

摘要

本指南论述了如何将 Red Hat Satellite 配置为使用负载均衡器在胶囊服务器之间分发负载。

对红帽文档提供反馈

我们感谢您对我们文档的反馈。让我们了解如何改进它。

使用 Red Hat Jira 中的 Create Issue 表单提供您的反馈。JIRA 问题是在 Red Hat Satellite Jira 项目中创建的,您可以在其中跟踪其进度。

先决条件

流程

  1. 单击以下链接: 创建问题。如果 Jira 显示登录错误,则登录并在您重定向到表单后继续。
  2. 完成 SummaryDescription 字段。在 Description 字段中,包含文档 URL、章节号以及问题的详细描述。不要修改表单中的任何其他字段。
  3. Create

第 1 章 Satellite 中的负载平衡概述

您可以将 Satellite 环境配置为使用负载均衡器在多个胶囊服务器之间分发主机请求和网络负载。这会提高 Capsule 服务器上的性能,并提高了与 Satellite 的连接的性能和稳定性。在负载平衡的设置中,当一个胶囊服务器停机或计划外维护时,支持负载平衡的胶囊功能将继续按预期工作。

1.1. 负载均衡设置的组件

Satellite 环境中的负载均衡设置由以下组件组成:

  • Satellite 服务器
  • 两个或多个胶囊服务器
  • 负载均衡器
  • 多个主机

主机发送请求到 TCP 负载均衡器。负载均衡器接收请求,并确定哪个胶囊服务器将处理请求,以确保最佳性能和可用性。

图 1.1. 负载均衡设置的组件

1.2. 负载均衡设置支持的服务和功能

Satellite 中的负载均衡器只适用于以下服务和功能:

  • 注册主机
  • 为主机提供内容
  • 使用 Puppet 配置主机

其他 Satellite 服务,如 provisioning、virt-who 或远程执行,直接通过运行这些服务的独立胶囊。

1.3. 负载均衡所需的额外维护

将胶囊配置为使用负载均衡器会导致环境更为复杂,需要额外的维护。

负载均衡需要以下额外步骤:

  • 您必须确保所有 Capsules 具有相同的内容。如果您在 Satellite 上发布内容视图版本,请将它同步到所有胶囊服务器。
  • 您必须按顺序升级每个 Capsule。

第 2 章 为负载均衡准备 Capsule 服务器

Satellite 不支持为负载平衡配置现有的胶囊服务器。您必须为此目的创建新的胶囊服务器。

2.1. 注册到 Satellite 服务器

使用这个流程将要在其上安装胶囊式服务器的基本操作系统注册到 Satellite 服务器。

Red Hat 订阅清单先决条件

  • 在服务器上,必须安装清单,并且必须包含您要胶囊所属的组织的适当存储库。
  • 清单必须包含您要在其上安装 Capsule 的基本操作系统的软件仓库,以及您要连接到 Capsule 的所有客户端。
  • 仓库需要已被同步。

如需有关清单和存储库的更多信息, 请参阅管理内容中的红帽订阅

代理和网络的先决条件

  • 卫星服务器基础操作系统必须能够解析胶囊基础操作系统的主机名,反之亦然。
  • 确保 Capsule 服务器和 Satellite 服务器之间可以使用客户端证书身份验证的 HTTPS 连接。不支持胶囊服务器和 Satellite 服务器之间的 HTTP 代理。
  • 您必须相应地配置主机和基于网络的防火墙。如需更多信息,请参阅安装 Capsule 服务器中的端口和防火墙要求。您可以使用 Satellite Web UI、Hammer CLI 或 Satellite API 中的主机注册功能将主机注册到 Satellite。如需更多信息,请参阅 管理主机 中的 注册主机和设置主机集成

先决条件

流程

  1. 在 Satellite Web UI 中,进入到 Hosts > Register Host
  2. Capsule 下拉列表中,选择配置了负载平衡的 Capsule 服务器。
  3. 选择 Force 注册之前注册到胶囊服务器的主机。
  4. Activation Keys 列表中,选择要分配给主机的激活码。
  5. Generate 来创建注册命令。
  6. files 图标将命令复制到您的剪贴板。
  7. 使用 SSH 连接到您的主机并运行注册命令。
  8. 检查 /etc/yum.repos.d/redhat.repo 文件,并确保启用了适当的软件仓库。

CLI 过程

  1. 生成使用 Hammer CLI 的主机注册命令:

    $ hammer host-registration generate-command \
    --activation-keys "My_Activation_Key"
    Copy to Clipboard Toggle word wrap

    如果您的主机不信任 Satellite 服务器的 SSL 证书,您可以通过在注册命令中添加- insecure 标志来禁用 SSL 验证。

    $ hammer host-registration generate-command \
    --activation-keys "My_Activation_Key" \
    --insecure true
    Copy to Clipboard Toggle word wrap

    包含 --smart-proxy-id My_Capsule_ID 选项。您可以使用您为主机注册负载均衡配置的任何胶囊服务器的 ID。Satellite 会自动将负载均衡器应用到注册命令。

    包含 -强制 选项,以注册之前注册到胶囊服务器的主机。

  2. 使用 SSH 连接到您的主机并运行注册命令。
  3. 检查 /etc/yum.repos.d/redhat.repo 文件,并确保启用了适当的软件仓库。

API 流程

  1. 生成使用 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"] }}'
    Copy to Clipboard Toggle word wrap

    如果您的主机不信任 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 }}'
    Copy to Clipboard Toggle word wrap

    使用激活码来简化指定环境的过程。如需更多信息,请参阅管理内容中的管理激活码

    Include { "smart_proxy_id": My_Capsule_ID }.您可以使用您为主机注册负载均衡配置的任何胶囊服务器的 ID。Satellite 会自动将负载均衡器应用到注册命令。

    包含 { "force": true } 以注册之前注册到胶囊服务器的主机。

    如果需要输入密码作为命令行参数,请使用 username:password 语法。请注意,这会将密码保存到 shell 的历史记录中。或者,您可以使用临时个人访问令牌而不是密码。要在 Satellite Web UI 中生成令牌,请进入到 My Account > Personal Access Tokens

  2. 使用 SSH 连接到您的主机并运行注册命令。
  3. 检查 /etc/yum.repos.d/redhat.repo 文件,并确保启用了适当的软件仓库。

2.2. 配置软件仓库

前提条件

流程

  1. 禁用所有软件仓库:

    # subscription-manager repos --disable "*"
    Copy to Clipboard Toggle word wrap
  2. 启用以下软件仓库:

    # subscription-manager repos \
    --enable=rhel-9-for-x86_64-baseos-rpms \
    --enable=rhel-9-for-x86_64-appstream-rpms \
    --enable=satellite-capsule-6.17-for-rhel-9-x86_64-rpms \
    --enable=satellite-maintenance-6.17-for-rhel-9-x86_64-rpms
    Copy to Clipboard Toggle word wrap

验证

  • 验证是否启用了所需的软件仓库:

    # dnf repolist enabled
    Copy to Clipboard Toggle word wrap

2.3. 安装 Capsule Server 软件包

在安装胶囊式服务器软件包前,您必须更新安装在基本操作系统上的所有软件包。

流程

要安装 Capsule 服务器,请完成以下步骤:

  1. 更新所有软件包:

    # dnf upgrade
    Copy to Clipboard Toggle word wrap
  2. 安装 Capsule Server 软件包:

    # dnf install satellite-capsule
    Copy to Clipboard Toggle word wrap

2.4. 其他资源

您可以配置一个或多个使用默认 SSL 证书进行负载平衡的胶囊服务器。

如果您在 Satellite 部署中使用 Puppet,则配置步骤会有所不同。请参阅 第 5 章 使用默认 SSL 证书配置胶囊服务器以进行负载平衡(使用 Puppet)

3.1. 先决条件

在您要为负载均衡配置的每个 Capsule 服务器上,安装 Katello 证书。

流程

  1. 在 Satellite 服务器上,为 Capsule 服务器生成 Katello 证书:

    # capsule-certs-generate \
    --certs-tar "/root/capsule.example.com-certs.tar" \
    --foreman-proxy-cname loadbalancer.example.com \
    --foreman-proxy-fqdn capsule.example.com
    Copy to Clipboard Toggle word wrap

    保留由 capsule-certs-generate 命令输出的示例 satellite-installer 命令的副本,用于安装 Capsule 服务器证书。

  2. 将证书存档文件从 Satellite 服务器复制到胶囊服务器。

    # scp /root/capsule.example.com-certs.tar root@capsule.example.com:/root/capsule.example.com-certs.tar
    Copy to Clipboard Toggle word wrap
  3. 将以下选项附加到您从 capsule-certs-generate 命令的输出中获取的 satellite-installer 命令中:

    --certs-cname "loadbalancer.example.com" \
    --enable-foreman-proxy-plugin-remote-execution-script
    Copy to Clipboard Toggle word wrap
  4. 在 Capsule 服务器上,输入 satellite-installer 命令:

    # satellite-installer --scenario capsule \
    --certs-cname "loadbalancer.example.com" \
    --certs-tar-file "capsule.example.com-certs.tar" \
    --enable-foreman-proxy-plugin-remote-execution-script \
    --foreman-proxy-foreman-base-url "https://satellite.example.com" \
    --foreman-proxy-oauth-consumer-key "oauth key" \
    --foreman-proxy-oauth-consumer-secret "oauth secret" \
    --foreman-proxy-register-in-foreman "true" \
    --foreman-proxy-trusted-hosts "satellite.example.com" \
    --foreman-proxy-trusted-hosts "capsule.example.com"
    Copy to Clipboard Toggle word wrap

您可以配置一个或多个使用自定义 SSL 证书进行负载平衡的胶囊服务器。为此,请在您要用于负载平衡的每个胶囊服务器上配置并安装证书。

如果您在 Satellite 部署中使用 Puppet,则配置步骤会有所不同。请参阅 第 6 章 使用自定义 SSL 证书配置胶囊服务器以进行负载平衡(使用 Puppet)

4.1. 先决条件

4.2. 为胶囊服务器创建自定义 SSL 证书

在您要为负载均衡配置的每个胶囊服务器上,为证书签名请求创建一个配置文件,并将负载均衡器和胶囊服务器作为主题备用名称(SAN)包含。

流程

  1. 要存储所有源证书文件,请创建一个只能被 root 用户访问的目录:

    # mkdir /root/capsule_cert
    Copy to Clipboard Toggle word wrap
  2. 创建用于签署证书签名请求(CSR)的私钥。

    请注意,私钥必须是未加密的。如果您使用密码保护的私钥,请删除私钥密码。

    如果您已有此胶囊服务器的私钥,请跳过这一步。

    # openssl genrsa -out /root/capsule_cert/capsule_cert_key.pem 4096
    Copy to Clipboard Toggle word wrap
  3. 为 CSR 创建 /root/capsule_cert/openssl.cnf 配置文件并包含以下内容:

    [ req ]
    req_extensions = v3_req
    distinguished_name = req_distinguished_name
    x509_extensions = usr_cert
    prompt = no
    
    [ req_distinguished_name ]
    commonName = capsule.example.com 
    1
    
    
    [ v3_req ]
    basicConstraints = CA:FALSE
    keyUsage = digitalSignature, keyEncipherment
    extendedKeyUsage = serverAuth, clientAuth
    subjectAltName = @alt_names
    
    [alt_names] 
    2
    
    DNS.1 = loadbalancer.example.com
    DNS.2 = capsule.example.com
    Copy to Clipboard Toggle word wrap
    1
    证书的通用名称必须与 Capsule 服务器的 FQDN 匹配。确保在为负载平衡配置的每个胶囊服务器上运行 命令时更改此设置。您还可以设置通配符值 *。如果设置通配符值,您必须在使用 katello-certs-check 命令时添加 -t capsule 选项。
    2
    [alt_names] 下,将负载均衡器的 FQDN 包含在 DNS.1 下,以及 Capsule Server 的 FQDN 作为 DNS.2

    有关 [ v3_req ] 参数及其目的的更多信息,请参阅 RFC 5280: Internet X.509 公钥基础架构证书和证书撤销列表(CRL)配置文件

  4. 可选:如果要在 CSR 中添加可辨识名称(DN)详情,请在 [ req_distinguished_name ] 部分中添加以下信息:

    [req_distinguished_name]
    CN = capsule.example.com
    countryName = My_Country_Name 
    1
    
    stateOrProvinceName = My_State_Or_Province_Name 
    2
    
    localityName = My_Locality_Name 
    3
    
    organizationName = My_Organization_Or_Company_Name
    organizationalUnitName = My_Organizational_Unit_Name 
    4
    Copy to Clipboard Toggle word wrap
    1
    两个字母代码
    2
    全名
    3
    全名(例如:New York)
    4
    负责证书的部门(示例:IT 部门)
  5. 生成 CSR:

    # openssl req -new \
    -key /root/capsule_cert/capsule_cert_key.pem \ 
    1
    
    -config /root/capsule_cert/openssl.cnf \ 
    2
    
    -out /root/capsule_cert/capsule_cert_csr.pem 
    3
    Copy to Clipboard Toggle word wrap
    1
    私钥的路径
    2
    配置文件的路径
    3
    要生成的 CSR 的路径
  6. 将证书签名请求发送到证书颁发机构(CA)。同一 CA 必须为 Satellite 服务器和胶囊服务器签名证书。

    提交请求时,指定证书的期限。发送证书请求的方法会有所不同,因此请查阅 CA 了解首选方法。根据请求,您可以预期在单独的文件中接收 CA 捆绑包和签名证书。

  7. 将您从证书颁发机构和胶囊服务器私钥接收的证书颁发机构捆绑包和胶囊服务器证书文件复制到 Satellite 服务器。
  8. 在 Satellite 服务器上,验证 Capsule 服务器证书输入文件:

    # katello-certs-check \
    -c /root/capsule_cert/capsule_cert.pem \ 
    1
    
    -k /root/capsule_cert/capsule_cert_key.pem \ 
    2
    
    -b /root/capsule_cert/ca_cert_bundle.pem 
    3
    Copy to Clipboard Toggle word wrap
    1
    胶囊服务器证书文件,由您的证书颁发机构提供
    2
    用于为证书签名的 Capsule 服务器私钥
    3
    证书颁发机构捆绑包,由您的证书颁发机构提供

    如果将 commonName= 设置为通配符值 *,您必须在 katello-certs -check 命令中添加 the-t Capsule 选项。

    保留 example capsule-certs-generate 命令的副本,它由 katello-certs-check 命令为这个 Capsule 服务器创建证书归档文件来输出。

在您要为负载均衡配置的每个胶囊服务器上,安装 Katello 证书。

流程

  1. 将以下选项附加到您从 katello-certs-check 命令的输出中获取的 capsule-certs-generate 命令中:

    --foreman-proxy-cname loadbalancer.example.com
    Copy to Clipboard Toggle word wrap
  2. 在 Satellite 服务器上,输入 Capsule -certs-generate 命令来生成 Capsule 证书:

    # capsule-certs-generate \
    --certs-tar /root/capsule_cert/capsule.tar \
    --foreman-proxy-cname loadbalancer.example.com \
    --foreman-proxy-fqdn capsule.example.com \
    --server-ca-cert /root/capsule_cert/ca_cert_bundle.pem \
    --server-cert /root/capsule_cert/capsule.pem \
    --server-key /root/capsule_cert/capsule.pem
    Copy to Clipboard Toggle word wrap

    从用于安装 Capsule 服务器证书的输出中保留示例 satellite-installer 命令的副本。

  3. 将证书存档文件从 Satellite 服务器复制到 Capsule 服务器:

    # scp /root/capsule.example.com-certs.tar root@capsule.example.com:capsule.example.com-certs.tar
    Copy to Clipboard Toggle word wrap
  4. 将以下选项附加到您从 capsule-certs-generate 命令的输出中获取的 satellite-installer 命令中:

    --certs-cname "loadbalancer.example.com" \
    --enable-foreman-proxy-plugin-remote-execution-script
    Copy to Clipboard Toggle word wrap
  5. 在 Capsule 服务器上,输入 satellite-installer 命令:

    # satellite-installer --scenario capsule \
    --certs-cname "loadbalancer.example.com" \
    --certs-tar-file "capsule.example.com-certs.tar" \
    --enable-foreman-proxy-plugin-remote-execution-script \
    --foreman-proxy-foreman-base-url "https://satellite.example.com" \
    --foreman-proxy-oauth-consumer-key "oauth key" \
    --foreman-proxy-oauth-consumer-secret "oauth secret" \
    --foreman-proxy-register-in-foreman "true" \
    --foreman-proxy-trusted-hosts "satellite.example.com" \
    --foreman-proxy-trusted-hosts "capsule.example.com"
    Copy to Clipboard Toggle word wrap

如果在 Satellite 设置中使用 Puppet,您可以配置一个或多个使用默认 SSL 证书进行负载平衡的胶囊服务器。

为此,您可以在其中一个胶囊服务器上配置 Puppet 证书签名请求。然后,您要配置每个剩余的 Puppet 胶囊,以用于负载平衡,以使用证书。第一个胶囊服务器将为配置的其余胶囊生成并签署 Puppet 证书,以进行负载平衡。

5.1. 先决条件

在用于为所有其他负载平衡胶囊服务器生成 Puppet 证书的胶囊服务器上,配置 Puppet 证书生成和签名。

流程

  1. 在 Satellite 服务器上,为配置 Capsule 服务器的系统生成 Katello 证书,以生成和签署 Puppet 证书:

    # capsule-certs-generate \
    --certs-tar "/root/capsule-ca.example.com-certs.tar" \
    --foreman-proxy-cname loadbalancer.example.com \
    --foreman-proxy-fqdn capsule-ca.example.com
    Copy to Clipboard Toggle word wrap

    保留由 capsule-certs-generate 命令输出的示例 satellite-installer 命令的副本,用于安装 Capsule 服务器证书。

  2. 将证书存档文件从 Satellite 服务器复制到 Capsule 服务器:

    # scp /root/capsule-ca.example.com-certs.tar root@capsule-ca.example.com:capsule-ca.example.com-certs.tar
    Copy to Clipboard Toggle word wrap
  3. 将以下选项附加到您从 capsule-certs-generate 命令的输出中获取的 satellite-installer 命令中:

    --certs-cname "loadbalancer.example.com" \
    --enable-foreman-proxy-plugin-remote-execution-script \
    --foreman-proxy-puppetca "true" \
    --puppet-ca-server "capsule-ca.example.com" \
    --puppet-dns-alt-names "loadbalancer.example.com" \
    --puppet-server-ca "true"
    Copy to Clipboard Toggle word wrap
  4. 在 Capsule 服务器上,输入 satellite-installer 命令:

    # satellite-installer --scenario capsule \
    --certs-cname "loadbalancer.example.com" \
    --certs-tar-file "capsule-ca.example.com-certs.tar" \
    --enable-foreman-proxy-plugin-remote-execution-script \
    --enable-puppet \
    --foreman-proxy-foreman-base-url "https://satellite.example.com" \
    --foreman-proxy-oauth-consumer-key "oauth key" \
    --foreman-proxy-oauth-consumer-secret "oauth secret" \
    --foreman-proxy-puppetca "true" \
    --foreman-proxy-register-in-foreman "true" \
    --foreman-proxy-trusted-hosts "satellite.example.com" \
    --foreman-proxy-trusted-hosts "capsule-ca.example.com" \
    --puppet-ca-server "capsule-ca.example.com" \
    --puppet-dns-alt-names "loadbalancer.example.com" \
    --puppet-server true \
    --puppet-server-ca "true"
    Copy to Clipboard Toggle word wrap
  5. 在作为 Puppetserver 证书颁发机构的 Capsule 服务器上,停止 Puppet 服务器:

    # systemctl stop puppetserver
    Copy to Clipboard Toggle word wrap
  6. 为您配置的所有其他胶囊服务器生成 Puppet 证书,除了第一个配置 Puppet 证书签名请求的系统外:

    # puppetserver ca generate \
    --ca-client \
    --certname capsule.example.com \
    --subject-alt-names loadbalancer.example.com
    Copy to Clipboard Toggle word wrap

    这个命令会创建以下文件:

    • /etc/puppetlabs/puppet/ssl/certs/capsule.example.com.pem
    • /etc/puppetlabs/puppet/ssl/private_keys/capsule.example.com.pem
    • /etc/puppetlabs/puppet/ssl/public_keys/capsule.example.com.pem
    • /etc/puppetlabs/puppetserver/ca/signed/capsule.example.com.pem
  7. 启动 Puppet 服务器:

    # systemctl start puppetserver
    Copy to Clipboard Toggle word wrap

在每个负载平衡胶囊服务器上,不包括配置为签署 Puppet 证书的胶囊服务器,将系统配置为使用 Puppet 证书。

流程

  1. 在 Satellite 服务器上,为 Capsule 服务器生成 Katello 证书:

    # capsule-certs-generate \
    --certs-tar "/root/capsule.example.com-certs.tar" \
    --foreman-proxy-cname loadbalancer.example.com \
    --foreman-proxy-fqdn capsule.example.com
    Copy to Clipboard Toggle word wrap

    保留由 capsule-certs-generate 命令输出的示例 satellite-installer 命令的副本,用于安装 Capsule 服务器证书。

  2. 将证书存档文件从 Satellite 服务器复制到 Capsule 服务器:

    # scp /root/capsule.example.com-certs.tar root@capsule.example.com:/root/capsule.example.com-certs.tar
    Copy to Clipboard Toggle word wrap
  3. 在 Capsule 服务器上,安装 puppetserver 软件包:

    # satellite-maintain packages install puppetserver
    Copy to Clipboard Toggle word wrap
  4. 在 Capsule 服务器上,为 puppet 证书创建目录:

    # mkdir -p /etc/puppetlabs/puppet/ssl/certs/ \
    /etc/puppetlabs/puppet/ssl/private_keys/ \
    /etc/puppetlabs/puppet/ssl/public_keys/
    Copy to Clipboard Toggle word wrap
  5. 在 Capsule 服务器上,从配置胶囊服务器的系统中复制此胶囊服务器的 Puppet 证书,以签署 Puppet 证书:

    # scp root@capsule-ca.example.com:/etc/puppetlabs/puppet/ssl/certs/capsule.example.com.pem /etc/puppetlabs/puppet/ssl/certs/capsule.example.com.pem
    # scp root@capsule-ca.example.com:/etc/puppetlabs/puppet/ssl/certs/ca.pem /etc/puppetlabs/puppet/ssl/certs/ca.pem
    # scp root@capsule-ca.example.com:/etc/puppetlabs/puppet/ssl/private_keys/capsule.example.com.pem /etc/puppetlabs/puppet/ssl/private_keys/capsule.example.com.pem
    # scp root@capsule-ca.example.com:/etc/puppetlabs/puppet/ssl/public_keys/capsule.example.com.pem /etc/puppetlabs/puppet/ssl/public_keys/capsule.example.com.pem
    Copy to Clipboard Toggle word wrap
  6. 在 Capsule 服务器上,将 /etc/puppetlabs/puppet/ssl/ 目录所有权改为用户 puppet 和组 puppet

    # chown -R puppet:puppet /etc/puppetlabs/puppet/ssl/
    Copy to Clipboard Toggle word wrap
  7. 在 Capsule 服务器上,为 /etc/puppetlabs/puppet/ssl/ 目录设置 SELinux 上下文:

    # restorecon -Rv /etc/puppetlabs/puppet/ssl/
    Copy to Clipboard Toggle word wrap
  8. 将以下选项附加到您从 capsule-certs-generate 命令的输出中获取的 satellite-installer 命令中:

    --certs-cname "loadbalancer.example.com" \
    --enable-foreman-proxy-plugin-remote-execution-script \
    --foreman-proxy-puppetca "false" \
    --puppet-ca-server "capsule-ca.example.com" \
    --puppet-dns-alt-names "loadbalancer.example.com" \
    --puppet-server-ca "false"
    Copy to Clipboard Toggle word wrap
  9. 在 Capsule 服务器上,输入 satellite-installer 命令:

    # satellite-installer --scenario capsule \
    --certs-cname "loadbalancer.example.com" \
    --certs-tar-file "capsule.example.com-certs.tar" \
    --enable-foreman-proxy-plugin-remote-execution-script \
    --foreman-proxy-foreman-base-url "https://satellite.example.com" \
    --foreman-proxy-oauth-consumer-key "oauth key" \
    --foreman-proxy-oauth-consumer-secret "oauth secret" \
    --foreman-proxy-puppetca "false" \
    --foreman-proxy-register-in-foreman "true" \
    --foreman-proxy-trusted-hosts "satellite.example.com" \
    --foreman-proxy-trusted-hosts "capsule.example.com" \
    --puppet-ca-server "capsule-ca.example.com" \
    --puppet-dns-alt-names "loadbalancer.example.com" \
    --puppet-server-ca "false"
    Copy to Clipboard Toggle word wrap

5.4. 在 Satellite 中管理 Puppet 限制

如果使用 Puppet,则 Puppet 证书签名请求将分配给您配置的第一个胶囊。如果第一个胶囊停机,主机无法获取 Puppet 内容。

Puppet 证书颁发机构(CA)管理不支持负载均衡设置中的证书签名请求。Puppet CA 将证书信息(如序列号计数器和 CRL)存储在文件系统中。尝试使用相同数据的多个写入器进程可能会破坏它。

要管理此 Puppet 限制,请完成以下步骤:

  1. 在一台胶囊服务器上配置 Puppet 证书签名请求,通常是配置胶囊服务器以进行负载平衡的第一个系统。
  2. 配置客户端,以将 CA 请求发送到负载均衡器上的端口 8141。
  3. 配置负载平衡器,将来自端口 8141 的 CA 请求重定向到您配置胶囊服务器以签署 Puppet 证书的系统上的端口 8140。

要排除问题,请绕过负载平衡器,在每个胶囊上重现问题。此解决方案不使用 Pacemaker 或其他类似的 HA 工具在所有胶囊中保持一个状态。

您可以配置一个或多个使用自定义 SSL 证书进行负载平衡的胶囊服务器。

6.1. 先决条件

6.2. 为胶囊服务器创建自定义 SSL 证书

在您要为负载均衡配置的每个胶囊服务器上,为证书签名请求创建一个配置文件,并将负载均衡器和胶囊服务器作为主题备用名称(SAN)包含。

流程

  1. 要存储所有源证书文件,请创建一个只能被 root 用户访问的目录:

    # mkdir /root/capsule_cert
    Copy to Clipboard Toggle word wrap
  2. 创建用于签署证书签名请求(CSR)的私钥。

    请注意,私钥必须是未加密的。如果您使用密码保护的私钥,请删除私钥密码。

    如果您已有此胶囊服务器的私钥,请跳过这一步。

    # openssl genrsa -out /root/capsule_cert/capsule_cert_key.pem 4096
    Copy to Clipboard Toggle word wrap
  3. 为 CSR 创建 /root/capsule_cert/openssl.cnf 配置文件并包含以下内容:

    [ req ]
    req_extensions = v3_req
    distinguished_name = req_distinguished_name
    x509_extensions = usr_cert
    prompt = no
    
    [ req_distinguished_name ]
    commonName = capsule.example.com 
    1
    
    
    [ v3_req ]
    basicConstraints = CA:FALSE
    keyUsage = digitalSignature, keyEncipherment
    extendedKeyUsage = serverAuth, clientAuth
    subjectAltName = @alt_names
    
    [alt_names] 
    2
    
    DNS.1 = loadbalancer.example.com
    DNS.2 = capsule.example.com
    Copy to Clipboard Toggle word wrap
    1
    证书的通用名称必须与 Capsule 服务器的 FQDN 匹配。确保在为负载平衡配置的每个胶囊服务器上运行 命令时更改此设置。您还可以设置通配符值 *。如果设置通配符值,您必须在使用 katello-certs-check 命令时添加 -t capsule 选项。
    2
    [alt_names] 下,将负载均衡器的 FQDN 包含在 DNS.1 下,以及 Capsule Server 的 FQDN 作为 DNS.2

    有关 [ v3_req ] 参数及其目的的更多信息,请参阅 RFC 5280: Internet X.509 公钥基础架构证书和证书撤销列表(CRL)配置文件

  4. 可选:如果要在 CSR 中添加可辨识名称(DN)详情,请在 [ req_distinguished_name ] 部分中添加以下信息:

    [req_distinguished_name]
    CN = capsule.example.com
    countryName = My_Country_Name 
    1
    
    stateOrProvinceName = My_State_Or_Province_Name 
    2
    
    localityName = My_Locality_Name 
    3
    
    organizationName = My_Organization_Or_Company_Name
    organizationalUnitName = My_Organizational_Unit_Name 
    4
    Copy to Clipboard Toggle word wrap
    1
    两个字母代码
    2
    全名
    3
    全名(例如:New York)
    4
    负责证书的部门(示例:IT 部门)
  5. 生成 CSR:

    # openssl req -new \
    -key /root/capsule_cert/capsule_cert_key.pem \ 
    1
    
    -config /root/capsule_cert/openssl.cnf \ 
    2
    
    -out /root/capsule_cert/capsule_cert_csr.pem 
    3
    Copy to Clipboard Toggle word wrap
    1
    私钥的路径
    2
    配置文件的路径
    3
    要生成的 CSR 的路径
  6. 将证书签名请求发送到证书颁发机构(CA)。同一 CA 必须为 Satellite 服务器和胶囊服务器签名证书。

    提交请求时,指定证书的期限。发送证书请求的方法会有所不同,因此请查阅 CA 了解首选方法。根据请求,您可以预期在单独的文件中接收 CA 捆绑包和签名证书。

  7. 将您从证书颁发机构和胶囊服务器私钥接收的证书颁发机构捆绑包和胶囊服务器证书文件复制到 Satellite 服务器。
  8. 在 Satellite 服务器上,验证 Capsule 服务器证书输入文件:

    # katello-certs-check \
    -c /root/capsule_cert/capsule_cert.pem \ 
    1
    
    -k /root/capsule_cert/capsule_cert_key.pem \ 
    2
    
    -b /root/capsule_cert/ca_cert_bundle.pem 
    3
    Copy to Clipboard Toggle word wrap
    1
    胶囊服务器证书文件,由您的证书颁发机构提供
    2
    用于为证书签名的 Capsule 服务器私钥
    3
    证书颁发机构捆绑包,由您的证书颁发机构提供

    如果将 commonName= 设置为通配符值 *,您必须在 katello-certs -check 命令中添加 the-t Capsule 选项。

    保留 example capsule-certs-generate 命令的副本,它由 katello-certs-check 命令为这个 Capsule 服务器创建证书归档文件来输出。

在用于为所有其他负载平衡胶囊服务器生成 Puppet 证书的胶囊服务器上,配置 Puppet 证书生成和签名。

流程

  1. 将以下选项附加到您从 katello-certs-check 命令的输出中获取的 capsule-certs-generate 命令中:

    --foreman-proxy-cname loadbalancer.example.com
    Copy to Clipboard Toggle word wrap
  2. 在 Satellite 服务器上,输入 Capsule -certs-generate 命令来生成 Capsule 证书:

    # capsule-certs-generate \
    --certs-tar /root/capsule_cert/capsule-ca.tar \
    --foreman-proxy-cname loadbalancer.example.com \
    --foreman-proxy-fqdn capsule-ca.example.com \
    --server-ca-cert /root/capsule_cert/ca_cert_bundle.pem \
    --server-cert /root/capsule_cert/capsule-ca.pem \
    --server-key /root/capsule_cert/capsule-ca.pem
    Copy to Clipboard Toggle word wrap

    从用于安装 Capsule 服务器证书的输出中保留示例 satellite-installer 命令的副本。

  3. 将证书存档文件从 Satellite 服务器复制到胶囊服务器。
  4. 将以下选项附加到您从 capsule-certs-generate 命令的输出中获取的 satellite-installer 命令中:

    --enable-foreman-proxy-plugin-remote-execution-script \
    --foreman-proxy-puppetca "true" \
    --puppet-ca-server "capsule-ca.example.com" \
    --puppet-dns-alt-names "loadbalancer.example.com" \
    --puppet-server-ca "true"
    Copy to Clipboard Toggle word wrap
  5. 在 Capsule 服务器上,输入 satellite-installer 命令:

    # satellite-installer --scenario capsule \
    --certs-cname "loadbalancer.example.com" \
    --certs-tar-file "certs.tgz" \
    --enable-foreman-proxy-plugin-remote-execution-script \
    --enable-puppet \
    --foreman-proxy-foreman-base-url "https://satellite.example.com" \
    --foreman-proxy-oauth-consumer-key "oauth key" \
    --foreman-proxy-oauth-consumer-secret "oauth secret" \
    --foreman-proxy-puppetca "true" \
    --foreman-proxy-register-in-foreman "true" \
    --foreman-proxy-trusted-hosts "satellite.example.com" \
    --foreman-proxy-trusted-hosts "capsule-ca.example.com" \
    --puppet-ca-server "capsule-ca.example.com" \
    --puppet-dns-alt-names "loadbalancer.example.com" \
    --puppet-server true \
    --puppet-server-ca "true"
    Copy to Clipboard Toggle word wrap
  6. 在作为 Puppetserver 证书颁发机构的 Capsule 服务器上,停止 Puppet 服务器:

    # systemctl stop puppetserver
    Copy to Clipboard Toggle word wrap
  7. 为您配置的所有其他胶囊服务器生成 Puppet 证书,除了第一个配置 Puppet 证书签名请求的系统外:

    # puppetserver ca generate \
    --ca-client \
    --certname capsule.example.com \
    --subject-alt-names loadbalancer.example.com
    Copy to Clipboard Toggle word wrap

    这个命令会创建以下文件:

    • /etc/puppetlabs/puppet/ssl/certs/capsule.example.com.pem
    • /etc/puppetlabs/puppet/ssl/private_keys/capsule.example.com.pem
    • /etc/puppetlabs/puppet/ssl/public_keys/capsule.example.com.pem
    • /etc/puppetlabs/puppetserver/ca/signed/capsule.example.com.pem
  8. 启动 Puppet 服务器:

    # systemctl start puppetserver
    Copy to Clipboard Toggle word wrap

在每个负载平衡胶囊服务器上,不包括配置为签署 Puppet 证书的胶囊服务器,将系统配置为使用 Puppet 证书。

流程

  1. 将以下选项附加到您从 katello-certs-check 命令的输出中获取的 capsule-certs-generate 命令中:

    --foreman-proxy-cname loadbalancer.example.com
    Copy to Clipboard Toggle word wrap
  2. 在 Satellite 服务器上,输入 Capsule -certs-generate 命令来生成 Capsule 证书:

    # capsule-certs-generate \
    --certs-tar /root/capsule_cert/capsule.tar \
    --foreman-proxy-cname loadbalancer.example.com \
    --foreman-proxy-fqdn capsule.example.com \
    --server-ca-cert /root/capsule_cert/ca_cert_bundle.pem \
    --server-cert /root/capsule_cert/capsule.pem \
    --server-key /root/capsule_cert/capsule.pem
    Copy to Clipboard Toggle word wrap

    从用于安装 Capsule 服务器证书的输出中保留示例 satellite-installer 命令的副本。

  3. 将证书存档文件从 Satellite 服务器复制到胶囊服务器。

    # scp /root/capsule.example.com-certs.tar root@capsule.example.com:capsule.example.com-certs.tar
    Copy to Clipboard Toggle word wrap
  4. 在 Capsule 服务器上,安装 puppetserver 软件包:

    # satellite-maintain packages install puppetserver
    Copy to Clipboard Toggle word wrap
  5. 在 Capsule 服务器上,为 puppet 证书创建目录:

    # mkdir -p /etc/puppetlabs/puppet/ssl/certs/ \
    /etc/puppetlabs/puppet/ssl/private_keys/ \
    /etc/puppetlabs/puppet/ssl/public_keys/
    Copy to Clipboard Toggle word wrap
  6. 在 Capsule 服务器上,从配置胶囊服务器的系统中复制此胶囊服务器的 Puppet 证书,以签署 Puppet 证书:

    # scp root@capsule-ca.example.com:/etc/puppetlabs/puppet/ssl/certs/capsule.example.com.pem /etc/puppetlabs/puppet/ssl/certs/capsule.example.com.pem
    # scp root@capsule-ca.example.com:/etc/puppetlabs/puppet/ssl/certs/ca.pem /etc/puppetlabs/puppet/ssl/certs/ca.pem
    # scp root@capsule-ca.example.com:/etc/puppetlabs/puppet/ssl/private_keys/capsule.example.com.pem /etc/puppetlabs/puppet/ssl/private_keys/capsule.example.com.pem
    # scp root@capsule-ca.example.com:/etc/puppetlabs/puppet/ssl/public_keys/capsule.example.com.pem /etc/puppetlabs/puppet/ssl/public_keys/capsule.example.com.pem
    Copy to Clipboard Toggle word wrap
  7. 在 Capsule 服务器上,将 /etc/puppetlabs/puppet/ssl/ 目录所有权改为用户 puppet 和组 puppet

    # chown -R puppet:puppet /etc/puppetlabs/puppet/ssl/
    Copy to Clipboard Toggle word wrap
  8. 在 Capsule 服务器上,为 /etc/puppetlabs/puppet/ssl/ 目录设置 SELinux 上下文:

    # restorecon -Rv /etc/puppetlabs/puppet/ssl/
    Copy to Clipboard Toggle word wrap
  9. 将以下选项附加到您从 capsule-certs-generate 命令的输出中获取的 satellite-installer 命令中:

    --certs-cname "loadbalancer.example.com" \
    --enable-foreman-proxy-plugin-remote-execution-script \
    --foreman-proxy-puppetca "false" \
    --puppet-ca-server "capsule-ca.example.com" \
    --puppet-dns-alt-names "loadbalancer.example.com" \
    --puppet-server-ca "false"
    Copy to Clipboard Toggle word wrap
  10. 在 Capsule 服务器上,输入 satellite-installer 命令:

    # satellite-installer --scenario capsule \
    --certs-cname "loadbalancer.example.com" \
    --certs-tar-file "capsule.example.com-certs.tar" \
    --enable-foreman-proxy-plugin-remote-execution-script \
    --foreman-proxy-foreman-base-url "https://satellite.example.com" \
    --foreman-proxy-oauth-consumer-key "oauth key" \
    --foreman-proxy-oauth-consumer-secret "oauth secret" \
    --foreman-proxy-puppetca "false" \
    --foreman-proxy-register-in-foreman "true" \
    --foreman-proxy-trusted-hosts "satellite.example.com" \
    --foreman-proxy-trusted-hosts "capsule.example.com" \
    --puppet-ca-server "capsule-ca.example.com" \
    --puppet-dns-alt-names "loadbalancer.example.com" \
    --puppet-server-ca "false"
    Copy to Clipboard Toggle word wrap

6.5. 在 Satellite 中管理 Puppet 限制

如果使用 Puppet,则 Puppet 证书签名请求将分配给您配置的第一个胶囊。如果第一个胶囊停机,主机无法获取 Puppet 内容。

Puppet 证书颁发机构(CA)管理不支持负载均衡设置中的证书签名请求。Puppet CA 将证书信息(如序列号计数器和 CRL)存储在文件系统中。尝试使用相同数据的多个写入器进程可能会破坏它。

要管理此 Puppet 限制,请完成以下步骤:

  1. 在一台胶囊服务器上配置 Puppet 证书签名请求,通常是配置胶囊服务器以进行负载平衡的第一个系统。
  2. 配置客户端,以将 CA 请求发送到负载均衡器上的端口 8141。
  3. 配置负载平衡器,将来自端口 8141 的 CA 请求重定向到您配置胶囊服务器以签署 Puppet 证书的系统上的端口 8140。

要排除问题,请绕过负载平衡器,在每个胶囊上重现问题。此解决方案不使用 Pacemaker 或其他类似的 HA 工具在所有胶囊中保持一个状态。

第 7 章 在负载均衡设置中升级胶囊服务器

要将 Capsule 服务器从 6.16 升级到 6.17,请参阅将 连接的 Red Hat Satellite 升级到 6.17。在负载平衡配置中,胶囊服务器不需要额外的步骤。

第 8 章 为主机注册设置负载均衡器

在使用主机注册功能时,您可以将 Satellite 配置为通过负载均衡器注册客户端。

您将能够将主机注册到负载平衡器,而非 Capsule。负载平衡器将决定在请求时通过哪个胶囊注册主机。注册后,主机上的订阅管理器将被配置为通过负载均衡器管理内容。

前提条件

流程

  1. 在所有 Capsule 服务器上,使用 satellite-installer 设置注册和模板 URL:

    # satellite-installer \
    --foreman-proxy-registration-url "https://loadbalancer.example.com:9090" \
    --foreman-proxy-template-url "http://loadbalancer.example.com:8000"
    Copy to Clipboard Toggle word wrap
  2. 在 Satellite Web UI 中,进入到 Infrastructure > Capsules
  3. 对于每个胶囊,单击 Actions 列中的下拉菜单,再选择 Refresh

第 9 章 安装负载均衡器

以下示例提供了使用 Red Hat Enterprise Linux 9 配置 HAProxy 负载均衡器的一般指导。但是,您可以安装支持 TCP 转发的任何合适的负载均衡软件解决方案。

流程

  1. 安装 HAProxy:

    # dnf install haproxy
    Copy to Clipboard Toggle word wrap
  2. 安装以下包含 semanage 工具的软件包:

    # dnf install policycoreutils-python-utils
    Copy to Clipboard Toggle word wrap
  3. 配置 SELinux 以允许 HAProxy 绑定任何端口:

    # semanage boolean --modify --on haproxy_connect_any
    Copy to Clipboard Toggle word wrap
  4. 配置负载均衡器来平衡端口的网络负载,如 表 9.1 “负载均衡器的端口配置” 所述。例如,要为 HAProxy 配置端口,请编辑 /etc/haproxy/haproxy.cfg 文件与表对应。如需更多信息,请参阅红帽知识库中的 使用 Satellite 6 的 HAProxy 负载均衡器的 haproxy.cfg 配置示例

    Expand
    表 9.1. 负载均衡器的端口配置
    service端口模式平衡模式目的地

    HTTP

    80

    TCP

    roundrobin

    所有 Capsule 服务器上的端口 80

    HTTPS 和 RHSM

    443

    TCP

    source

    所有 Capsule 服务器上的端口 443

    用于模板检索的 Anaconda

    8000

    TCP

    roundrobin

    所有 Capsule 服务器上的端口 8000

    puppet (可选)

    8140

    TCP

    roundrobin

    所有 Capsule 服务器上端口 8140

    PuppetCA (可选)

    8141

    TCP

    roundrobin

    仅在配置 Capsule 服务器为 Puppet 证书签名的系统上端口 8140

    用于主机注册和可选 OpenSCAP 的 Capsule HTTPS

    9090

    TCP

    roundrobin

    所有 Capsule 服务器上的端口 9090

  5. 配置负载均衡器以禁用 SSL 卸载并允许客户端 SSL 证书传递给后端服务器。这是必要的,因为从客户端到胶囊服务器的通信取决于客户端 SSL 证书。
  6. 启动并启用 HAProxy 服务:

    # systemctl enable --now haproxy
    Copy to Clipboard Toggle word wrap

第 10 章 验证负载平衡配置

使用这个流程验证每个胶囊服务器的负载均衡配置。

流程

  1. 关闭胶囊服务器的基本操作系统。
  2. 验证内容或订阅管理功能是否在注册到此胶囊的客户端上可用。例如,在客户端上输入 subscription-manager refresh 命令。
  3. 为您的胶囊服务器重启基础操作系统。

第 11 章 将客户端注册到负载均衡器

要平衡来自客户端的网络流量负载,您必须将客户端注册到负载均衡器。

要注册客户端,请执行以下流程之一:

11.1. 使用主机注册注册客户端

您可以使用 Satellite Web UI、Hammer CLI 或 Satellite API 中的主机注册功能将主机注册到 Satellite。如需更多信息,请参阅 管理主机 中的 注册主机和设置主机集成

先决条件

流程

  1. 在 Satellite Web UI 中,进入到 Hosts > Register Host
  2. Capsule 下拉列表中,选择配置了负载平衡的 Capsule 服务器。
  3. 选择 Force 注册之前注册到胶囊服务器的主机。
  4. Activation Keys 列表中,选择要分配给主机的激活码。
  5. Generate 来创建注册命令。
  6. files 图标将命令复制到您的剪贴板。
  7. 使用 SSH 连接到您的主机并运行注册命令。
  8. 检查 /etc/yum.repos.d/redhat.repo 文件,并确保启用了适当的软件仓库。

CLI 过程

  1. 生成使用 Hammer CLI 的主机注册命令:

    $ hammer host-registration generate-command \
    --activation-keys "My_Activation_Key"
    Copy to Clipboard Toggle word wrap

    如果您的主机不信任 Satellite 服务器的 SSL 证书,您可以通过在注册命令中添加- insecure 标志来禁用 SSL 验证。

    $ hammer host-registration generate-command \
    --activation-keys "My_Activation_Key" \
    --insecure true
    Copy to Clipboard Toggle word wrap

    包含 --smart-proxy-id My_Capsule_ID 选项。您可以使用您为主机注册负载均衡配置的任何胶囊服务器的 ID。Satellite 会自动将负载均衡器应用到注册命令。

    包含 -强制 选项,以注册之前注册到胶囊服务器的主机。

  2. 使用 SSH 连接到您的主机并运行注册命令。
  3. 检查 /etc/yum.repos.d/redhat.repo 文件,并确保启用了适当的软件仓库。

API 流程

  1. 生成使用 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"] }}'
    Copy to Clipboard Toggle word wrap

    如果您的主机不信任 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 }}'
    Copy to Clipboard Toggle word wrap

    使用激活码来简化指定环境的过程。如需更多信息,请参阅管理内容中的管理激活码

    Include { "smart_proxy_id": My_Capsule_ID }.您可以使用您为主机注册负载均衡配置的任何胶囊服务器的 ID。Satellite 会自动将负载均衡器应用到注册命令。

    包含 { "force": true } 以注册之前注册到胶囊服务器的主机。

    如果需要输入密码作为命令行参数,请使用 username:password 语法。请注意,这会将密码保存到 shell 的历史记录中。或者,您可以使用临时个人访问令牌而不是密码。要在 Satellite Web UI 中生成令牌,请进入到 My Account > Personal Access Tokens

  2. 使用 SSH 连接到您的主机并运行注册命令。
  3. 检查 /etc/yum.repos.d/redhat.repo 文件,并确保启用了适当的软件仓库。

要注册客户端,请在客户端上输入以下命令。您必须为每个客户端完成注册过程。

先决条件

流程

  • 在 Red Hat Enterprise Linux 8 中,输入以下命令:

    # /usr/libexec/platform-python bootstrap.py \
    --activationkey="My_Activation_Key" \
    --enablerepos=satellite-client-6-for-rhel-8-<arch>-rpms \ 
    1
    
    --force \ 
    2
    
    --hostgroup="My_Host_Group" \
    --location="My_Location" \
    --login=admin \
    --organization="My_Organization" \
    --puppet-ca-port 8141 \ 
    3
    
    --server loadbalancer.example.com
    Copy to Clipboard Toggle word wrap
    1
    <arch > 替换为客户端架构,如 x86
    2
    包含- force 选项,以注册之前注册到单机胶囊的客户端。
    3
    如果使用 Puppet,请包含--puppet-ca-port 8141 选项。
  • 在 Red Hat Enterprise Linux 7 中,输入以下命令:

    # python bootstrap.py --login=admin \
    --activationkey="My_Activation_Key" \
    --enablerepos=rhel-7-server-satellite-client-6-rpms \
    --force \ 
    1
    
    --hostgroup="My_Host_Group" \
    --location="My_Location" \
    --organization="My_Organization" \
    --puppet-ca-port 8141 \ 
    2
    
    --server loadbalancer.example.com
    Copy to Clipboard Toggle word wrap
    1
    包含- force 选项,以注册之前注册到单机胶囊的客户端。
    2
    如果使用 Puppet,请包含--puppet-ca-port 8141 选项。

该脚本提示您输入与您使用- login 选项输入的 Satellite 用户名对应的密码。

第 12 章 通过负载均衡器传播 SCAP 内容

如果使用 OpenSCAP 管理客户端上的安全合规性,您必须将 SCAP 客户端配置为向负载均衡器发送 ARF 报告,而不是 Capsule。配置过程取决于您选择用于部署合规策略的方法。

12.1. 使用 Ansible 部署传播 SCAP 内容

使用这个流程,您可以通过 Ansible 部署方法范围内通过负载均衡器提升安全内容自动化协议(SCAP)内容。

先决条件

  • 确保您已配置了 Satellite 以 Ansible 部署合规策略的 Ansible。如需更多信息, 请参阅管理安全合规 中的配置合规策略部署方法

流程

  1. 在 Satellite Web UI 中,进入到 Configure > Ansible > Variables
  2. 搜索 foreman_scap_client_port 变量,再单击其名称。
  3. Default Behavior 区域中,确保选中了 Override 复选框。
  4. Parameter Type 列表中,确保选择了 整数
  5. Default Value 字段中,输入 9090
  6. Specify Matchers 区域中,删除所有覆盖默认值的匹配者。
  7. Submit
  8. 搜索 foreman_scap_client_server 变量,再单击其名称。
  9. Default Behavior 区域中,确保选中了 Override 复选框。
  10. Parameter Type 列表中,确保选中了 字符串
  11. Default Value 字段中,输入负载均衡器的 FQDN,如 loadbalancer.example.com
  12. Specify Matchers 区域中,删除所有覆盖默认值的匹配者。
  13. Submit
  14. 使用 Ansible 继续部署合规策略。如需更多信息,请参阅:

验证

  • 在客户端上,验证 /etc/foreman_scap_client/config.yaml 文件是否包含以下行:

    # Foreman proxy to which reports should be uploaded
    :server: 'loadbalancer.example.com'
    :port: 9090
    Copy to Clipboard Toggle word wrap

12.2. 使用 Puppet 部署传播 SCAP 内容

使用此流程,您可以通过 Puppet 部署方法范围内的负载均衡器来提升安全内容自动化协议(SCAP)内容。

先决条件

  • 确保您已配置了 Satellite 以 Puppet 部署合规策略。如需更多信息, 请参阅管理安全合规 中的配置合规策略部署方法

流程

  1. 在 Satellite Web UI 中,进入到 Configure > Puppet ENC > Classes
  2. 单击 foreman_scap_client
  3. 单击 Smart Class Parameter 选项卡。
  4. 智能类参数 窗口左侧的窗格中,单击 端口
  5. 默认行为 区域中,选中 覆盖 复选框。
  6. Key Type 列表中,选择 integer
  7. Default Value 字段中,输入 9090
  8. 智能类参数 窗口左侧的窗格中,单击 server
  9. 默认行为 区域中,选中 覆盖 复选框。
  10. Key Type 列表中,选择 字符串
  11. Default Value 字段中,输入负载均衡器的 FQDN,如 loadbalancer.example.com
  12. Smart Class Parameter 窗口的左下角,单击 Submit
  13. 使用 Puppet 继续部署合规策略。如需更多信息,请参阅:

验证

  • 在客户端上,验证 /etc/foreman_scap_client/config.yaml 文件是否包含以下行:

    # Foreman proxy to which reports should be uploaded
    :server: 'loadbalancer.example.com'
    :port: 9090
    Copy to Clipboard Toggle word wrap

法律通告

Copyright © 2025 Red Hat, Inc.
The text of and illustrations in this document are licensed by Red Hat under a Creative Commons Attribution–Share Alike 3.0 Unported license ("CC-BY-SA"). An explanation of CC-BY-SA is available at http://creativecommons.org/licenses/by-sa/3.0/. In accordance with CC-BY-SA, if you distribute this document or an adaptation of it, you must provide the URL for the original version.
Red Hat, as the licensor of this document, waives the right to enforce, and agrees not to assert, Section 4d of CC-BY-SA to the fullest extent permitted by applicable law.
Red Hat, Red Hat Enterprise Linux, the Shadowman logo, the Red Hat logo, JBoss, OpenShift, Fedora, the Infinity logo, and RHCE are trademarks of Red Hat, Inc., registered in the United States and other countries.
Linux® is the registered trademark of Linus Torvalds in the United States and other countries.
Java® is a registered trademark of Oracle and/or its affiliates.
XFS® is a trademark of Silicon Graphics International Corp. or its subsidiaries in the United States and/or other countries.
MySQL® is a registered trademark of MySQL AB in the United States, the European Union and other countries.
Node.js® is an official trademark of Joyent. Red Hat is not formally related to or endorsed by the official Joyent Node.js open source or commercial project.
The OpenStack® Word Mark and OpenStack logo are either registered trademarks/service marks or trademarks/service marks of the OpenStack Foundation, in the United States and other countries and are used with the OpenStack Foundation's permission. We are not affiliated with, endorsed or sponsored by the OpenStack Foundation, or the OpenStack community.
All other trademarks are the property of their respective owners.
Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。 了解我们当前的更新.

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

Theme

© 2026 Red Hat
返回顶部