検索

11.3. 集中型 OSTree ミラーの管理

download PDF

実稼働環境の場合、すべてのコミットを提供する集中型 OSTree ミラーを用意すると、次のようないくつかの利点があります。

  • ディスクストレージの重複排除および最小化
  • static delta 更新を使用した、クライアントの更新の最適化
  • デプロイメント期間中に単一の OSTree ミラーを参照

集中型 OSTree ミラーを管理するには、各コミットを RHEL Image Builder から集中型リポジトリーにプルして、そこからコミットをユーザーに提供する必要があります。

注記

osbuild.infra Ansible コレクションを使用して、OSTree ミラーの管理を自動化することもできます。osbuild.infra Ansible を参照してください。

集中型リポジトリーを作成するために、Web サーバー上で次のコマンドを直接実行できます。

手順

  1. 空のブループリントを作成し、"rhel-93" をディストリビューションとして使用するようにカスタマイズします。

    name = "minimal-rhel94"
    description = "minimal blueprint for ostree commit"
    version = "1.0.0"
    modules = []
    groups = []
    distro = "rhel-94"
  2. ブループリントをサーバーにプッシュします。

    # composer-cli blueprints push minimal-rhel94.toml
  3. 作成したブループリントから RHEL for Edge Commit (.tar) イメージをビルドします。

    # composer-cli compose start-ostree minimal-rhel94 edge-commit
  4. .tar ファイルを取得し、ディスクに解凍します。

    # composer-cli compose image _<rhel-94-uuid>
    $ tar -xf <rhel-94-uuid>.tar -C /usr/share/nginx/html/

    ディスク上の /usr/share/nginx/html/repo が、すべての ref とコミットの一元的な OSTree リポジトリーになります。

  5. 別の空のブループリントを作成し、"rhel-89" をディストリビューションとして使用するようにカスタマイズします。

    name = "minimal-rhel810"
    description = "minimal blueprint for ostree commit"
    version = "1.0.0"
    modules = []
    groups = []
    distro = "rhel-810"
  6. ブループリントをプッシュし、別の RHEL for Edge Commit (.tar) イメージを作成します。
