第7章 HA コントローラーリソースの調査と修正
pcs constraint show コマンドは、サービスの起動方法に対する制約を表示します。このコマンドの出力には、各リソースの場所、リソースの起動順序、どのリソースと一緒に起動する必要があるのかなどの制約が表示されます。問題がある場合には、これらの問題を修正してから、リソースをクリーンアップします。
pcs constraint show コマンドは、場所 (特定のホスト上でのみ実行可能)、順序 (起動前に他のリソースが有効化されているかによって左右される)、コロケーション (他のリソースと同じ場所に配置されている必要がある) などによりリソースがどのように制約されているかを表示します。コントローラーノードで実行した pcs constraint show の出力を途中省略して以下に記載します。
$ sudo pcs constraint show Location Constraints: Resource: my-ipmilan-for-controller-0 Disabled on: overcloud-controller-0 (score:-INFINITY) Resource: my-ipmilan-for-controller-1 Disabled on: overcloud-controller-1 (score:-INFINITY) Resource: my-ipmilan-for-controller-2 Disabled on: overcloud-controller-2 (score:-INFINITY) Ordering Constraints: start ip-172.16.0.10 then start haproxy-clone (kind:Optional) start ip-10.200.0.6 then start haproxy-clone (kind:Optional) start ip-172.19.0.10 then start haproxy-clone (kind:Optional) start ip-192.168.1.150 then start haproxy-clone (kind:Optional) start ip-172.16.0.11 then start haproxy-clone (kind:Optional) start ip-172.18.0.10 then start haproxy-clone (kind:Optional) Colocation Constraints: ip-172.16.0.10 with haproxy-clone (score:INFINITY) ip-172.18.0.10 with haproxy-clone (score:INFINITY) ip-10.200.0.6 with haproxy-clone (score:INFINITY) ip-172.19.0.10 with haproxy-clone (score:INFINITY) ip-172.16.0.11 with haproxy-clone (score:INFINITY) ip-192.168.1.150 with haproxy-clone (score:INFINITY)
この出力には、以下の 3 つの主要なセクションが表示されています。
- Location Constraints
- このセクションには、リソースの割り当て先の制約は特にないことが表示されています。ただし、出力では、 ipmilan リソースが各コントローラー上で無効化されていることが分かります。そのため、この点に関してさらに調査する必要があります。
- Ordering Constraints
- このセクションでは、仮想 IP アドレスリソース (IPaddr2) は HAProxy より前に起動するように設定されている点に注目してください。Ordering Constraints は、IP アドレスリソースと HAProxy に関連したもののみです。各サービス (例: nova) は依存するサービス (例: galera) の中断をサポート可能であると想定されているので、現在その他の全リソースは systemd に管理を任せられます。
- Colocation Constraints
- このセクションでは、どのリソースを併置する必要があるかが表示されています。すべての仮想 IP アドレスが haproxy-clone リソースに関連付けられています。
7.1. コントローラー上のリソースの問題修正
クラスターによって管理されているリソースに関する失敗したアクションは、pcs status コマンドで表示されます。多くの異なる問題が発生する可能性があります。一般的には、以下の方法で問題に対処することができます。
- コントローラーの問題
コントローラーのヘルスチェックでエラーが発生した場合には、そのコントローラーにログインしてサービスが問題なく起動できるかどうかを確認してください。サービスの起動で問題がある場合には、コントローラー間での通信の問題がある可能性があることになります。コントローラー間の通信問題のその他の兆候には、以下が含まれます。
- 1 台のコントローラーが他のコントローラーよりも過度にフェンシングされる
- 特定のコントローラーから、不審な大量のサービスでエラーが発生している
- 個別のリソースの問題
- コントローラーからのサービスが基本的には機能しているが、個別のリソースでエラーが発生している場合には、 pcs status のメッセージで問題を特定できるか確認します。さらに情報が必要な場合には、リソースの問題があるコントローラーにログインして、以下のステップのいくつか試してください。
IP とコアリソース (Galera、Rabbit、Redis) 以外で、クラスターによって管理されている唯一の A/P リソースは openstack-cinder-volume です。このリソースに、関連付けられた失敗したアクションがある場合の適切な対処方法は systemctl 側からチェックすることです。リソースが失敗しているノード (例: overcloud-controller-0)を特定した後には、そのリソースのステータスをチェックすることができます。
[heat-admin@overcloud-controller-0 ~]$ sudo systemctl status openstack-cinder-volume
● openstack-cinder-volume.service - Cluster Controlled openstack-cinder-volume
Loaded: loaded (/usr/lib/systemd/system/openstack-cinder-volume.service; disabled; vendor preset: disabled)
Drop-In: /run/systemd/system/openstack-cinder-volume.service.d
└─50-pacemaker.conf
Active: active (running) since Tue 2016-11-22 09:25:53 UTC; 2 weeks 6 days ago
Main PID: 383912 (cinder-volume)
CGroup: /system.slice/openstack-cinder-volume.service
├─383912 /usr/bin/python2 /usr/bin/cinder-volume --config-file /usr/share/cinder/cinder-dist.conf --config-file /etc/cinder/cinder.conf --logfile /var/log/cinder/volume.log
└─383985 /usr/bin/python2 /usr/bin/cinder-volume --config-file /usr/share/cinder/cinder-dist.conf --config-file /etc/cinder/cinder.conf --logfile /var/log/cinder/volume.log
Nov 22 09:25:55 overcloud-controller-0.localdomain cinder-volume[383912]: 2016-11-22 09:25:55.798 383912 WARNING oslo_config.cfg [req-8f32db96-7ca2-4fc5-82ab-271993b28174 - - - -...e future.
Nov 22 09:25:55 overcloud-controller-0.localdomain cinder-volume[383912]: 2016-11-22 09:25:55.799 383912 WARNING oslo_config.cfg [req-8f32db96-7ca2-4fc5-82ab-271993b28174 - - - -...e future.
Nov 22 09:25:55 overcloud-controller-0.localdomain cinder-volume[383912]: 2016-11-22 09:25:55.926 383985 INFO cinder.coordination [-] Coordination backend started successfully.
Nov 22 09:25:55 overcloud-controller-0.localdomain cinder-volume[383912]: 2016-11-22 09:25:55.926 383985 INFO cinder.volume.manager [req-cb07b35c-af01-4c45-96f1-3d2bfc98ecb5 - - ...r (1.2.0)
Nov 22 09:25:56 overcloud-controller-0.localdomain cinder-volume[383912]: 2016-11-22 09:25:56.047 383985 WARNING oslo_config.cfg [req-cb07b35c-af01-4c45-96f1-3d2bfc98ecb5 - - - -...e future.
Nov 22 09:25:56 overcloud-controller-0.localdomain cinder-volume[383912]: 2016-11-22 09:25:56.048 383985 WARNING oslo_config.cfg [req-cb07b35c-af01-4c45-96f1-3d2bfc98ecb5 - - - -...e future.
Nov 22 09:25:56 overcloud-controller-0.localdomain cinder-volume[383912]: 2016-11-22 09:25:56.048 383985 WARNING oslo_config.cfg [req-cb07b35c-af01-4c45-96f1-3d2bfc98ecb5 - - - -...e future.
Nov 22 09:25:56 overcloud-controller-0.localdomain cinder-volume[383912]: 2016-11-22 09:25:56.063 383985 INFO cinder.volume.manager [req-cb07b35c-af01-4c45-96f1-3d2bfc98ecb5 - - ...essfully.
Nov 22 09:25:56 overcloud-controller-0.localdomain cinder-volume[383912]: 2016-11-22 09:25:56.111 383985 INFO cinder.volume.manager [req-cb07b35c-af01-4c45-96f1-3d2bfc98ecb5 - - ...r (1.2.0)
Nov 22 09:25:56 overcloud-controller-0.localdomain cinder-volume[383912]: 2016-11-22 09:25:56.146 383985 INFO cinder.volume.manager [req-cb07b35c-af01-4c45-96f1-3d2bfc98ecb5 - - ...essfully.
Hint: Some lines were ellipsized, use -l to show in full.
エラーが発生したリソースを修正した後には、pcs resource cleanup コマンドを実行すると、リソースの状態と失敗回数をリセットすることができます。たとえば、httpd-cloneopenstack-cinder-volume リソースの問題を修正するには、以下のコマンドを実行します。
$ sudo pcs resource cleanup openstack-cinder-volume Resource: openstack-cinder-volume successfully cleaned up

Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.