第5章 Importing Red Hat Content

このセクションでは、Satellite の製品とリポジトリーを使用する方法、Satellite コンテンツが Red Hat コンテンツ配信ネットワーク (CDN) のコンテンツに合わせて最新の状態に保たれるように、同期プランを作成する方法を説明します。

5.1. Products in Red Hat Satellite

Satellite では、製品 は複数のリポジトリーをグループ化する組織単位です。たとえば、Satellite では、Red Hat Enterprise Linux Server は 製品で、この製品のリポジトリーは、さまざまなバージョン、アーキテクチャー、アドオンで構成されます。製品を使用すると、相互に依存関係にあるリポジトリーが、まとめて同期されます。Red Hat リポジトリーの場合は、製品は、リポジトリーを有効にした後に自動的に作成されます。

5.2. Content Synchronization Overview

Satellite Server synchronizes its own repositories with the repositories on the Red Hat CDN. This ensures that Satellite Server retains an exact copy of Red Hat’s repositories. Satellite Server fetches this repository information and stores it on Satellite Server’s file system. After an initial synchronization, you can create a synchronization plan that checks to ensure the repositories are up to date with the CDN’s repositories.

ISO イメージを使用して最初の同期を実行できます。コンテンツ ISO の使用の詳細は、付録C Importing Content ISOs into a Connected Satelliteを参照してください。

5.3. Disabling the Global HTTP Proxy

設定されたプロキシーを使用せずにローカルリポジトリーを同期する場合には、satellite-installer ツールの実行時に設定されるグローバルプロキシーを無視できます。

Procedure

To ignore the global HTTP proxy, complete the following steps:

  1. In the Satellite web UI, navigate to Content > Products and select the product that you want to change.
  2. リポジトリー タブをクリックして、変更するリポジトリーを選択します。
  3. 同期設定 エリアで、グローバル HTTP Capsule を無視 に移動します。編集アイコンをクリックし、チェックボックスを選択して、保存 をクリックします。

CLI をご利用の場合

# hammer repository update --id Repository_ID --ignore-global-proxy yes

5.4. Download Policies Overview

Red Hat Satellite には、コンテンツメタデータのみをダウンロードし、実際のコンテンツのダウンロードは後で行うなど、RPM コンテンツの同期に関する複数のダウンロードポリシーが含まれています。

Satellite Server has the following policies:

Immediate
Satellite Server downloads all metadata and packages during synchronization.
On Demand
Satellite Server は同期時にメタデータのみをダウンロードし、Capsule、または直接接続されているクライアントが要求した場合に限り、ファイルシステムにパッケージを取得して保存します。Capsule の対応のリポジトリーを 即時 に設定した場合には、Satellite Server が強制的に全パッケージをダウンロードするため、この設定は効果がありません。
Background
Satellite Server creates a background task to download all packages after the initial synchronization.

オンデマンド背景 のポリシーは、コンテンツの同期時間を短縮するので、遅延同期 機能として動作します。遅延同期機能は yum リポジトリーにのみ使用してください。通常と同じように、コンテンツビューにパッケージを追加し、通常通りにライフサイクル環境にプロモートすることができます。

Capsule Server offers the following policies:

Immediate
Capsule Server downloads all metadata and packages during synchronization. Do not use this setting if the corresponding repository on Satellite Server is set to On Demand as Satellite Server is forced to download all the packages.
On Demand
Capsule Server は、同期時にメタデータのみをダウンロードします。Capsule Server は、直接接続されたクライアントから要求されると、ファイルシステムだけにパッケージを取得して保存します。オンデマンド ダウンロードポリシーを使用すると、Capsule Server でコンテンツを入手できない場合には、コンテンツが Satellite Server からダウンロードされます。
Background
Capsule Server creates a background task to download all packages after the initial synchronization.
Inherit
Capsule Server inherits the download policy for the repository from the corresponding repository on Satellite Server.

These policies are not available if a Capsule was installed or updated with --enable-foreman-proxy-plugin-pulp set to false.

5.5. Changing the Default Download Policy

Satellite が全組織に作成した新規リポジトリーに対して適用するデフォルトのダウンロードポリシーを設定できます。デフォルト値を変更しても、既存の設定は変更されません。

Procedure

