SUSE Multi-Linux Manager 5.1 服务器部署

本指南介绍如何在 SL Micro 6.1 或 SUSE Linux Enterprise Server 15 SP7 上安装和配置 SUSE Multi-Linux Manager 5.1 容器。

1. SUSE Multi-Linux Manager 的硬件要求

These tables shows the software and hardware requirements for deploying SUSE Multi-Linux Manager Server on your bare metal machine. For the purposes of this guide your machine should have 16 GB of RAM, and at least 200 GB of disk space. For background information about disk space, see 硬件要求.

Table 1. Software Requirements
Software Recommended

Operating System

SL Micro 6.1 or

SUSE Linux Enterprise Server 15 SP7

Table 2. 硬件要求
Architecture x86-64, ARM, s390x, ppc64le

Processor (CPU)

Minimum of four (4) 64-bit CPU cores

RAM

16 GB

Disk Space

200 GB

Channel Requirements

50 GB per SUSE or openSUSE product

360 GB per Red Hat product

Swap space:

8 to 12 GB

服务器容器主机支持的操作系统

容器主机支持的操作系统为 SL Micro 6.1 和 SUSE Linux Enterprise Server 15 SP7。

容器主机

A container host is a server equipped with a container engine like Podman, which lets it manage and deploy containers. These containers hold applications and their essential parts, such as libraries, but not a full operating system, making them lightweight. This setup ensures applications run the same way in different environments. The container host supplies the necessary resources such as CPU, memory, and storage for these containers.

必须使用完全限定的域名 (FQDN) 才能完成服务器部署。如果您的路由器或网络无法为 FQDN 提供自动 DNS 置备,则部署过程将无法成功进行。FQDN 通常采用 <主机>.<域>.com 格式。

例如:

  • mlm.example.com

  • mlm.container.lab

有关详细信息,请参见 网络要求 中有关网络要求的章节。

2. 永久性卷

SUSE Multi-Linux Manager 5.1 defines the required persistent storage volumes by default. These are created during installation by the mgradm tool if they do not already exist.

These volumes are created in /var/lib/containers/storage/volumes/, where Podman stores its volumes by default.

建议

您可以通过将外部存储设备挂载到此目录来利用存储的简便性。由于这样会存储 PostgreSQL 数据库、储存库的二进制软件包、缓存、操作系统映像、自动安装发行套件和配置文件,我们提出了三项建议:

快速存储

此挂载点最好是 NVMe 或 SSD 级设备。较慢的存储会对 SUSE Multi-Linux Manager 性能产生不利影响。

大容量

建议的最小容量为 300 GB,如果需要管理多个 Linux 发行套件或体系结构,则应提供更多容量。

建议的文件系统

XFS(不过也可以使用 SL Micro 6.1 支持的任何文件系统)。

可选

You can provide custom storage for the volumes by mounting disks on the expected volume path inside it such as /var/lib/containers/storage/volumes/var-spacewalk. This adds to the complexity of a SUSE Multi-Linux Manager deployment, and may affect the resilience the default storage recommendation provides.

有关容器中所有永久性卷的列表,请参见 永久性容器卷

3. 准备 SUSE Multi-Linux Manager 服务器主机

您可以在 SL Micro 6.1 或 SUSE Linux Enterprise Server 15 SP7 上部署 SUSE Multi-Linux Manager。SL Micro 是事务性系统,而 SUSE Linux Enterprise Server 则是完整的服务器操作系统。

根据您的决定,继续按照 准备 SL Micro 6.1 主机准备 SUSE Linux Enterprise Server 15 SP7 主机 中的说明操作,并跳过未选择的部分。

3.1. 准备 SL Micro 6.1 主机

3.1.1. 下载安装媒体

过程:下载安装媒体
  1. 访问 https://www.suse.com/download/sle-micro/,找到 SL Micro 6.1 的安装媒体,并下载相应媒体文件。

  2. Prepare a DVD or USB flash drive with the downloaded .iso image for installation.

3.1.2. 安装 SL Micro 6.1