# *composer-cli blueprints push minimal-rhel810.toml*
# *composer-cli compose start-ostree minimal-rhel810 edge-commit*
  1. .tar ファイルを取得し、ディスクに解凍します。

    # composer-cli compose image <rhel-810-uuid>
    $ tar -xf <rhel-810-uuid>.tar
  2. コミットをローカルリポジトリーにプルします。ostree pull-local を使用すると、あるローカルリポジトリーから別のローカルリポジトリーにコミットデータをコピーできます。

    # ostree --repo=/usr/share/nginx/html/repo pull-local repo
  3. オプション: OSTree リポジトリーのステータスを検査します。出力例を以下に示します。

    $ ostree --repo=/usr/share/nginx/html/repo refs
    
    rhel/8/x86_64/edge
    rhel/9/x86_64/edge
    
    $ ostree --repo=/usr/share/nginx/html/repo show rhel/8/x86_64/edge
    commit f7d4d95465fbd875f6358141f39d0c573df6a321627bafde68c73850667e5443
    ContentChecksum:  41bf2f8b442a770e9bf03e096a46a286f5836e0a0702b7c3516ef4e0acec2dea
    Date:  2023-09-15 16:17:04 +0000
    Version: 8.10
    (no subject)
    
    $ ostree --repo=/usr/share/nginx/html/repo show rhel/9/x86_64/edge
    commit 89290dbfd6f749700c77cbc434c121432defb0c1c367532368eee170d9e53ea9
    ContentChecksum:  70235bfb9cae82c53f856183750e809becf0b9b076122b19c40fec92fc6d74c1
    Date:  2023-09-15 15:30:24 +0000
    Version: 9.4
    (no subject)
  4. RHEL 9.3 ブループリントを更新して新しいパッケージを追加し、新しいコミットをビルドします。以下に例を示します。

    name = "minimal-rhel94"
    description = "minimal blueprint for ostree commit"
    version = "1.1.0"
    modules = []
    groups = []
    distro = "rhel-94"
    
    [[packages]]
    name = "strace"
    version = "*"
  5. 更新されたブループリントをプッシュし、新しい RHEL for Edge Commit (.tar) イメージを作成します。compose が既存の OSTree リポジトリーを参照するようにします。

    # composer-cli blueprints push minimal-rhel94.toml
    # composer-cli compose start-ostree minimal-rhel94 edge-commit --url http://localhost/repo --ref rhel/9/x86_64/edge
  6. .tar ファイルを取得し、ディスクに解凍します。

    # rm -rf repo
    # composer-cli compose image <rhel-94-uuid>
    # tar -xf <rhel-94-uuid>.tar
  7. コミットをリポジトリーにプルします。

    # ostree --repo=/usr/share/nginx/html/repo pull-local repo
  8. オプション: OSTree リポジトリーのステータスを再度検査します。

    $ ostree --repo=/usr/share/nginx/html/repo refs
    rhel/8/x86_64/edge
    rhel/9/x86_64/edge
    
    $ ostree --repo=/usr/share/nginx/html/repo show rhel/8/x86_64/edge
    commit f7d4d95465fbd875f6358141f39d0c573df6a321627bafde68c73850667e5443
    ContentChecksum:  41bf2f8b442a770e9bf03e096a46a286f5836e0a0702b7c3516ef4e0acec2dea
    Date:  2023-09-15 16:17:04 +0000
    Version: 8.10
    (no subject)
    
    $ ostree --repo=/usr/share/nginx/html/repo show rhel/9/x86_64/edge
    commit a35c3b1a9e731622f32396bb1aa84c73b16bd9b9b423e09d72efaca11b0411c9
    Parent:  89290dbfd6f749700c77cbc434c121432defb0c1c367532368eee170d9e53ea9
    ContentChecksum:  2335930df6551bf7808e49f8b35c45e3aa2a11a6c84d988623fd3f36df42a1f1
    Date:  2023-09-15 18:21:31 +0000
    Version: 9.4
    (no subject)
    
    $ ostree --repo=/usr/share/nginx/html/repo log rhel/9/x86_64/edge
    commit a35c3b1a9e731622f32396bb1aa84c73b16bd9b9b423e09d72efaca11b0411c9
    Parent:  89290dbfd6f749700c77cbc434c121432defb0c1c367532368eee170d9e53ea9
    ContentChecksum:  2335930df6551bf7808e49f8b35c45e3aa2a11a6c84d988623fd3f36df42a1f1
    Date:  2023-09-15 18:21:31 +0000
    Version: 9.4
    (no subject)
    
    commit 89290dbfd6f749700c77cbc434c121432defb0c1c367532368eee170d9e53ea9
    ContentChecksum:  70235bfb9cae82c53f856183750e809becf0b9b076122b19c40fec92fc6d74c1
    Date:  2023-09-15 15:30:24 +0000
    Version: 9.4
    (no subject)
    
    $ rpm-ostree db diff --repo=/usr/share/nginx/html/repo 89290dbfd6f749700c77cbc434c121432defb0c1c367532368eee170d9e53ea9 a35c3b1a9e731622f32396bb1aa84c73b16bd9b9b423e09d72efaca11b0411c9
    ostree diff commit from: 89290dbfd6f749700c77cbc434c121432defb0c1c367532368eee170d9e53ea9
    ostree diff commit to:   a35c3b1a9e731622f32396bb1aa84c73b16bd9b9b423e09d72efaca11b0411c9
    Added:
      elfutils-default-yama-scope-0.188-3.el9.noarch
      elfutils-libs-0.188-3.el9.x86_64
      strace-5.18-2.el9.x86_64
Red Hat logoGithubRedditYoutubeTwitter

詳細情報

試用、購入および販売

コミュニティー

Red Hat ドキュメントについて

Red Hat をお使いのお客様が、信頼できるコンテンツが含まれている製品やサービスを活用することで、イノベーションを行い、目標を達成できるようにします。

多様性を受け入れるオープンソースの強化

Red Hat では、コード、ドキュメント、Web プロパティーにおける配慮に欠ける用語の置き換えに取り組んでいます。このような変更は、段階的に実施される予定です。詳細情報: Red Hat ブログ.

会社概要

Red Hat は、企業がコアとなるデータセンターからネットワークエッジに至るまで、各種プラットフォームや環境全体で作業を簡素化できるように、強化されたソリューションを提供しています。

© 2024 Red Hat, Inc.