To change the default download policy for repositories, complete the following steps:

  1. In the Satellite web UI, navigate to Administer > Settings.
  2. コンテンツ タブをクリックし、デフォルトのリポジトリーダウンロードポリシー を見つけます。
  3. フィールドで、編集アイコンをクリックします。
  4. 必要なダウンロードポリシーを選択し、保存 をクリックします。

For CLI Users

デフォルトのダウンロードポリシーをimmediateon_demandbackground の 1 つに変更するには、以下のコマンドを入力します。

# hammer settings set \
--name default_download_policy \
--value immediate

5.6. Changing the Download Policy for a Repository

You can also set the download policy for a repository.

Procedure

To set the download policy for a repository, complete the following steps:

  1. In the web UI, navigate to Content > Products, and click the required product name.
  2. リポジトリー タブで必要なリポジトリー名をクリックし、ポリシーのダウンロード フィールドを見つけて、編集アイコンをクリックします。
  3. リストから、必要なダウンロードポリシーを選択して、保存 をクリックします。

For CLI Users

  1. List the repositories for an organization:

    # hammer repository list \
    --organization-label organization-label
  2. リポジトリーのダウンロードポリシーを immediateon_demandbackground の 1 つに変更します。

    # hammer repository update \
    --organization-label organization-label  \
    --product "Red Hat Enterprise Linux Server" \
    --name "Red Hat Enterprise Linux 7 Server Kickstart x86_64 7.5"  \
    --download-policy immediate

5.7. Selecting Red Hat Repositories to Synchronize

To select the repositories to synchronize, you must first identify the product that contains the repository, and then enable that repository based on the relevant release version and base architecture. For Red Hat Enterprise Linux 8, you must enable both AppStream and BaseOS repositories.

Disconnected Satellite

非接続の Satellite Server を使用している場合は、コンテンツを同期する前に Red Hat Satellite 用のコンテンツ ISO をインポートし、Satellite Server 上で CDN URL を変更する必要があります。詳細は 付録B Importing Content ISOs into a Disconnected Satelliteを参照してください。

For Red Hat Enterprise Linux 8

To add the AppStream and BaseOS repositories that you require for Red Hat Enterprise Linux 8, complete the following steps:

  1. In the Satellite web UI, navigate to Content > Red Hat Repositories.
  2. 製品別のフィルター 一覧から Red Hat Enterprise Linux x86_64 を選択します。
  3. 結果の一覧をフィルタリングするには、検索 フィールドを使用して名前別にフィルタリングするか、推奨のリポジトリー ボタンをオンの位置に切り替えます。
  4. 利用可能なリポジトリーペインで、Red Hat Enterprise Linux 8 for x86_64 - AppStream (RPMS)Red Hat Enterprise Linux 8 for x86_64 - BaseOS (RPMs) を展開します。
  5. x86_64 8 エントリーの横にある 有効化 アイコンをクリックして、リポジトリーを有効にします。
  6. コンテンツ > 同期の状態 に移動して、Red Hat Enterprise Linux 8 リポジトリーを選択し、今すぐ同期 をクリックします。

Viewing Red Hat Enterprise Linux 8 Modules

When you synchronize Red Hat Enterprise Linux 8 repositories to Satellite, you can view the module streams that are associated with the repositories.

To view the module streams for a repository, complete the following steps:

  1. In the Satellite web UI, navigate to Content > Products, and select the product that contains the repository you want to view.
  2. リポジトリーの コンテンツ 列で、58 モジュールストリーム など、モジュールストリーム の数をクリックします。
  3. To view information about a specific module stream, click the module.

For Red Hat Enterprise Linux 7

To add repositories, complete the following steps:

  1. In the Satellite web UI, navigate to Content > Red Hat Repositories.
  2. Red Hat Enterprise Linux 7 Server (RPMs) リポジトリーを検索するには、リポジトリー名を入力するか、推奨のリポジトリー ボタンをオンの位置に切り替えて、必要なリポジトリーの一覧を表示します。
  3. In the Available Repositories pane, click the Red Hat Enterprise Linux 7 Server (RPMs) to expand the repository set.
  4. x86_64 7Server エントリーの場合は、有効化 アイコンをクリックしてリポジトリーを有効にします。これにより、Red Hat Enterprise Linux 7 の最新の RPM ファイルが有効になります。

