高可用性 Automation Hub のデプロイ

Red Hat Ansible Automation Platform 2.4

Automation Hub の高可用性デプロイメントによる信頼性とスケーラビリティーの向上

Red Hat Customer Content Services

概要

このガイドでは、Automation Hub の高可用性デプロイメントの要件および手順を概説します。

はじめに

本ガイドでは、Automation Hub の高可用性デプロイメントの要件および手順を概説します。

高可用性 (HA) の設定により、Automation Hub デプロイメントの信頼性およびスケーラビリティーが向上します。

Automation Hub の HA デプロイメントには、ワークロードを分散するロードバランサー (「アクティブ - アクティブ」設定) で同じサービスを同時に実行する複数のノードがあります。この設定により、サービスのダウンタイムを最小限に抑えるための単一障害点がなくなり、ワークロードの要件を満たすためのノードを簡単に追加または削除できます。

このガイドでは、HA Automation Hub アプリケーションスタックのデプロイメントについてのみ説明します。データベースやファイルシステム HA などの他の HA コンポーネントは、このガイドでは扱いません。

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

Red Hat では、コード、ドキュメント、Web プロパティーにおける配慮に欠ける用語の置き換えに取り組んでいます。まずは、マスター (master)、スレーブ (slave)、ブラックリスト (blacklist)、ホワイトリスト (whitelist) の 4 つの用語の置き換えから始めます。この取り組みは膨大な作業を要するため、今後の複数のリリースで段階的に用語の置き換えを実施して参ります。詳細は、Red Hat CTO である Chris Wright のメッセージ をご覧ください。

Red Hat ドキュメントへのフィードバック (英語のみ)

技術的な内容に関するフィードバックをお寄せいただきありがとうございます。皆様のご意見をお待ちしています。コメントの追加、Insights の提供、誤字の修正、および質問を行う必要がある場合は、ドキュメントで直接行うこともできます。

注記

Red Hat アカウントがあり、カスタマーポータルにログインしている必要があります。

カスタマーポータルからドキュメントのフィードバックを送信するには、以下の手順を実施します。

  1. Multi-page HTML 形式を選択します。
  2. ドキュメントの右上にある Feedback ボタンをクリックします。
  3. フィードバックを提供するテキストのセクションを強調表示します。
  4. 強調表示されたテキストの横にある Add Feedback ダイアログをクリックします。
  5. ページの右側のテキストボックスにフィードバックを入力し、Submit をクリックします。

フィードバックを送信すると、自動的に問題の追跡が作成されます。Submit をクリックすると表示されるリンクを開き、問題の監視を開始するか、さらにコメントを追加します。

第1章 高可用性 Automation Hub の要件

高可用性 (HA) Automation Hub をデプロイする前に、環境に共有ファイルシステムがインストールされていること、および該当する場合はネットワークストレージシステムが設定されていることを確認してください。

1.1. 必要な共有ファイルシステム

高可用性 Automation Hub では、お使いの環境に、NFS などの共有ファイルシステムを設定しておく必要があります。Red Hat Ansible Automation Platform インストーラーを実行する前に、共有ファイルシステムのインストールの一部としてクラスター全体に /var/lib/pulp ディレクトリーをインストールしたことを確認します。いずれかのノードで /var/lib/pulp が検出されないと、Red Hat Ansible Automation Platform インストーラーはエラーを返し、高可用性 Automation Hub のセットアップが失敗します。

1.2. ネットワークストレージのインストール要件

Automation Hub ノード自体にネットワークストレージを使用して HA Automation Hub をインストールする場合は、Ansible Automation Platform インストーラーを実行する前に、最初に firewalld をインストールして、共有ストレージシステムで必要なポートを開く必要があります。

