在 openSUSE Leap Micro 6.1 上部署 SUSE Multi-Linux Manager 服务器

1. 部署准备工作

In this section, you will gain expertise in setting up and deploying a SUSE Multi-Linux Manager Server. The process encompasses the installation of Podman, Uyuni container utilities, deployment, and then initiating interaction with the container through mgrctl.

本节假设您已配置 openSUSE Leap Micro 6.1 主机服务器(不考虑它是在物理机还是虚拟环境中运行)。

2. 容器主机一般要求

有关一般要求,请参见一般要求

应通过安装媒体安装 openSUSE Leap Micro 6.1 服务器。

下面介绍此过程。

3. 容器主机要求

有关 CPU、RAM 和存储要求,请参见硬件要求

为了保证客户端能够解析 FQDN 域名,容器化服务器和主机都必须连接到正常运行的 DNS 服务器。此外,必须确保反向查找的配置正确。

4. 安装用于容器的 Uyuni 工具

过程:在 openSUSE Leap Micro 6.1 上安装 Uyuni 工具
  1. 在本地主机上打开终端窗口,或启动一个运行 openSUSE Leap Micro 6.1 的虚拟机。

  2. 登录系统。

  3. Enter the transactional-update shell:

    transactional-update shell
  4. 将以下储存库添加到 openSUSE Leap Micro 6.1 服务器:

    zypper ar https://download.opensuse.org/repositories/systemsmanagement:/Uyuni:/Stable/images/repo/Uyuni-Server-POOL-$(arch)-Media1/ uyuni-server-stable
  5. 刷新储存库列表并接受密钥:

    zypper ref
  6. 安装容器工具:

    zypper in mgradm mgrctl mgradm-bash-completion mgrctl-bash-completion uyuni-storage-setup-server
  7. 退出事务外壳:

    transactional update # exit
  8. 重引导主机。

有关 Uyuni 容器实用程序的详细信息,请参见 Uyuni 容器实用程序

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

This step is optional. However, if custom persistent storage is required for your infrastructure, use 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>]

6. 例如:

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

[NOTE]
====
This command will create the persistent storage volumes at `/var/lib/containers/storage/volumes`.

有关详细信息,请参见 xref:installation-and-upgrade:container-management/persistent-container-volumes.adoc[]。
====


== 使用 Podman 部署 Uyuni 容器

=== `mgradm` Overview

{productname} is deployed as a container using the `mgradm` tool. There are two methods of deploying a {productname} server as a container. In this section we will focus on basic container deployment.

有关使用自定义配置文件进行部署的信息,请参见 xref:installation-and-upgrade:container-management/mgradm-yaml-custom-configuration.adoc[]。

For additional information, you can explore further by running `mgradm --help` from the command line.

:leveloffset: +2

[NOTE]
====
{productname} 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`.

例如:

[source, shell]

export TMPDIR=/path/to/other/tmp

在 {productname} 的后续更新中,相关工具将进行优化,届时无需再使用此临时解决方案。
====

:leveloffset!:


.过程:使用 Podman 部署 Uyuni 容器
. 在终端中以 sudo 或 root 用户身份运行以下命令。
+
[source, shell]

sudo mgradm install podman

+
[IMPORTANT]
====
必须以 sudo 或 root 用户身份部署容器。如果您遗漏此步骤,终端中将显示以下错误。

[source, shell]

INF 正在设置 uyuni 网络 9:58AM INF 正在启用系统服务 9:58AM FTL 无法打开 /etc/systemd/system/uyuni-server.service 进行写入,error="open /etc/systemd/system/uyuni-server.service: permission denied"

====

. 等待部署完成。
. 打开浏览器并访问您的服务器 FQDN。

//In this section you learned how to deploy an {productname} Server container.



=== 永久性卷

许多用户希望指定其永久性卷的位置。

[NOTE]
====
If you are just testing out {productname} you do not need to specify these volumes. `mgradm` will setup the correct volumes by default.

通常只需为较大规模的生产部署指定卷位置。
====

By default `podman` stores its volumes in `/var/lib/containers/storage/volumes/`.

You can provide custom storage for the volumes by mounting disks on this path or the expected volume path inside it such as: `/var/lib/containers/storage/volumes/var-spacewalk`. This is especially important for the database and package mirrors.

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

* xref:installation-and-upgrade:container-management/persistent-container-volumes.adoc[]
* xref:administration:troubleshooting/tshoot-container-full-disk.adoc[]