Repository Versioning

Red Hat Enterprise Linux オペレーティングシステムに 7 Server リポジトリーと、7.X リポジトリーを関連付けることの相違点は、7 Server リポジトリーには最新アップデートがすべて含まれますが、Red Hat Enterprise Linux 7.X リポジトリーは次のマイナーバージョンリリース以降のアップデートを取得しなくなる点です。キックスタートリポジトリーにはマイナーバージョンのみが含まれることに注意してください。

For CLI Users

  1. To search for your product, enter the following command:

    # hammer product list --organization "My_Organization"
  2. List the repository set for the product:

    # hammer repository-set list \
    --product "Red Hat Enterprise Linux Server" \
    --organization "My_Organization"
  3. 名前または ID 番号のいずれかを使用してリポジトリーを有効にします。リリースバージョンに 7Server、基本アーキテクチャーに x86_64 のように含めます。例を示します。

    # hammer repository-set enable \
    --name "Red Hat Enterprise Linux 7 Server (RPMs)" \
    --releasever "7Server" \
    --basearch "x86_64" \
    --product "Red Hat Enterprise Linux Server" \
    --organization "My_Organization"

5.8. Synchronizing Red Hat Repositories

Synchronize the repositories with the Red Hat CDN’s repositories.

For Web UI Users

  1. In the Satellite web UI, navigate to Content > Products and select Red Hat Enterprise Linux Server.
  2. すべてのリポジトリーを選択して 今すぐ同期 をクリックします。

Web UI で同期の進捗状況を表示するには、コンテンツ > 同期の状態 に移動して、対応する製品またはリポジトリーツリーを展開します。

For CLI Users

Synchronize the enabled repositories in the Red Hat Enterprise Linux Server product:

# hammer product synchronize \
--name "Red Hat Enterprise Linux Server" \
--organization "My_Organization"

You can also synchronize each repository individually. List all repositories in the product, then synchronize using the ID number for the corresponding repositories. For example:

# hammer repository list \
--product "Red Hat Enterprise Linux Server" \
--organization "My_Organization"
# hammer repository synchronize \
--name "Red Hat Enterprise Linux 7 Server RPMs x86_64 7Server" \
--product "Red Hat Enterprise Linux Server" \
--organization "My_Organization"

The synchronization duration depends on the size of each repository and the speed of your network connection. The following table provides estimates of how long it would take to synchronize content, depending on the available Internet bandwidth:

 Single Package (10Mb)Minor Release (750Mb)Major Release (6Gb)

256 Kbps

5 Mins 27 Secs

6 Hrs 49 Mins 36 Secs

2 Days 7 Hrs 55 Mins

512 Kbps

2 Mins 43.84 Secs

3 Hrs 24 Mins 48 Secs

1 Day 3 Hrs 57 Mins

T1 (1.5 Mbps)

54.33 Secs

1 Hr 7 Mins 54.78 Secs

9 Hrs 16 Mins 20.57 Secs

10 Mbps

8.39 Secs

10 Mins 29.15 Secs

1 Hr 25 Mins 53.96 Secs

100 Mbps

0.84 Secs

1 Min 2.91 Secs

8 Mins 35.4 Secs

1000 Mbps

0.08 Secs

6.29 Secs

51.54 Secs

定期的に更新されるように同期プランを作成します。

Changing a Download Policy

Red Hat リポジトリーのダウンロードポリシーは変更できます。Red Hat Enterprise Linux Server 製品内のリポジトリーを選択し、ダウンロードポリシー フィールドに移動します。CLI を使用している場合は、hammer repository update コマンドに --download-policy オプションを追加して実行します。

5.9. Recovering a Repository

In the case of repository corruption, you can recover it by using an advanced synchronization, which has three options:

Optimized Sync
Synchronizes the repository bypassing RPMs that have no detected differences from the upstream RPMs.
Complete Sync
Synchronizes all RPMs regardless of detected changes. Use this option if specific RPMs could not be downloaded to the local repository even though they exist in the upstream repository.
コンテンツの同期検証