过程:安装 SL Micro 6.1
  1. 插入包含 SLE Micro 6.1 安装映像的 DVD 或 USB 闪存盘(USB 磁盘或密钥)。

  2. 引导或重引导您的系统。

  3. Use the arrow keys to select Installation.

  4. 调整键盘和语言。

  5. Click the checkbox to accept the license agreement.

  6. Click Next to continue.

  7. 选择注册方法。在本示例中,我们将在 SUSE Customer Center 中注册服务器。

    SUSE Multi-Linux Manager 5.1 容器会安装为扩展。根据以下列出的所需特定扩展,您还需要有各个扩展的 SUSE Customer Center 注册代码。

    • SUSE Multi-Linux Manager 5.1 服务器

    • SUSE Multi-Linux Manager 5.1 代理

    • SUSE Multi-Linux Manager 5.1 零售分支服务器

    SL Micro 6.1 权利包含在 SUSE Multi-Linux Manager 权利中,因此不需要单独的注册代码。

  8. 输入您的 SUSE Customer Center 电子邮件地址。

  9. 输入您的 SL Micro 6.1 注册代码。

  10. Click Next to continue.

  11. To install a proxy, select the SUSE Multi-Linux Manager 5.1 Proxy extension; to install a server, select the SUSE Multi-Linux Manager 5.1 Server extension Checkbox.

  12. Click Next to continue.

  13. 输入您的 SUSE Multi-Linux Manager 5.1 扩展注册代码。

  14. 单击 下一步 继续。

  15. On the NTP Configuration page click Next.

  16. On the Authentication for the System page enter a password for the root user. Click Next.

  17. On the Installation Settings page click Install.

至此,SL Micro 6.1 及 SUSE Multi-Linux Manager 5.1 扩展的安装已完成。有关虚拟机或物理机准备工作的详细信息,请参见 SL Micro 部署指南

3.1.3. 从命令行注册(可选)

如果您在安装 SL Micro 6.1 期间已将 SUSE Multi-Linux Manager 5.1 添加为扩展,则可以跳过此过程。不过,您也可以选择在安装 SL Micro 6.1 期间单击 跳过注册 按钮来跳过注册。本节提供了在安装 SL Micro 6.1 后注册产品的步骤。

以下步骤将注册 x86-64 体系结构的 SUSE Multi-Linux Manager 5.1 扩展,因此需要提供适用于 x86-64 体系结构的注册代码。要注册 ARM 或 s390x 体系结构,请使用正确的注册代码。

过程:从命令行注册
  1. 运行以下命令列出可用扩展:

    transactional-update --quiet register --list-extensions
  2. 从可用扩展列表中选择一个要安装的扩展:

    1. 如果要安装服务器,请使用您的 SUSE Multi-Linux Manager Server Extension 5.1 x86_64 注册代码运行以下命令:

      transactional-update register -p Multi-Linux-Manager-Server/5.1/x86_64 -r <reg_code>
    2. 如果要安装代理,请使用您的 SUSE Multi-Linux Manager Proxy Extension 5.1 x86_64 注册代码运行以下命令:

    transactional-update register -p Multi-Linux-Manager-Proxy/5.1/x86_64 -r <reg_code>
  3. 重引导。

3.1.4. 更新系统

过程:更新系统
  1. root 身份登录。

  2. 运行 transactional-update

    transactional-update
  3. 重引导。

SL Micro 设计为默认自动更新,并会在应用更新后重引导。但是,这种行为对于 SUSE Multi-Linux Manager 环境而言是不利的。为了防止服务器自动更新,SUSE Multi-Linux Manager 会在引导过程中禁用 transactional-update 计时器。

如果您希望保留 SL Micro 的默认行为,请运行以下命令来启用计时器:

systemctl enable --now transactional-update.timer

要继续部署,请参见 配置自定义永久性存储

3.2. 准备 SUSE Linux Enterprise Server 15 SP7 主机

或者,您也可以在 SUSE Linux Enterprise Server 15 SP7 上部署 SUSE Multi-Linux Manager。

下面的过程介绍安装流程的主要步骤。

3.2.1. 在 SUSE Linux Enterprise Server 上安装 SUSE Multi-Linux Manager 扩展

过程:在 SUSE Linux Enterprise Server 上安装 SUSE Multi-Linux Manager 扩展
  1. Locate and download SUSE Linux Enterprise Server 15 SP7 .iso at https://www.suse.com/download/sles/.

  2. 确保您拥有主机操作系统 (SUSE Linux Enterprise Server 15 SP7) 和扩展的注册代码

  3. 启动 SUSE Linux Enterprise Server 15 SP7 的安装流程。

    1. On the Language, keyboard and product selection select the product to install.

    2. On the License agreement read the agreement and check I Agree to the License Terms.

  4. 选择注册方法。在本示例中,我们将在 SUSE Customer Center 中注册服务器。

  5. 输入您的 SUSE Customer Center 电子邮件地址。

  6. 输入 SUSE Linux Enterprise Server 15 SP7 的注册代码。

  7. Click Next to continue.

    请注意,对于 SUSE Linux Enterprise Server 15 SP7,您需要拥有有效的 SUSE Linux Enterprise Server 订阅及相应的注册代码,并在此界面提供。您还需要在下方输入 SUSE Multi-Linux Manager 扩展的注册代码。

  8. In the screen Extensions and Modules Selection check the following:

    • 选择 SUSE Multi-Linux Manager 服务器扩展以安装服务器,或选择 SUSE Multi-Linux Manager 代理扩展以安装代理。

    • Basesystem 模块

    • Containers 模块

  9. Click Next to continue.

  10. 输入您的 SUSE Multi-Linux Manager 5.1 扩展注册代码。

  11. 单击 下一步 继续。

  12. 完成安装。

  13. 安装完成后,以 root 身份登录新安装的服务器。

  14. 更新系统(可选,如果在安装期间未将系统设置为自动下载更新):

    zypper up
  15. 重引导。

