4.2. 更新断开连接的 Satellite 服务器

本节介绍了在 Air-gapped Disconnected setup 中更新所需的步骤,其中连接的卫星服务器(从 CDN 同步内容)与断开连接的 Satellite 服务器没有差距。

在连接的卫星服务器上完成以下步骤。

  1. 确保您已在连接的卫星服务器中同步以下存储库。

    rhel-8-for-x86_64-baseos-rpms
    rhel-8-for-x86_64-appstream-rpms
    satellite-6.12-for-rhel-8-x86_64-rpms
    satellite-maintenance-6.12-for-rhel-8-x86_64-rpms
  2. 下载机构的调试证书并将其保存到本地,例如 /etc/pki/katello/certs/org-debug-cert.pem 或您选择的位置。如需更多信息,请参阅管理 Red Hat Satellite 中的创建机构调试证书
  3. /etc/yum.repos.d 下创建一个 Yum 配置文件,如 satellite-disconnected.repo,其内容如下:

    [rhel-8-for-x86_64-baseos-rpms]
    name=Red Hat Enterprise Linux 8 for x86_64 - BaseOS (RPMs)
    baseurl=https://satellite.example.com/pulp/content/My_Organization/Library/content/dist/rhel8/8/x86_64/baseos/os
    enabled=1
    sslclientcert = /etc/pki/katello/certs/org-debug-cert.pem
    sslclientkey = /etc/pki/katello/certs/org-debug-cert.pem
    sslcacert = /etc/pki/katello/certs/katello-server-ca.crt
    sslverify = 1
    
    [rhel-8-for-x86_64-appstream-rpms]
    name=Red Hat Enterprise Linux 8 for x86_64 - AppStream (RPMs)
    baseurl=https://satellite.example.com/pulp/content/My_Organization/Library/content/dist/rhel8/8/x86_64/appstream/os
    enabled=1
    sslclientcert = /etc/pki/katello/certs/org-debug-cert.pem
    sslclientkey = /etc/pki/katello/certs/org-debug-cert.pem
    sslcacert = /etc/pki/katello/certs/katello-server-ca.crt
    sslverify = 1
    
    [satellite-6.12-for-rhel-8-x86_64-rpms]
    name=Red Hat Satellite 6.12 for RHEL 8 RPMs x86_64
    baseurl=https://satellite.example.com/pulp/content/My_Organization/Library/content/dist/layered/rhel8/x86_64/satellite/6.12/os
    enabled=1
    sslclientcert = /etc/pki/katello/certs/org-debug-cert.pem
    sslclientkey = /etc/pki/katello/certs/org-debug-cert.pem
    sslcacert = /etc/pki/katello/certs/katello-server-ca.crt
    
    [satellite-maintenance-6.12-for-rhel-8-x86_64-rpms]
    name=Red Hat Satellite Maintenance 6.12 for RHEL 8 RPMs x86_64
    baseurl=https://satellite.example.com/pulp/content/My_Organization/Library/content/dist/layered/rhel8/x86_64/sat-maintenance/6.12/os
    enabled=1
    sslclientcert = /etc/pki/katello/certs/org-debug-cert.pem
    sslclientkey = /etc/pki/katello/certs/org-debug-cert.pem
    sslcacert = /etc/pki/katello/certs/katello-server-ca.crt
    sslverify = 1
  4. 在配置文件中,使用下载的机构调试证书的位置替换 sslclientcertsslclientkey 中的 /etc/pki/katello/certs/org-debug-cert.pem
  5. 为您的部署更新 satellite.example.com 正确的 FQDN。
  6. My_Organization 替换为 baseurl 中的正确组织标签。要获取机构标签,请输入以下命令:

    # hammer organization list
  7. 输入 reposync 命令:

    # reposync --delete --download-metadata -p ~/Satellite-repos -n \
     --disableplugin=foreman-protector \
     --repoid rhel-8-for-x86_64-baseos-rpms \
     --repoid rhel-8-for-x86_64-appstream-rpms \
     --repoid satellite-6.12-for-rhel-8-x86_64-rpms \
     --repoid satellite-maintenance-6.12-for-rhel-8-x86_64-rpms

    这会将存储库的内容从连接的卫星服务器下载,并将它们存储在 ~/Satellite-repos 目录中。

  8. 验证 RPM 已经下载,并且位于 ~/Satellite-repos 的各个子目录中是否生成了存储库数据目录。
  9. 归档目录的内容

    # cd ~
    # tar czf Satellite-repos.tgz Satellite-repos
  10. 使用生成的 Satellite-repos.tgz 文件在非联网卫星服务器中升级。

在断开连接的 Satellite 服务器中执行以下步骤:

  1. 将生成的 Satellite-repos.tgz 文件复制到断开连接的 Satellite 服务器中
  2. 将存档 提取到可由 root 用户访问的任意位置。在以下示例中,/root 是提取位置。

    # cd /root
    # tar zxf Satellite-repos.tgz
  3. /etc/yum.repos.d 下创建一个 Yum 配置文件,如 satellite-disconnected.repo,其内容如下:

    [rhel-8-for-x86_64-baseos-rpms]
    name=Red Hat Enterprise Linux 8 for x86_64 - BaseOS (RPMs)
    baseurl=file:///root/Satellite-repos/rhel-8-for-x86_64-baseos-rpms
    enabled=1
    
    [rhel-8-for-x86_64-appstream-rpms]
    name=Red Hat Enterprise Linux 8 for x86_64 - AppStream (RPMs)
    baseurl=file:///root/Satellite-repos/rhel-8-for-x86_64-appstream-rpms
    enabled=1
    
    [satellite-6.12-for-rhel-8-x86_64-rpms]
    name=Red Hat Satellite 6 for RHEL 8 Server RPMs x86_64
    baseurl=file:///root/Satellite-repos/satellite-6.12-for-rhel-8-x86_64-rpms
    enabled=1
    
    [satellite-maintenance-6.12-for-rhel-8-x86_64-rpms]
    name=Red Hat Satellite Maintenance 6 for RHEL 8 Server RPMs x86_64
    baseurl=file:///root/Satellite-repos/satellite-maintenance-6.12-for-rhel-8-x86_64-rpms
    enabled=1
  4. 在配置文件中,将 /root/Satellite-repos 替换为提取的位置。
  5. 检查可用的版本以确认列出了下一个次版本:

    # satellite-maintain upgrade list-versions
  6. 使用健康检查选项来确定系统是否已准备好升级。首次使用这个命令时,satellite-maintain 会提示您输入 hammer admin 用户凭证,并将其保存在 /etc/foreman-maintain/foreman-maintain-hammer.yml 文件中。

    # satellite-maintain upgrade check --whitelist="check-upstream-repository,repositories-validate" --target-version 6.12.z
  7. 在执行升级前,查看结果并解决所有突出显示的错误条件。
  8. 由于更新时间较长,使用 tmux 等工具暂停并重新附加通信会话。然后,您可以检查升级进度,而无需持续连接到命令 shell。

    如果您丢失了运行 upgrade 命令的命令 shell,您可以看到 /var/log/foreman-installer/satellite.log 文件中的日志信息,以检查进程是否已成功完成。

  9. 执行升级:

    # satellite-maintain upgrade run --whitelist="check-upstream-repository,repositories-setup,repositories-validate" --target-version 6.12.z
  10. 检查内核软件包是否最后一次更新:

    # rpm -qa --last | grep kernel
  11. 可选: 如果自上次重启以来发生内核更新,停止 Satellite 服务并重启系统:

    # satellite-maintain service stop
    # reboot