以下のコマンドを実行して firewalld をインストールして設定します。

  1. firewalld デーモンをインストールします。

    $ dnf install firewalld
  2. 以下のコマンドを使用して、<service> にネットワークストレージを追加します。

    $ firewall-cmd --permanent --add-service=<service>
    注記

    対応しているサービスの一覧は $ firewall-cmd --get-services コマンドを使用します。

  3. リロードして設定を適用します。

    $ firewall-cmd --reload

第2章 高可用性 Automation Hub のインストール

Ansible Automation Platform インストーラーを、高可用性 (HA) 設定で Automation Hub をインストールするように設定します。マウントポイントを作成し、適切な SELinux コンテキストを Ansible Automation Platform 環境に追加して、SELinux に HA Automation Hub をインストールします。

2.1. 高可用性 Automation Hub のインストール

Ansible Automation Platform インストーラーの inventory ファイルに以下の変更を加え、./setup.sh スクリプトを実行して、高可用性 Automation Hub をインストールします。

データベースホスト IP の指定

automation_pg_host および automation_pg_port インベントリー変数を使用して、データベースホストの IP アドレスを指定します。以下に例を示します。

automationhub_pg_host='192.0.2.10'
automationhub_pg_port='5432'

また、automationhub_pg_host インベントリー変数の値を使用して、database セクションでデータベースホストの IP アドレスを指定します。

[database]
192.0.2.10

クラスター化設定のインスタンスの一覧表示

クラスター化設定をインストールする場合、[automationhub] セクションの localhost ansible_connection=local は、全インスタンスのホスト名または IP アドレスに置き換えます。以下に例を示します。

[automationhub]
automationhub1.testing.ansible.com ansible_user=cloud-user ansible_host=192.0.2.18
automationhub2.testing.ansible.com ansible_user=cloud-user ansible_host=192.0.2.20
automationhub3.testing.ansible.com ansible_user=cloud-user ansible_host=192.0.2.22

Red Hat Single Sign-On の要件

Automation Hub 環境に Red Hat Single Sign-On を実装する場合は、automationhub_main_url インベントリー変数を使用してクライアントが接続するメインの Automation Hub URL を指定します。以下に例を示します。

automationhub_main_url = 'https://automationhub.ansible.com'

インストール後の設定

各 Private Automation Hub サーバーの /etc/pulp/settings.py に以下のディレクティブが存在することを確認します。

USE_X_FORWARDED_PORT = True
USE_X_FORWARDED_HOST = True
注記

automationhub_main_url を指定しないと、[automationhub] グループの最初のノードがデフォルトで使用されます。

2.2. SELinux への Automation Hub の高可用性 (HA) デプロイメントのインストール

SELinux で Automation Hub の高可用性 (HA) デプロイメントをセットアップするには、/var/lib/pulp/var/lib/pulp/pullpcore_static に 2 つのマウントポイントを作成し、それぞれに適切な SELinux コンテキストを割り当てます。/var/lib/pulp/pulpcore_static のコンテキストを追加し、Ansible Automation Platform インストーラーを実行してから、/var/lib/pulp のコンテキストを追加する必要があります。

前提条件

  • サーバーに NFS エクスポートを設定している。

インストール前の手順

  1. /var/lib/pulp にマウントポイントを作成します。

    $ mkdir /var/lib/pulp/
  2. テキストエディターを使用して /etc/fstab を開き、次の値を追加します。

    srv_rhel8:/data /var/lib/pulp nfs defaults,_netdev,nosharecache 0 0
    srv_rhel8:/data/pulpcore_static /var/lib/pulp/pulpcore_static nfs defaults,_netdev,nosharecache,context="system_u:object_r:httpd_sys_content_rw_t:s0" 0 0
  3. 以下のコマンドを実行します。

    $ systemctl daemon-reload
  4. /var/lib/pulp のマウントコマンドを実行します。

    $ mount /var/lib/pulp
  5. /var/lib/pulp/pulpcore_static にマウントポイントを作成します。

    $ mkdir /var/lib/pulp/pulpcore_static
  6. マウントコマンドを実行します。

    $ mount -a
  7. マウントポイントを設定したら、Ansible Automation Platform インストーラーを実行します。

    $ setup.sh -- -b --become-user root