3.2.2. 从命令行注册(可选)

如果您在安装 SUSE Linux Enterprise Server 期间已将 SUSE Multi-Linux Manager 5.1 添加为扩展,则可以跳过此过程。

不过,您也可以选择在安装 SUSE Linux Enterprise Server 期间单击 跳过注册 按钮来跳过注册。本节提供了在安装 SUSE Linux Enterprise Server 后注册产品的步骤。

以下步骤将注册 x86-64 体系结构的 SUSE Multi-Linux Manager 5.1 扩展,因此需要提供适用于 x86-64 体系结构的注册代码。

要注册 ARM 或 s390x 体系结构,请使用正确的注册代码。

过程:从命令行注册
  1. 运行以下命令列出可用扩展:

    SUSEConnect --list-extensions
  2. 从可用扩展列表中选择一个要安装的扩展:

    • If installing the Server, use your SUSE Multi-Linux Manager Server Extension 5.1 x86_64 registration code.

      For example for SUSE Linux Enterprise 15 SP7, use the following commands:

      SUSEConnect -r <regcode>
      SUSEConnect -p sle-module-containers/15.7/x86_64
      SUSEConnect -p Multi-Linux-Manager-Server-SLE/5.1/x86_64 -r <regcode>
    • 如果要安装代理,请运行以下命令,并提供您的 SUSE Multi-Linux Manager Proxy Extension 5.1 x86_64 注册代码:

    SUSEConnect -p Multi-Linux-Manager-Proxy-SLE/5.1/x86_64 -r <regcode>

3.2.3. Install and enable podman

Procedure: Installing podman
  1. root 身份登录并安装产品软件包。

    • 在服务器上:

      zypper in podman
      zypper in -t product Multi-Linux-Manager-Server-SLE
    • 在代理上:

      zypper in podman
      zypper in -t product Multi-Linux-Manager-Proxy-SLE

      Make sure that package podman is installed. Additionally, on the server mgradm and mgradm-bash-completion or on the proxies, mgrpxy and mgrpxy-bash-completion also need to be installed.

  2. 重引导系统或运行以下命令,以启动 Podman 服务:

    systemctl enable --now podman.service

要继续部署,请参见 配置自定义永久性存储

4. 配置自定义永久性存储

Configuring persistent storage is optional, but it is the only way to avoid serious trouble with container full disk conditions. It is highly recommended to configure custom persistent storage with the mgr-storage-server tool.

For more information, see mgr-storage-server --help.

This tool simplifies creating the container storage and database volumes.

如下所示使用命令:

mgr-storage-server <storage-disk-device> [<database-disk-device>]

例如:

mgr-storage-server /dev/nvme1n1 /dev/nvme2n1

This command will create the persistent storage volumes at /var/lib/containers/storage/volumes.

有关详细信息,请参见

5. Deploy SUSE Multi-Linux Manager with mgradm

如果您希望使用第三方 SSL 证书而非自我签名证书,请在执行以下部署过程时导入相应证书。

有关第三方 SSL 证书要求的详细信息,请参见 导入 SSL 证书

SUSE Multi-Linux Manager server hosts that are hardened for security may restrict execution of files from the /tmp folder. In such cases, as a workaround, export the TMPDIR environment variable to another existing path before running mgradm.

例如:

export TMPDIR=/path/to/other/tmp

在 SUSE Multi-Linux Manager 的后续更新中,相关工具将进行优化,届时无需再使用此临时解决方案。

