ロードバランサーを使用した Capsule の設定
Capsule Server 間での負荷分散
概要
Red Hat ドキュメントへのフィードバック (英語のみ) リンクのコピーリンクがクリップボードにコピーされました!
Red Hat ドキュメントに対するご意見をお聞かせください。ドキュメントの改善点があればお知らせください。
Bugzilla でチケットを作成することでフィードバックを送信できます。
- Bugzilla のWeb サイトに移動します。
-
Component フィールドで、
Documentationを使用します。 - Description フィールドに、ドキュメントの改善に関するご意見を記入してください。ドキュメントの該当部分へのリンクも追加してください。
- Submit Bug をクリックします。
第1章 ロードバランシングソリューションのアーキテクチャー リンクのコピーリンクがクリップボードにコピーされました!
Satellite Server がロードバランサーを使用して複数の Capsule Server 間でクライアント要求とネットワーク負荷を分散するように設定できます。このように設定すると、Capsule Server の全体的なパフォーマンスが向上します。
本書では、ロードバランシングを使用できるように Satellite Server と Capsule Server を準備する方法を概説し、負荷分散型のセットアップで、クライアントを登録する方法やロードバランサーを設定する方法についてガイドラインを提供します。
負荷分散の設定は、以下のコンポーネントで設定されます。
- Satellite Server
- Capsule Server 2 台以上
- ロードバランサー 1 つ
- クライアント複数台
図1.1 Satellite ロードバランシングソリューションのアーキテクチャー
負荷分散型の設定では、予定されたメンテナンスや予定外のメンテナンスで、Capsule Server が 1 台停止しても、ほぼすべての Capsule 機能は想定どおりに動作し続けます。ロードバランサーは、以下のサービスおよび機能と連携します。
-
subscription-managerでの登録 -
yumリポジトリーでのコンテンツ管理 - オプション: Puppet
負荷分散の設定では、ロードバランサーは上記のサービスと機能に対してのみ負荷を分散します。プロビジョニングや virt-who などの他のサービスが個別の Capsule で実行されている場合は、ロードバランサーではなく Capsule から直接アクセスする必要があります。
Puppet の制限の管理
Puppet 認証局 (CA) の管理では、負荷分散型の設定における証明書署名をサポートしていません。Puppet CA では、シリアル番号カウンターや CRL などの証明書情報がファイルシステムに保存されます。複数の書き込みプロセスで同一のデータを使用しようとすると、データが破損する可能性があります。
Puppet のこの制限を管理するには、次の手順を実行します。
- Capsule Server 1 台 (通常、ロードバランシング用に Capsule Server を設定する最初のシステム) に Puppet 証明書署名を設定します。
- ロードバランサー上のポート 8141 に CA 要求を送信するようにクライアントを設定します。
- Puppet 証明書に署名するために Capsule Server を設定したシステムで、ポート 8141 からポート 8140 に CA 要求をリダイレクトするようにロードバランサーを設定します。
第2章 ロードバランシングに関する考慮事項 リンクのコピーリンクがクリップボードにコピーされました!
複数の Capsule Server 間で負荷を分散すると、1 つの Capsule が単一障害点になることを防ぎます。ロードバランサーを使用するように Capsule を設定すると、予定および予定外のシステム停止に適応できるので、可用性および応答性が向上します。
ロードバランシングを設定する場合は、次のガイドラインを考慮します。
- Puppet を使用する場合、Puppet 証明書署名は、設定する最初の Capsule に割り当てられます。最初の Capsule が停止していると、クライアントは Puppet コンテンツを取得できません。
- このソリューションでは、すべての Capsule で 1 つの状態を維持するために Pacemaker または他の同様の HA ツールを使用しません。問題をトラブルシュートするには、ロードバランサーを使用せずに Capsule ごとに問題を再現します。
ロードバランシングに必要な追加メンテナンス
ロードバランサーを使用するように Capsule を設定すると、環境が複雑になり、新たなメンテナンスが必要になります。
ロードバランシングには、次の追加手順が必要です。
- すべての Capsule に同じコンテンツビューがあることを確認し、すべての Capsule を同一のコンテンツビューバージョンに同期する必要があります。
- 各 Capsule を順にアップグレードする必要があります。
- 設定した Capsule ごとに定期的にバックアップする必要があります。
ロードバランシング設定の Capsule Server のアップグレード
Capsule Servers 6.10 から 6.11 にアップグレードするには、Red Hat Satellite のアップグレードおよび更新 の Capsule Serverのアップグレード の手順を実行します。ロードバランシング設定の Capsule Server では、他に必要な手順はありません。
第3章 Capsule Server のロードバランシング用の設定における要件 リンクのコピーリンクがクリップボードにコピーされました!
Capsule Server をロードバランシング用に設定するには、Capsule Server のインストールに記載の以下の手順を実行します。Satellite には、既存の Capsule Server をロードバランシング用に設定するサポートはありません。
第4章 Capsule Server のロードバランシング用の設定 リンクのコピーリンクがクリップボードにコピーされました!
この章では、ロードバランシング用に Capsule Server を設定する方法を概説します。お使いの Satellite Server の設定に合わせて、次のいずれかのセクションに進んでください。
作成する Katello 証明書には、Capsule Server ごとに異なるファイル名を使用します。たとえば、Capsule Server FQDN を使用して証明書アーカイブファイルに名前を付けます。
4.1. デフォルト SSL 証明書を使用する Capsule Server のロードバランシング用の設定 (Puppet を使用しない) リンクのコピーリンクがクリップボードにコピーされました!
次のセクションでは、Puppet を使用せず、デフォルト SSL 証明書を使用する Capsule Server をロードバランシング用に設定する方法を説明します。
この手順は、ロードバランシング用に設定する Capsule Server ごとに実行します。
手順
以下のように、Satellite Server で、Capsule Server の Katello 証明書を生成します。
# capsule-certs-generate \ --foreman-proxy-fqdn capsule.example.com \ --certs-tar "/root/capsule.example.com-certs.tar" \ --foreman-proxy-cname loadbalancer.example.comcapsule-certs-generateコマンドの出力であるsatellite-installerコマンド例のコピーを保持し、Capsule Server 証明書をインストールします。証明書アーカイブファイルを Satellite Server から Capsule Server にコピーします。
# scp /root/capsule.example.com-certs.tar \ root@capsule.example.com:/root/capsule.example.com-certs.tarcapsule-certs-generateコマンドの出力から取得するsatellite-installerコマンドに次のオプションを追加します。--certs-cname "loadbalancer.example.com" \ --enable-foreman-proxy-plugin-remote-execution-ssh以下のように、Capsule Server で、
satellite-installerコマンドを実行します。# satellite-installer --scenario capsule \ --foreman-proxy-register-in-foreman "true" \ --foreman-proxy-foreman-base-url "https://satellite.example.com" \ --foreman-proxy-trusted-hosts "satellite.example.com" \ --foreman-proxy-trusted-hosts "capsule.example.com" \ --foreman-proxy-oauth-consumer-key "oauth key" \ --foreman-proxy-oauth-consumer-secret "oauth secret" \ --certs-tar-file "capsule.example.com-certs.tar" \ --certs-cname "loadbalancer.example.com" \ --enable-foreman-proxy-plugin-remote-execution-ssh
4.2. デフォルト SSL 証明書を使用する Capsule Server のロードバランシング用の設定 (Puppet を使用する) リンクのコピーリンクがクリップボードにコピーされました!
次のセクションでは、Puppet を使用し、デフォルト SSL 証明書を使用する Capsule Server をロードバランシング用に設定する方法を説明します。
Satellite 設定で Puppet を使用する場合は、次の手順を実行する必要があります。
Puppet 証明書を生成して署名するための Capsule Server の設定
この手順は、ロードバランシング用に設定した他の Capsule Server すべてに、Puppet 証明書を生成して署名するように Capsule Server を設定するシステムにのみ、実行してください。この手順の例では、この Capsule Server の FQDN は capsule-ca.example.com です。
Satellite Server で、Puppet 証明書を生成し、署名するように Capsule Server を設定するシステムの Katello 証明書を生成します。
# capsule-certs-generate \ --foreman-proxy-fqdn capsule-ca.example.com \ --certs-tar "/root/capsule-ca.example.com-certs.tar" \ --foreman-proxy-cname loadbalancer.example.comcapsule-certs-generateコマンドの出力であるsatellite-installerコマンド例のコピーを保持し、Capsule Server 証明書をインストールします。証明書アーカイブファイルを Satellite Server から Capsule Server にコピーします。
# scp /root/capsule-ca.example.com-certs.tar \ root@capsule-ca.example.com:capsule-ca.example.com-certs.tarcapsule-certs-generateコマンドの出力から取得するsatellite-installerコマンドに次のオプションを追加します。--certs-cname "loadbalancer.example.com" \ --puppet-dns-alt-names "loadbalancer.example.com" \ --puppet-ca-server "capsule-ca.example.com" \ --foreman-proxy-puppetca "true" \ --puppet-server-ca "true" \ --enable-foreman-proxy-plugin-remote-execution-ssh以下のように、Capsule Server で、
satellite-installerコマンドを実行します。# satellite-installer --scenario capsule \ --foreman-proxy-register-in-foreman "true" \ --foreman-proxy-foreman-base-url "https://satellite.example.com" \ --foreman-proxy-trusted-hosts "satellite.example.com" \ --foreman-proxy-trusted-hosts "capsule-ca.example.com" \ --foreman-proxy-oauth-consumer-key "oauth key" \ --foreman-proxy-oauth-consumer-secret "oauth secret" \ --certs-tar-file "capsule-ca.example.com-certs.tar" \ --puppet-server-foreman-url "https://satellite.example.com" \ --certs-cname "loadbalancer.example.com" \ --puppet-dns-alt-names "loadbalancer.example.com" \ --puppet-ca-server "capsule-ca.example.com" \ --foreman-proxy-puppetca "true" \ --puppet-server-ca "true" \ --enable-foreman-proxy-plugin-remote-execution-script \ --foreman-proxy-content-puppet true \ --enable-puppet \ --puppet-server true \ --puppet-server-foreman-ssl-ca /etc/pki/katello/puppet/puppet_client_ca.crt \ --puppet-server-foreman-ssl-cert /etc/pki/katello/puppet/puppet_client.crt \ --puppet-server-foreman-ssl-key /etc/pki/katello/puppet/puppet_client.keyCapsule Server で、Puppet サーバーを停止します。
# puppet resource service puppetserver ensure=stoppedロードバランシングを設定する他のすべての Capsule Server に対して Puppet 証明書を生成します。ただし、Puppet 証明書署名を設定する最初のシステムを除きます。
# puppetserver ca generate --certname capsule.example.com \ --subject-alt-names loadbalancer.example.com --ca-clientこのコマンドは、Capsule Server が Puppet 証明書に署名するように設定するシステムで、次のファイルを作成します。
-
/etc/puppetlabs/puppet/ssl/certs/ca.pem -
/etc/puppetlabs/puppet/ssl/certs/capsule.example.com.pem -
/etc/puppetlabs/puppet/ssl/private_keys/capsule.example.com.pem -
/etc/puppetlabs/puppet/ssl/public_keys/capsule.example.com.pem
-
Puppet サーバーを再開します。
# puppet resource service puppetserver ensure=running
残りの Capsule Server のロードバランシング用の設定
この手順は、Capsule Server が Puppet 証明書を署名するように設定するシステムを除き、各 Capsule Server で実行します。
Satellite Server で、Capsule Server の Katello 証明書を生成します。
# capsule-certs-generate \ --foreman-proxy-fqdn capsule.example.com \ --certs-tar "/root/capsule.example.com-certs.tar" \ --foreman-proxy-cname loadbalancer.example.comcapsule-certs-generateコマンドの出力であるsatellite-installerコマンド例のコピーを保持し、Capsule Server 証明書をインストールします。証明書アーカイブファイルを Satellite Server から Capsule Server にコピーします。
# scp /root/capsule.example.com-certs.tar \ root@capsule.example.com:/root/capsule.example.com-certs.tarCapsule Server で、
puppetserverパッケージをインストールします。# satellite-maintain packages install puppetserverCapsule Server で、Puppet 証明書用のディレクトリーを作成します。
# mkdir -p /etc/puppetlabs/puppet/ssl/certs/ \ /etc/puppetlabs/puppet/ssl/private_keys/ \ /etc/puppetlabs/puppet/ssl/public_keys/Capsule Server で、Capsule Server を設定するシステムから、対象の Capsule Server の Puppet 証明書をコピーして、Puppet 証明書を署名します。
# scp root@capsule-ca.example.com:/etc/puppetlabs/puppet/ssl/certs/ca.pem \ /etc/puppetlabs/puppet/ssl/certs/ca.pem # scp root@capsule-ca.example.com:/etc/puppetlabs/puppet/ssl/certs/capsule.example.com.pem \ /etc/puppetlabs/puppet/ssl/certs/capsule.example.com.pem # scp root@capsule-ca.example.com:/etc/puppetlabs/puppet/ssl/private_keys/capsule.example.com.pem \ /etc/puppetlabs/puppet/ssl/private_keys/capsule.example.com.pem # scp root@capsule-ca.example.com:/etc/puppetlabs/puppet/ssl/public_keys/capsule.example.com.pem \ /etc/puppetlabs/puppet/ssl/public_keys/capsule.example.com.pemCapsule Server で、ディレクトリーの所有権をユーザー
puppet、グループpuppetに変更し、SELinux コンテキストを設定します。# chown -R puppet:puppet /etc/puppetlabs/puppet/ssl/ # restorecon -Rv /etc/puppetlabs/puppet/ssl/capsule-certs-generateコマンドの出力から取得するsatellite-installerコマンドに次のオプションを追加します。--certs-cname "loadbalancer.example.com" \ --puppet-dns-alt-names "loadbalancer.example.com" \ --puppet-ca-server "capsule-ca.example.com" \ --foreman-proxy-puppetca "false" \ --puppet-server-ca "false" \ --enable-foreman-proxy-plugin-remote-execution-ssh以下のように、Capsule Server で、
satellite-installerコマンドを実行します。# satellite-installer --scenario capsule \ --foreman-proxy-register-in-foreman "true" \ --foreman-proxy-foreman-base-url "https://satellite.example.com" \ --foreman-proxy-trusted-hosts "satellite.example.com" \ --foreman-proxy-trusted-hosts "capsule.example.com" \ --foreman-proxy-oauth-consumer-key "oauth key" \ --foreman-proxy-oauth-consumer-secret "oauth secret" \ --certs-tar-file "capsule.example.com-certs.tar" \ --puppet-server-foreman-url "https://satellite.example.com" \ --certs-cname "loadbalancer.example.com" \ --puppet-dns-alt-names "loadbalancer.example.com" \ --puppet-ca-server "capsule-ca.example.com" \ --foreman-proxy-puppetca "false" \ --puppet-server-ca "false" \ --enable-foreman-proxy-plugin-remote-execution-ssh
4.3. カスタム SSL 証明書を使用する Capsule Server のロードバランシング用の設定 (Puppet を使用しない) リンクのコピーリンクがクリップボードにコピーされました!
次のセクションでは、Puppet を使用せず、カスタム SSL 証明書を使用する Capsule Server をロードバランシング用に設定する方法を説明します。
4.3.1. Capsule Server のカスタム SSL 証明書の作成 リンクのコピーリンクがクリップボードにコピーされました!
以下の手順では、Certificate Signing Request (CSR: 証明書署名要求) の設定ファイルを作成して、Subject Alternative Names (SAN: サブジェクトの別名) としてロードバランサーと Capsule Server を追加する方法を説明します。この手順は、ロードバランシング用に設定する Capsule Server ごとに実行します。
手順
Capsule Server で、すべてのソース証明書ファイルを含むディレクトリーを作成し、
rootユーザーのみがアクセスできるようにします。# mkdir /root/capsule_cert # cd /root/capsule_certCertificate Signing Request (CSR) を署名する秘密鍵を作成します。
秘密鍵は暗号化する必要がないことに注意してください。パスワードで保護された秘密鍵を使用する場合は、秘密鍵のパスワードを削除します。
この Capsule Server の秘密鍵がすでにある場合は、この手順を省略します。
# openssl genrsa -out /root/capsule_cert/capsule_cert_key.pem 4096証明書要求設定ファイルを作成して、次の内容を追加します。
[ req ] default_bits = 4096 distinguished_name = req_distinguished_name req_extensions = req_ext prompt = no [ req_distinguished_name ] countryName=2 Letter Country Code stateOrProvinceName=State or Province Full Name localityName=Locality Name 0.organizationName=Organization Name organizationalUnitName=Capsule Organization Unit Name commonName=capsule.example.com1 emailAddress=Email Address [ req_ext ] #authorityKeyIdentifier=keyid,issuer #basicConstraints=CA:FALSE keyUsage = digitalSignature, nonRepudiation, keyEncipherment, dataEncipherment subjectAltName = @alt_names [alt_names]2 DNS.1 = loadbalancer.example.com DNS.2 = capsule.example.comSAN 証明書の証明書署名要求 (CSR) を作成します。
# openssl req -new \ -key /root/capsule_cert/capsule_cert_key.pem \1 -config SAN_config.cfg \2 -out /root/capsule_cert/capsule_cert_csr.pem3 証明書要求を認証局に送信します。
要求を送信する場合は、証明書の有効期限を指定してください。証明書要求を送信する方法は異なるため、推奨される方法について認証局にお問い合わせください。要求への応答で、認証局バンドルと署名済み証明書を別々のファイルで受け取ることになります。
- 認証局バンドル、認証局から受け取る Capsule Server の証明書ファイル、Capsule Server の秘密鍵を、Satellite Server にコピーします。
Satellite Server で、Capsule Server 証明書入力ファイルを検証します。
# katello-certs-check \ -c /root/capsule_cert/capsule_cert.pem \1 -k /root/capsule_cert/capsule_cert_key.pem \2 -b /root/capsule_cert/ca_cert_bundle.pem3 commonName=をワイルドカードの値*に設定する場合には、-t capsuleオプションをkatello-certs-checkコマンドに追加する必要があります。katello-certs-checkコマンドの出力であるcapsule-certs-generateコマンドの例をメモして、この Capsule Server の認証アーカイブファイルを作成します。
4.3.2. カスタム SSL 証明書を使用する Capsule Server のロードバランシング用の設定 (Puppet を使用しない) リンクのコピーリンクがクリップボードにコピーされました!
この手順は、ロードバランシング用に設定する Capsule Server ごとに実行します。
手順
katello-certs-checkコマンドの出力から取得するcapsule-certs-generateコマンドに次のオプションを追加します。--foreman-proxy-cname loadbalancer.example.comSatellite Server で、
capsule-certs-generateコマンドを入力して Capsule 証明書を生成します。例を以下に示します。# capsule-certs-generate \ --foreman-proxy-fqdn capsule.example.com \ --certs-tar /root/capsule_cert/capsule.tar \ --server-cert /root/capsule_cert/capsule.pem \ --server-key /root/capsule_cert/capsule.pem \ --server-ca-cert /root/capsule_cert/ca_cert_bundle.pem \ --foreman-proxy-cname loadbalancer.example.com出力からの
satellite-installerコマンド例のコピーを保持し、Capsule Server 証明書をインストールします。証明書アーカイブファイルを Satellite Server から Capsule Server にコピーします。
# scp /root/capsule.example.com-certs.tar \ root@capsule.example.com:capsule.example.com-certs.tarcapsule-certs-generateコマンドの出力から取得するsatellite-installerコマンドに次のオプションを追加します。--certs-cname "loadbalancer.example.com" \ --enable-foreman-proxy-plugin-remote-execution-ssh以下のように、Capsule Server で、
satellite-installerコマンドを実行します。# satellite-installer --scenario capsule \ --foreman-proxy-register-in-foreman "true" \ --foreman-proxy-foreman-base-url "https://satellite.example.com" \ --foreman-proxy-trusted-hosts "satellite.example.com" \ --foreman-proxy-trusted-hosts "capsule.example.com" \ --foreman-proxy-oauth-consumer-key "oauth key" \ --foreman-proxy-oauth-consumer-secret "oauth secret" \ --certs-tar-file "capsule.example.com-certs.tar" \ --certs-cname "loadbalancer.example.com" \ --enable-foreman-proxy-plugin-remote-execution-ssh
4.4. カスタム SSL 証明書を使用する Capsule Server のロードバランシング用の設定 (Puppet を使用する) リンクのコピーリンクがクリップボードにコピーされました!
次のセクションでは、Puppet を使用し、カスタム SSL 証明書を使用する Capsule Server をロードバランシング用に設定する方法を説明します。
4.4.1. Capsule Server のカスタム SSL 証明書の作成 リンクのコピーリンクがクリップボードにコピーされました!
以下の手順では、Certificate Signing Request (CSR: 証明書署名要求) の設定ファイルを作成して、Subject Alternative Names (SAN: サブジェクトの別名) としてロードバランサーと Capsule Server を追加する方法を説明します。この手順は、ロードバランシング用に設定する Capsule Server ごとに実行します。
手順
Capsule Server で、すべてのソース証明書ファイルを含むディレクトリーを作成し、
rootユーザーのみがアクセスできるようにします。# mkdir /root/capsule_cert # cd /root/capsule_certCertificate Signing Request (CSR) を署名する秘密鍵を作成します。
秘密鍵は暗号化する必要がないことに注意してください。パスワードで保護された秘密鍵を使用する場合は、秘密鍵のパスワードを削除します。
この Capsule Server の秘密鍵がすでにある場合は、この手順を省略します。
# openssl genrsa -out /root/capsule_cert/capsule.pem 4096証明書要求設定ファイルを作成して、次の内容を追加します。
[ req ] default_bits = 4096 distinguished_name = req_distinguished_name req_extensions = req_ext prompt = no [ req_distinguished_name ] countryName=2 Letter Country Code stateOrProvinceName=State or Province Full Name localityName=Locality Name 0.organizationName=Organization Name organizationalUnitName=Capsule Organization Unit Name commonName=capsule.example.com1 emailAddress=Email Address [ req_ext ] #authorityKeyIdentifier=keyid,issuer #basicConstraints=CA:FALSE keyUsage = digitalSignature, nonRepudiation, keyEncipherment, dataEncipherment subjectAltName = @alt_names [alt_names]2 DNS.1 = loadbalancer.example.com DNS.2 = capsule.example.comSAN 証明書の Certificate Signing Request (CSR) を作成します。
# openssl req -new \ -key /root/capsule_cert/capsule.pem \1 -config SAN_config.cfg \2 -out /root/capsule_cert/capsule.pem3 証明書要求を認証局に送信します。
要求を送信する場合は、証明書の有効期限を指定してください。証明書要求を送信する方法は異なるため、推奨される方法について認証局にお問い合わせください。要求への応答で、認証局バンドルと署名済み証明書を別々のファイルで受け取ることになります。
- 認証局バンドル、認証局から受け取る Capsule Server の証明書ファイル、Capsule Server の秘密鍵を、Satellite Server にコピーし、検証します。
Satellite Server で、Capsule Server 証明書入力ファイルを検証します。
# katello-certs-check \ -c /root/capsule_cert/capsule.pem \1 -k /root/capsule_cert/capsule.pem \2 -b /root/capsule_cert/ca_cert_bundle.pem3
4.4.2. カスタム SSL 証明書を使用する Capsule Server のロードバランシング用の設定 (Puppet を使用する) リンクのコピーリンクがクリップボードにコピーされました!
Satellite 設定で Puppet を使用する場合は、次の手順を実行する必要があります。
Puppet 証明書を生成して署名するための Capsule Server の設定
この手順は、ロードバランシング用に設定した他の Capsule Server すべてに、Puppet 証明書を生成するように Capsule Server を設定するシステムにのみ、実行してください。この手順の例では、この Capsule Server の FQDN は capsule-ca.example.com です。
katello-certs-checkコマンドの出力から取得するcapsule-certs-generateコマンドに次のオプションを追加します。--foreman-proxy-cname loadbalancer.example.comSatellite Server で、
capsule-certs-generateコマンドを入力して Capsule 証明書を生成します。例を以下に示します。# capsule-certs-generate \ --foreman-proxy-fqdn capsule-ca.example.com \ --certs-tar /root/capsule_cert/capsule-ca.tar \ --server-cert /root/capsule_cert/capsule-ca.pem \ --server-key /root/capsule_cert/capsule-ca.pem \ --server-ca-cert /root/capsule_cert/ca_cert_bundle.pem \ --foreman-proxy-cname loadbalancer.example.com出力からの
satellite-installerコマンド例のコピーを保持し、Capsule Server 証明書をインストールします。- 証明書アーカイブファイルを Satellite Server から Capsule Server にコピーします。
capsule-certs-generateコマンドの出力から取得するsatellite-installerコマンドに次のオプションを追加します。--puppet-dns-alt-names "loadbalancer.example.com" \ --puppet-ca-server "capsule-ca.example.com" \ --foreman-proxy-puppetca "true" \ --puppet-server-ca "true" \ --enable-foreman-proxy-plugin-remote-execution-ssh以下のように、Capsule Server で、
satellite-installerコマンドを実行します。satellite-installer --scenario capsule \ --foreman-proxy-register-in-foreman "true" \ --foreman-proxy-foreman-base-url "https://satellite.example.com" \ --foreman-proxy-trusted-hosts "satellite.example.com" \ --foreman-proxy-trusted-hosts "capsule-ca.example.com" \ --foreman-proxy-oauth-consumer-key "oauth key" \ --foreman-proxy-oauth-consumer-secret "oauth secret" \ --certs-tar-file "certs.tgz" \ --puppet-server-foreman-url "https://satellite.example.com" \ --certs-cname "loadbalancer.example.com" \ --puppet-dns-alt-names "loadbalancer.example.com" \ --puppet-ca-server "capsule-ca.example.com" \ --foreman-proxy-puppetca "true" \ --puppet-server-ca "true" \ --enable-foreman-proxy-plugin-remote-execution-script \ --foreman-proxy-content-puppet true \ --enable-puppet \ --puppet-server true \ --puppet-server-foreman-ssl-ca /etc/pki/katello/puppet/puppet_client_ca.crt \ --puppet-server-foreman-ssl-cert /etc/pki/katello/puppet/puppet_client.crt \ --puppet-server-foreman-ssl-key /etc/pki/katello/puppet/puppet_client.keyCapsule Server で、ロードバランシングを設定する他のすべての Capsule に対して Puppet 証明書を生成します。ただし、Puppet 証明書署名を設定する最初のシステムを除きます。
# puppet cert generate capsule.example.com \ --dns_alt_names=loadbalancer.example.comこのコマンドは、Puppet 証明書署名を行う Capsule Server インスタンスに次のファイルを作成します。
-
/etc/puppetlabs/puppet/ssl/certs/ca.pem -
/etc/puppetlabs/puppet/ssl/certs/capsule.example.com.pem -
/etc/puppetlabs/puppet/ssl/private_keys/capsule.example.com.pem -
/etc/puppetlabs/puppet/ssl/public_keys/capsule.example.com.pem
-
残りの Capsule Server のロードバランシング用の設定
この手順は、Puppet 証明書に署名するために Capsule Server を設定するシステムを除き、各 Capsule Server で実行します。
katello-certs-checkコマンドの出力から取得するcapsule-certs-generateコマンドに次のオプションを追加します。--foreman-proxy-cname loadbalancer.example.comSatellite Server で、
capsule-certs-generateコマンドを入力して Capsule 証明書を生成します。例を以下に示します。# capsule-certs-generate \ --foreman-proxy-fqdn capsule.example.com \ --certs-tar /root/capsule_cert/capsule.tar \ --server-cert /root/capsule_cert/capsule.pem \ --server-key /root/capsule_cert/capsule.pem \ --server-ca-cert /root/capsule_cert/ca_cert_bundle.pem \ --foreman-proxy-cname loadbalancer.example.com出力からの
satellite-installerコマンド例のコピーを保持し、Capsule Server 証明書をインストールします。証明書アーカイブファイルを Satellite Server から Capsule Server にコピーします。
# scp /root/capsule.example.com-certs.tar \ root@capsule.example.com:capsule.example.com-certs.tarCapsule Server で、
puppetserverパッケージをインストールします。# satellite-maintain packages install puppetserverCapsule Server で、Puppet 証明書用のディレクトリーを作成します。
# mkdir -p /etc/puppetlabs/puppet/ssl/certs/ \ /etc/puppetlabs/puppet/ssl/private_keys/ \ /etc/puppetlabs/puppet/ssl/public_keys/Capsule Server で、Capsule Server を設定するシステムから、対象の Capsule Server の Puppet 証明書をコピーして、Puppet 証明書を署名します。
# scp root@capsule-ca.example.com:/etc/puppetlabs/puppet/ssl/certs/ca.pem \ /etc/puppetlabs/puppet/ssl/certs/ca.pem # scp root@capsule-ca.example.com:/etc/puppetlabs/puppet/ssl/certs/capsule.example.com.pem \ /etc/puppetlabs/puppet/ssl/certs/capsule.example.com.pem # scp root@capsule-ca.example.com:/etc/puppetlabs/puppet/ssl/private_keys/capsule.example.com.pem \ /etc/puppetlabs/puppet/ssl/private_keys/capsule.example.com.pem # scp root@capsule-ca.example.com:/etc/puppetlabs/puppet/ssl/public_keys/capsule.example.com.pem \ /etc/puppetlabs/puppet/ssl/public_keys/capsule.example.com.pemCapsule Server で、ディレクトリーの所有権をユーザー
puppet、グループpuppetに変更し、SELinux コンテキストを設定します。# chown -R puppet:puppet /etc/puppetlabs/puppet/ssl/ # restorecon -Rv /etc/puppetlabs/puppet/ssl/capsule-certs-generateコマンドの出力から取得するsatellite-installerコマンドに次のオプションを追加します。--certs-cname "loadbalancer.example.com" \ --puppet-dns-alt-names "loadbalancer.example.com" \ --puppet-ca-server "capsule-ca.example.com" \ --foreman-proxy-puppetca "false" \ --puppet-server-ca "false" \ --enable-foreman-proxy-plugin-remote-execution-ssh以下のように、Capsule Server で、
satellite-installerコマンドを実行します。# satellite-installer --scenario capsule \ --foreman-proxy-register-in-foreman "true" \ --foreman-proxy-foreman-base-url "https://satellite.example.com" \ --foreman-proxy-trusted-hosts "satellite.example.com" \ --foreman-proxy-trusted-hosts "capsule.example.com" \ --foreman-proxy-oauth-consumer-key "oauth key" \ --foreman-proxy-oauth-consumer-secret "oauth secret" \ --certs-tar-file "capsule.example.com-certs.tar" \ --puppet-server-foreman-url "https://satellite.example.com" \ --certs-cname "loadbalancer.example.com" \ --puppet-dns-alt-names "loadbalancer.example.com" \ --puppet-ca-server "capsule-ca.example.com" \ --foreman-proxy-puppetca "false" \ --puppet-server-ca "false" \ --enable-foreman-proxy-plugin-remote-execution-ssh
第5章 ロードバランサーのインストール リンクのコピーリンクがクリップボードにコピーされました!
以下の例は、HAProxy ロードバランサーの設定時の一般的な指針です。ただし、適切な負荷分散ソフトウェアソリューションをインストールして、TCP 転送をサポートすることができます。
Red Hat Enterprise Linux 7 ホストで、HAProxy をインストールします。
# yum install haproxysemanageツールが含まれる、次のパッケージをインストールします。# yum install policycoreutils-pythonSELinux で HAProxy がどのポートでもバインドできるように設定します。
# semanage boolean --modify --on haproxy_connect_any表5.1「ロードバランサー用のポート設定」 の説明に従って、ポートのネットワーク負荷を分散するようにロードバランサーを設定します。たとえば、HAProxy のポートを設定するには、
/etc/haproxy/haproxy.cfgファイルを表に合わせて編集します。詳細は、Red Hat ナレッジベース の Configuration example for haproxy.cfg for HAProxy load balancer with Satellite 6 を参照してください。Expand 表5.1 ロードバランサー用のポート設定 サービス ポート モード バランスモード 宛先 HTTP
80
TCP
roundrobin
すべての Capsule Server のポート 80
HTTPS および RHSM
443
TCP
source
すべての Capsule Server のポート 443
AMQP
5647
TCP
roundrobin
全 Capsule Server のポート 5647
Puppet (オプション)
8140
TCP
roundrobin
すべての Capsule Server のポート 8140
PuppetCA (オプション)
8141
TCP
roundrobin
Puppet 証明書に署名するように Capsule Server を設定するシステムだけのポート 8140
SmartProxy (OpenScap のオプション)
9090
TCP
roundrobin
すべての Capsule Server のポート 9090
- SSL オフロードを無効にして、クライアント側の SSL 証明書がバックエンドサーバーにパススルーできるようにロードバランサーを設定します。クライアントから Capsule Server への通信はクライアント側の SSL 証明書に依存するので、この設定が必要です。
HAProxy サービスを起動し、有効にします。
# systemctl start haproxy # systemctl enable haproxy
第6章 クライアントの登録 リンクのコピーリンクがクリップボードにコピーされました!
Red Hat Enterprise Linux 6、7、または 8 オペレーティングシステムを実行しているクライアントを、ロードバランシング用に設定する Capsule Server に登録できます。クライアントを登録して Puppet を使用するように設定する方法の詳細は、ホストの管理 ガイドの ホストの登録 を参照してください。
クライアントを登録するには、次のいずれかの手順に進みます。
6.1. Red Hat Satellite ホストの登録 リンクのコピーリンクがクリップボードにコピーされました!
ホスト登録機能、Satellite API、または Hammer CLI を使用して、ホストを Satellite に登録できます。
手順
- Satellite Web UI で、ホスト > ホストの登録 に移動します。
- Generate をクリックして登録コマンドを作成します。
- ファイル アイコンをクリックして、コマンドをクリップボードにコピーします。
- 登録するホストにログインして、以前に作成したコマンドを実行します。
rhsm.baseurlおよびserver.hostnameのサブスクリプションマネージャーの設定を更新します。# subscription-manager config \ --rhsm.baseurl=https://loadbalancer.example.com/pulp/content \ --server.hostname=loadbalancer.example.com-
/etc/yum.repos.d/redhat.repoファイルをチェックして、適切なリポジトリーが有効であることを確認します。
CLI 手順
Hammer CLI を使用してホスト登録コマンドを生成します。
# hammer host-registration generate-command \ --activation-keys "My_Activation_Key"ホストが Satellite Server の SSL 証明書を信頼しない場合は、登録コマンドに
--insecureフラグを追加して SSL 検証を無効にすることができます。# hammer host-registration generate-command \ --activation-keys "My_Activation_Key" \ --insecure true- 登録するホストにログインして、以前に作成したコマンドを実行します。
rhsm.baseurlおよびserver.hostnameのサブスクリプションマネージャーの設定を更新します。# subscription-manager config \ --rhsm.baseurl=https://loadbalancer.example.com/pulp/content \ --server.hostname=loadbalancer.example.com-
/etc/yum.repos.d/redhat.repoファイルをチェックして、適切なリポジトリーが有効であることを確認します。
API の手順
Satellite API を使用してホスト登録コマンドを生成します。
# curl -X POST https://satellite.example.com/api/registration_commands \ --user "My_User_Name" \ -H 'Content-Type: application/json' \ -d '{ "registration_command": { "activation_keys": ["My_Activation_Key_1, My_Activation_Key_2"] }}'ホストが Satellite Server の SSL 証明書を信頼しない場合は、登録コマンドに
--insecureフラグを追加して SSL 検証を無効にすることができます。# curl -X POST https://satellite.example.com/api/registration_commands \ --user "My_User_Name" \ -H 'Content-Type: application/json' \ -d '{ "registration_command": { "activation_keys": ["My_Activation_Key_1, My_Activation_Key_2"], "insecure": true }}'アクティベーションキーを使用すると、その環境を簡単に指定できます。詳細は、コンテンツ管理ガイド の アクティベーションキーの管理 を参照してください。
コマンドライン引数としてパスワードを入力するには、
username:password構文を使用します。これにより、パスワードがシェル履歴に保存される可能性があることに注意してください。ホストの登録に関する情報は ホストの管理 の Red Hat Satellite へのホストの登録 を参照してください。
- 登録するホストにログインして、以前に作成したコマンドを実行します。
rhsm.baseurlおよびserver.hostnameのサブスクリプションマネージャーの設定を更新します。# subscription-manager config \ --rhsm.baseurl=https://loadbalancer.example.com/pulp/content \ --server.hostname=loadbalancer.example.com-
/etc/yum.repos.d/redhat.repoファイルをチェックして、適切なリポジトリーが有効であることを確認します。
6.2. (非推奨) ブートストラップスクリプトを使用したクライアントの登録 リンクのコピーリンクがクリップボードにコピーされました!
クライアントを登録するには、クライアント上で次のコマンドを入力します。クライアントごとに登録の手順を実行する必要があります。
前提条件
クライアントにブートストラップスクリプトをインストールして、スクリプトのファイル権限を実行可能に変更していることを確認する。詳細は、ホストの管理 ガイドの ブートストラップスクリプトを使用したホストの Red Hat Satellite への登録 を参照してください。
Red Hat Enterprise Linux 8 の場合は、以下のコマンドを入力します。
# /usr/libexec/platform-python bootstrap.py \ --login=admin \ --server loadbalancer.example.com \ --organization="My_Organization" \ --location="My_Location" \ --hostgroup="My_Hostgroup" \ --activationkey="My_Activation_Key" \ --enablerepos=satellite-client-6-for-rhel-8-<arch>-rpms \ --puppet-ca-port 8141 \1 --force2 Red Hat Enterprise Linux 7、6、5 の場合は、以下のコマンドを入力します。
# python bootstrap.py --login=admin \ --server loadbalancer.example.com \ --organization="My_Organization" \ --location="My_Location" \ --hostgroup="My_Hostgroup" \ --activationkey="My_Activation_Key" \ --enablerepos=rhel-7-server-satellite-client-6-rpms \ --puppet-ca-port 8141 \1 --force2
このスクリプトでは、--login オプションで入力した Satellite ユーザー名に対応するパスワードの入力が求められます。
6.3. (非推奨) クライアントの katello-ca-consumer rpm への手動登録 リンクのコピーリンクがクリップボードにコピーされました!
クライアントを手動で登録するには、登録するクライアントごとに、次の手順を実行します。
手順
katello-ca-consumerパッケージがインストールされている場合は削除します。# yum remove 'katello-ca-consumer*'ロードバランサーから
katello-ca-consumerパッケージをインストールします。# rpm -Uvh http://loadbalancer.example.com/pub/katello-ca-consumer-latest.noarch.rpmクライアントを登録し、
--serverurlと--baseurlのオプションを追加します。# subscription-manager register \ --activationkey=My_Activation_Key \ --baseurl=https://loadbalancer.example.com/pulp/content/ \ --org=Your_Organization \ --serverurl=https://loadbalancer.example.com/rhsm
第7章 ロードバランシング設定の確認 リンクのコピーリンクがクリップボードにコピーされました!
設定する Capsule Server ごとに次の手順を実行して、ロードバランシング設定を確認します。
- Capsule Server のベースオペレーティングシステムをシャットダウンします。
-
この Capsule に登録されたクライアントで、コンテンツまたはサブスクリプション管理機能が利用可能であることを確認します。たとえば、クライアント上で
subscription-manager refreshコマンドを入力します。 - Capsule Server のベースオペレーティングシステムを再起動します。
第8章 ロードバランサーを介した SCAP コンテンツの伝播 リンクのコピーリンクがクリップボードにコピーされました!
OpenSCAP を使用してクライアントのセキュリティーコンプライアンスを管理する場合は、ARF レポートを Capsule ではなくロードバランサーに送信するように SCAP クライアントを設定する必要があります。設定手順は、コンプライアンスポリシーをデプロイするために選択した方法によって異なります。
8.1. Ansible デプロイメントを使用した SCAP コンテンツの伝播 リンクのコピーリンクがクリップボードにコピーされました!
この手順を使用すると、Ansible デプロイメント方法の範囲内で、ロードバランサーを介して Security Content Automation Protocol (SCAP) コンテンツをプロモートできます。
前提条件
- コンプライアンスポリシーの Ansible デプロイメント向けに Satellite を設定している。詳細は、Red Hat Satellite の管理 の コンプライアンスポリシーのデプロイメント方法の設定 を参照してください。
手順
- Satellite Web UI で、Configure > Variables に移動します。
-
foreman_scap_client_port変数を検索し、その名前をクリックします。 - Default Behavior エリアで、Override チェックボックスを選択します。
-
Parameter Type リストで、
integerを選択します。 -
Default Value フィールドに、
9090と入力します。 - Specify Matchers エリアで、デフォルト値をオーバーライドするすべてのマッチャーを削除します。
- Submit をクリックします。
-
foreman_scap_client_server変数を検索し、その名前をクリックします。 - Default Behavior エリアで、Override チェックボックスを選択します。
-
Parameter Type リストで、
stringを選択します。 -
Default Value フィールドに、ロードバランサーの FQDN (
loadbalancer.example.comなど) を入力します。 - Specify Matchers エリアで、デフォルト値をオーバーライドするすべてのマッチャーを削除します。
- Submit をクリックします。
Ansible を使用したコンプライアンスポリシーのデプロイに進みます。詳細は以下を参照してください。
- Red Hat Satellite の管理 の Ansible を使用したホストグループへのポリシーのデプロイ
- Red Hat Satellite の管理 の Ansible を使用したホストへのポリシーのデプロイ
検証
クライアント上で、
/etc/foreman_scap_client/config.yamlファイルに次の行が含まれていることを確認します。# Foreman proxy to which reports should be uploaded :server: 'loadbalancer.example.com' :port: 9090
8.2. Puppet デプロイメントを使用した SCAP コンテンツの伝播 リンクのコピーリンクがクリップボードにコピーされました!
この手順を使用すると、Puppet デプロイメント方法の範囲内で、ロードバランサーを介して Security Content Automation Protocol (SCAP) コンテンツをプロモートできます。
前提条件
- コンプライアンスポリシーの Puppet デプロイメント向けに Satellite を設定している。詳細は、Red Hat Satellite の管理 の コンプライアンスポリシーのデプロイメント方法の設定 を参照してください。
手順
-
Satellite Web UI で Configure > Classes に移動して、
foreman_scap_clientをクリックします。 - Smart Class Parameter タブをクリックします。
-
Smart Class Parameter ウィンドウの左側のペインで、
portをクリックします。 - Default Behavior エリアで、Override チェックボックスを選択します。
-
Key Type の一覧から
integerを選択します。 -
Default Value フィールドに、
9090と入力します。 -
Smart Class Parameter ウィンドウの左側のペインで、
serverをクリックします。 - Default Behavior エリアで、Override チェックボックスを選択します。
-
Key Type の一覧から
stringを選択します。 -
Default Value フィールドに、ロードバランサーの FQDN (
loadbalancer.example.comなど) を入力します。 - Smart Class Parameter ウィンドウの左下のペインで、Submit をクリックします。
Puppet を使用したコンプライアンスポリシーのデプロイに進みます。詳細は以下を参照してください。
- Red Hat Satellite の管理 の Puppet を使用したホストグループへのポリシーのデプロイ
- Red Hat Satellite の管理 の Puppet を使用したホストへのポリシーのデプロイ
検証
クライアント上で、
/etc/foreman_scap_client/config.yamlファイルに次の行が含まれていることを確認します。# Foreman proxy to which reports should be uploaded :server: 'loadbalancer.example.com' :port: 9090