インストールが完了したら、/var/lib/pulp/ マウントポイントをアンマウントして、適切な SELinux コンテキストを適用します。

インストール後の手順

  1. Pulp サービスをシャットダウンします。

    $ systemctl stop pulpcore.service
  2. /var/lib/pulp/pulpcore_static をアンマウントします。

    $ umount /var/lib/pulp/pulpcore_static
  3. /var/lib/pulp/ をアンマウントします。

    $ umount /var/lib/pulp/
  4. テキストエディターで /etc/fstab を開き、/var/lib/pulp の既存値を以下に置き換えます。

    srv_rhel8:/data /var/lib/pulp nfs defaults,_netdev,nosharecache,context="system_u:object_r:pulpcore_var_lib_t:s0" 0 0
  5. マウントコマンドを実行します。

    $ mount -a

pulpcore.service を設定します。

  1. 2 つのマウントポイントを設定したら、Pulp サービスをシャットダウンして pulpcore.service を設定します。

    $ systemctl stop pulpcore.service
  2. systemctl を使用して pulpcore.service を編集します。

    $ systemctl edit pulpcore.service
  3. 以下のエントリーを pulpcore.service に追加し、ネットワークを起動し、リモートマウントポイントをマウントすることで、Automation Hub サービスが起動するようにします。

    [Unit]
    After=network.target var-lib-pulp.mount
  4. remote-fs.target を有効にします。

    $ systemctl enable remote-fs.target
  5. システムを再起動します。

    $ systemctl reboot

トラブルシューティング

pulpcore SELinux ポリシーのバグにより、etc/pulp/certs/ のトークン認証公開鍵/秘密鍵に適切な SELinux ラベルがなく、パルププロセスが失敗する可能性があります。これが発生した場合は、次のコマンドを実行して、適切なラベルを一時的に貼り付けます。

$ chcon system_u:object_r:pulpcore_etc_t:s0 /etc/pulp/certs/token_{private,public}_key.pem
注記

システムにラベルを付け直すたびに、このコマンドを繰り返して適切な SELinux ラベルを付け直す必要があります。

関連情報

法律上の通知

Copyright © 2023 Red Hat, Inc.
The text of and illustrations in this document are licensed by Red Hat under a Creative Commons Attribution–Share Alike 3.0 Unported license ("CC-BY-SA"). An explanation of CC-BY-SA is available at http://creativecommons.org/licenses/by-sa/3.0/. In accordance with CC-BY-SA, if you distribute this document or an adaptation of it, you must provide the URL for the original version.
Red Hat, as the licensor of this document, waives the right to enforce, and agrees not to assert, Section 4d of CC-BY-SA to the fullest extent permitted by applicable law.
Red Hat, Red Hat Enterprise Linux, the Shadowman logo, the Red Hat logo, JBoss, OpenShift, Fedora, the Infinity logo, and RHCE are trademarks of Red Hat, Inc., registered in the United States and other countries.
Linux® is the registered trademark of Linus Torvalds in the United States and other countries.
Java® is a registered trademark of Oracle and/or its affiliates.
XFS® is a trademark of Silicon Graphics International Corp. or its subsidiaries in the United States and/or other countries.
MySQL® is a registered trademark of MySQL AB in the United States, the European Union and other countries.
Node.js® is an official trademark of Joyent. Red Hat is not formally related to or endorsed by the official Joyent Node.js open source or commercial project.
The OpenStack® Word Mark and OpenStack logo are either registered trademarks/service marks or trademarks/service marks of the OpenStack Foundation, in the United States and other countries and are used with the OpenStack Foundation's permission. We are not affiliated with, endorsed or sponsored by the OpenStack Foundation, or the OpenStack community.
All other trademarks are the property of their respective owners.