Procedure: Deploying SUSE Multi-Linux Manager 5.1 Using mgradm
  1. 以 root 身份登录。

  2. 部署 SUSE Multi-Linux Manager。

    If you use VM images as a migration target, here as the last step, execute the command mgradm migrate instead of mgradm install.

    根据 SSL 证书类型(自我签名证书或第三方证书),执行以下命令之一。 请将 <FQDN> 替换为 SUSE Multi-Linux Manager 服务器的完全限定域名:

    • 使用 SUSE Multi-Linux Manager 提供的自我签名证书:

      mgradm install podman <FQDN>
    • 使用第三方 SSL 证书标志导入相应 SSL 证书(如果无需全部证书,可调整示例):

      mgradm install podman <FQDN> \
        --ssl-ca-intermediate <strings> \
        --ssl-ca-root <string> \
        --ssl-server-cert <string> \
        --ssl-server-key <string> \
        --ssl-db-ca-intermediate <strings> \
        --ssl-db-ca-root <string> \
        --ssl-db-cert <string> \
        --ssl-db-key <string>

      For more information, see mgradm install podman --help.

    如果执行的命令失败,请确保已注册 SUSE Multi-Linux Manager 5.1。如果您在安装期间跳过了注册,则现在需要从命令行注册。按照以下步骤登录仓库:

    set +o history
    echo SCC_MIRRORING_PASSWORD | podman login -u "SCC_MIRRORING_USER" --password-stdin registry.suse.com
    set -o history

    根据提示使用 SUSE Multi-Linux Manager 5.1 注册密钥。

  3. 根据提示输入 CA 密钥(证书颁发机构)和管理员帐户口令。

    管理员帐户口令长度必须至少为 5 个字符且不超过 48 个字符。

  4. Enter

  5. Enter the email address of the administration account.

    Enter

  6. 等待部署完成。

  7. 打开浏览器并访问您的服务器 FQDN。

  8. Enter your username (default is admin) and the password you set during the deployment process.

在本指南中,您已将 SUSE Multi-Linux Manager 5.1 服务器部署为容器。请继续阅读下一节来添加您的组织身份凭证,以便与 SUSE Customer Center 同步。

6. 将 SUSE Multi-Linux Manager 5.1 连接到 SUSE Customer Center

本节介绍如何通过 Web UI 与 SCC 同步,以及如何添加第一个客户端通道。

过程:输入组织身份凭证
  1. 打开浏览器并访问您的服务器 FQDN。

  2. Enter your username (default is admin) and the password you set during the deployment process.

  3. 在 SUSE Multi-Linux Manager Web UI 中,选择管理  安装向导

  4. From the Setup Wizard page select the Organization Credentials tab.

  5. 单击 添加新身份凭证

  6. 在浏览器中访问 SUSE Customer Center。

  7. 在左侧导航栏中选择您的组织。

  8. 在页面顶部选择用户选项卡,然后单击 组织身份凭证

  9. 记下您的镜像身份凭证

  10. Back in the SUSE Multi-Linux Manager Web UI enter your Username and Password, and confirm with Save.

在系统以绿色打勾图标的形式确认身份凭证后,请继续执行过程:与 SUSE Customer Center 同步

过程:与 SUSE Customer Center 同步
  1. 在 Web UI 中,导航到管理  安装向导

  2. From the Setup Wizard page select the SUSE Products tab.

    If you recently registered with SUSE Customer Center a list of products will begin populating the table. This operation could take up to a few minutes.

    You can monitor the progress of the operation in section on the right Refresh the product catalog from SUSE Customer Center.

    The table of products lists architecture, channels, and status information. For more information, see Wizard.

    admin suse products
  3. Use the Filter by product description and Filter by architecture to filter the list of displayed products.

    The channels listed on the Products page provide repositories for clients.

    • 选中每个通道左侧的复选框将相应通道添加到 SUSE Multi-Linux Manager。

      单击说明左侧的箭头符号可以展开产品并列出可用的模块。

    • 单击页面顶部的 添加产品 开始产品同步。

After adding the channel, SUSE Multi-Linux Manager will schedule the channel to be synchronized. This can take a long time as SUSE Multi-Linux Manager will copy channel software sources from the SUSE repositories located at SUSE Customer Center to the local /var/lib/containers/storage/volumes/var-spacewalk/ directory of your server.

通道完全同步后,将自动为其生成引导储存库。此步骤对于成功引导客户端至关重要,可确保通道同步和分发能够在客户端正常运行。SUSE Multi-Linux Manager 的安装和配置,以及为引导客户端准备所需通道的过程到此完成。

通道同步过程完成后,可以继续注册 SUSE Multi-Linux Manager 5.1 代理或其他客户端。

有关详细说明,请参见 客户端注册

7. 进入容器进行管理

要在容器内访问外壳,请在容器主机上运行以下命令:

mgrctl term