注册 CentOS 客户端

本节包含有关注册运行 CentOS 操作系统的客户端的信息。

  • CentOS 储存库 URL 可从 SUSE Customer Center 获取。

  • 软件包和元数据由 CentOS 而不是 SUSE 提供。

  • 有关支持的产品,请参见版本说明和 支持的 CentOS 功能 中的支持表格。

CentOS 客户端基于 CentOS,与 SUSE Linux Enterprise Server with Expanded Support、RES、Red Hat 或 Expanded Support 不相关。

您需负责安排对 CentOS 基础媒体储存库和 CentOS 安装媒体的访问权限,以及将 SUSE Multi-Linux Manager 服务器连接到 CentOS 内容分发网络。

Registering CentOS clients to SUSE Multi-Linux Manager is tested with the default SELinux configuration of enforcing with a targeted policy. You do not need to disable SELinux to register CentOS clients to SUSE Multi-Linux Manager.

1. 添加软件通道

将 CentOS 客户端注册到您的 SUSE Multi-Linux Manager 服务器之前,您需要添加所需的软件通道,并同步这些通道。

当前支持的系统结构为 x86_64aarch64。有关支持的产品和体系结构的完整列表,请参见 支持的客户端和功能

In the following section, descriptions often default to the x86_64 architecture. Replace it with other architectures if appropriate.

例如,使用 x86_64 体系结构时,您需要如下产品:

Table 1. CentOS 产品 - WebUI
操作系统版本 产品名称

CentOS 7

CentOS 7 x86_64

过程:添加软件通道
  1. 在 SUSE Multi-Linux Manager Web UI 中,导航到管理  安装向导  产品

  2. Locate the appropriate products for your client operating system and architecture using the search bar, and check the appropriate product. This will automatically check all mandatory channels. Also all recommended channels are checked as long as the include recommended toggle is turned on. Click the arrow to see the complete list of related products, and ensure that any extra products you require are checked.

  3. 单击 添加产品 并等待产品完成同步。

或者,您也可以在命令提示符处添加通道。此过程所需的通道包括:

Table 2. CentOS 通道 - CLI
操作系统版本 基础通道

CentOS 7

centos7-x86_64

过程:通过命令行添加软件通道
  1. 在 SUSE Multi-Linux Manager 容器主机的命令提示符处,以 root 身份命令添加相应的通道:

    mgrctl exec -- mgr-sync add channel <channel_label_1>
    mgrctl exec -- mgr-sync add channel <channel_label_2>
    mgrctl exec -- mgr-sync add channel <channel_label_n>
  2. 系统会自动启动同步。如果您要手动同步通道,请使用以下命令:

    mgrctl exec -- mgr-sync sync --with-children <channel_name>
  3. 确保同步已完成,然后再继续操作。

If you are using modular channels, you must enable the Python 3.6 module stream on the client. If you do not provide Python 3.6, the installation of the spacecmd package will fail.

您可能会发现 AppStream 通道中提供的软件包数量在上游通道和 SUSE Multi-Linux Manager 通道之间存在一定的差异。如果您对在不同时间添加的同一通道进行比较,会发现其数量也不相同。这是由 CentOS 管理其储存库的方式所致。当有新版本发布时,CentOS 会去除软件包的较旧版本,而 SUSE Multi-Linux Manager 则会保留所有版本,无论新旧与否。

2. 检查同步状态

过程:通过 Web UI 检查同步进度
  1. In the SUSE Multi-Linux Manager Web UI, navigate to Admin  Setup Wizard and select the Products tab. This dialog displays a completion bar for each product when they are being synchronized.

  2. Alternatively, you can navigate to Software  Manage  Channels, then click the channel associated to the repository. Navigate to the Repositories tab, then click Sync and check Sync Status.

过程:通过命令行检查同步进度
  1. 要在跟踪日志前列出可用日志,请在容器主机上运行以下命令:

    mgrctl exec ls /var/log/rhn/reposync/
  2. 在 SUSE Multi-Linux Manager 容器主机的命令提示符处,以 root 身份检查通道日志文件的同步:

    mgrctl exec -ti -- tail -f /var/log/rhn/reposync/<channel-label>.log
  3. 每个子通道在同步过程中会生成自身的日志。您需要检查所有基础通道和子通道日志文件,以确保同步完成。

3. 创建激活密钥

您需要创建与您的 CentOS 通道关联的激活密钥。

有关激活密钥的详细信息,请参见 激活密钥

4. 管理 GPG 密钥

安装软件包之前,客户端会使用 GPG 密钥检查这些软件包的真实性。只有可信软件才能安装在客户端上。

信任 GPG 密钥对于客户端的安全非常重要。由管理员来决定需要哪些密钥,可以信任哪些密钥。这是因为如果不信任 GPG 密钥,便无法使用软件通道,是否将通道指派给客户端取决于是否信任密钥。

有关 GPG 密钥的详细信息,请参见 GPG 密钥

5. 注册客户端

CentOS 7 will fail to onboard due to the fact that the /etc/yum.repos.d/CentOS-Base.repo has URLs enabled, and thus causing yum to attempt to find the repositories using fastmirror. This will cause the bootstrap to fail with the error message:

无法解析主机:mirrorlist.centos.org;未知错误

To avoid the issue you can remove the CentOS-Base.repo file with the command:

rm -f /etc/yum.repos.d/CentOS-Base.repo

Or, if the file needs to remain, you can add enabled=0 to each of the URL sections.

无论选择哪种方式,之后都需重新执行引导流程。

要注册您的客户端,需要有引导储存库。系统默认会自动创建引导储存库,并且每天会为所有同步的产品重新生成该储存库。您可以在容器主机的命令提示符处手动创建引导储存库:

mgrctl exec -ti mgr-create-bootstrap-repo

有关注册客户端的详细信息,请参见 客户端注册