引导储存库

引导储存库包含引导期间注册客户端所需的软件包。同步产品时,会自动在 SUSE Multi-Linux Manager 服务器上创建及重新生成引导储存库。

1. 准备创建引导储存库

如果您选择某个产品以进行同步,当所有必需的通道都完全镜像后,会立即自动创建引导储存库。

过程:通过 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. 每个子通道在同步过程中会生成自身的日志。您需要检查所有基础通道和子通道日志文件,以确保同步完成。

2. 自动模式的选项

您可以更改自动引导储存库的创建方式。本节介绍了各种相应设置。

刷新模式

By default, existing repositories are updated only with the latest packages. You can configure it to always start with an empty repository instead. To enable this behavior, add or edit this value in /etc/rhn/rhn.conf:

server.susemanager.bootstrap_repo_flush = 1
自动模式

By default, automated regeneration of the bootstrap repositories is enabled. To disable it, add or edit this value in /etc/rhn/rhn.conf:

server.susemanager.auto_generate_bootstrap_repo = 0

2.1. 配置引导数据文件

The tool uses a data file with information about which packages are required for each distribution. The data file is stored at /usr/share/susemanager/mgr_bootstrap_data.py. SUSE updates this file regularly. If you want to makes changes to this file, do not edit it directly. Instead, create a copy in persistent directory and edit your copy:

cp /usr/share/susemanager/mgr_bootstrap_data.py /srv/susemanager/my_data.py

When you have made your changes, configure SUSE Multi-Linux Manager to use the new file. Add or edit this value in /etc/rhn/rhn.conf:

server.susemanager.bootstrap_repo_datamodule = my_data

下次更新时,SUSE 提供的新数据将重写原来的数据文件,而不是这个新文件。您需要在新文件中使用 SUSE 提供的更改覆盖相应内容,以使其保持最新。

3. 手动生成引导储存库

默认情况下,每天都会重新生成引导储存库。您可以在命令提示符处手动创建引导储存库。

过程:生成 SUSE Linux Enterprise 的引导储存库
  1. 在 SUSE Multi-Linux Manager 服务器上的命令提示符处,以 root 身份列出要为其创建引导储存库的可用发行套件:

    mgr-create-bootstrap-repo -l
  2. 创建引导储存库,并使用适当的储存库名称作为产品标签:

    mgr-create-bootstrap-repo -c SLE-version-x86_64
  3. 或者,使用可用发行套件列表中发行套件名称旁边显示的编号。

The client repository is located in /srv/www/htdocs/pub/repositories/.

如果您镜像了多个产品(例如 SLES 和 SLES for SAP),或者您使用的是自定义通道,在创建引导储存库时将需要指定要使用的父通道。并不是在所有情况下都需要如此。例如,部分 SLES 15 版本使用共同的代码库,因此无需指定父通道。只有您的环境需要时,才需使用此过程。

可选过程:指定引导储存库的父通道
  1. 检查您有哪些父通道可用:

    mgr-create-bootstrap-repo -c SLE-15-x86_64
    找到多个父通道选项。请使用
    --with-parent-channel <label> 选项并选择以下其中一个父通道:
    - sle-product-sles15-pool-x86_64
    - sle-product-sles_sap15-pool-x86_64
    - sle-product-sled15-pool-x86_64
  2. 指定适当的父通道:

    mgr-create-bootstrap-repo -c SLE-15-x86_64 --with-parent-channel sle-product-sled15-pool-x86_64

3.1. 支持多个体系结构的储存库

If you are creating bootstrap repositories that include multiple different architectures, you need to be careful that all architectures are updated correctly. For example, the x86-64 and IBM Z architectures for SLE use the same bootstrap repository URL at /srv/www/htdocs/pub/repositories/sle/15/2/bootstrap/.

When the flush option is enabled, and you attempt to generate the bootstrap repository for multiple architectures, only one architecture is generated. To avoid this, use the --no-flush option at the command prompt when creating additional architectures. For example:

mgr-create-bootstrap-repo -c SLE-15-SP2-x86_64
mgr-create-bootstrap-repo --no-flush -c SLE-15-SP2-s390x

4. 引导和自定义通道

If you are using custom channels, you can use the --with-custom-channels option with the mgr-create-bootstrap-repo command. In this case, you also need to specify the parent channel to use.

如果您使用自定义通道,则自动创建引导储存库可能会失败。在这种情况下,您需要手动创建储存库。

有关自定义通道的详细信息,请参见 自定义通道