すべての RPM を同期してから、すべての RPM のチェックサムをローカルで検証します。RPM のチェックサムがアップストリームと異なる場合は、RPM をもう一度ダウンロードします。このオプションは yum リポジトリーにのみ該当します。以下のいずれかのエラーが発生した場合に限りこのオプションを使用します。

  • Specific RPMs cause a 404 error while synchronizing with yum.
  • Package does not match intended download error, which means that specific RPMs are corrupted.

Procedure

To synchronize a specific repository with an advanced option, complete the following steps:

  1. Satellite Web UI で、コンテンツ > 製品に移動します。
  2. Select the product containing the corrupted repository.
  3. Select the name of a repository you want to synchronize.
  4. From the Select Action menu, select Advanced Sync.
  5. オプションを選択し、同期をクリックします。

CLI をご利用の場合

  1. Obtain a list of repository IDs:

    # hammer repository list --organization "My_Organization"
  2. Synchronize a corrupted repository using the necessary option:

    • For the optimized synchronization:

      # hammer repository synchronize --incremental true --id 1
    • For the complete synchronization:

      # hammer repository synchronize --skip-metadata-check true --id 1
    • For the validate content synchronization:

      # hammer repository synchronize --validate-contents true --id 1

5.10. Limiting Synchronization Speed

同期の速度を制限して、利用可能な帯域幅の枯渇や、その他のパフォーマンスの問題を回避できます。これには、PULP_CONCURRENCY パラメーターおよび max_speed パラメーターを設定します。この設定はアップグレード時に上書きされる点に注意してください。アップグレード前に、変更したファイルをバックアップし、設定を復元できるようにしてください。

  1. To control the number of synchronization jobs that run in parallel, configure the PULP_CONCURRENCY parameter in the /etc/default/pulp_workers file. For example, to set the number of jobs that run in parallel to 1, change PULP_CONCURRENCY to 1:

    PULP_CONCURRENCY=1

    By default, on a system with less than 8 CPUs, PULP_CONCURRENCY is set to the number of CPUs. On a system with more than 8 CPUs, it is set to 8.

  2. 同期するネットワークの最大速度 (バイト毎秒) を設定するには、max_speed パラメーターを設定します。このパラメーターは、/etc/pulp/server/plugins.conf.d/ ディレクトリーで、インポーターごとに設定する必要があります。たとえば、RPM コンテンツを同期する最大速度を毎秒 10 バイトに設定するには、/etc/pulp/server/plugins.conf.d/yum_importer.json ファイルの "max_speed" パラメーターを 10 に設定します。

    # cat /etc/pulp/server/plugins.conf.d/yum_importer.json
    {
        "proxy_host": null,
        "proxy_port": null,
        "proxy_username": null,
        "proxy_password": null,
        "max_speed": 10
    }
  3. Verify the syntax of the file after editing:

    # json_verify < /etc/pulp/server/plugins.conf.d/yum_importer.json
    JSON is valid
  4. Restart Satellite services to apply the changes:

    # foreman-maintain service restart

5.11. Creating a Synchronization Plan

A synchronization plan checks and updates the content at a scheduled date and time. In Red Hat Satellite 6, you can create a synchronization plan and assign products to the plan.

Procedure

To create a synchronization plan, complete the following steps:

  1. Satellite Web UI で コンテンツ > 同期プラン に移動して、新規同期プラン をクリックします。
  2. 名前 フィールドに、プランの名前を入力します。
  3. 説明 フィールドに、プランの説明を入力します。
  4. 間隔 の一覧から、プランを実行する間隔を選択します。
  5. 開始日開始時間 のリストから、同期プランの実行を開始する日時を開始します。
  6. 保存をクリックします。
  7. 製品 タブをクリックし、次に 追加 をクリックします。Red Hat Enterprise Linux Server 製品を選択し、選択した項目を追加 をクリックします。

For CLI Users

  1. To create the synchronization plan, enter the following command:

    # hammer sync-plan create \
    --name "Red Hat Products 2" \
    --description "Example Plan for Red Hat Products" \
    --interval daily \
    --sync-date "2016-02-01 01:00:00" \
    --enabled true \
    --organization "My_Organization"
  2. Assign the Red Hat Enterprise Linux Server product to it:

    # hammer product set-sync-plan \
    --name "Red Hat Enterprise Linux Server" \
    --sync-plan "Red Hat Products" \
    --organization "My_Organization"