現在、3 つの EC2 インスタンスを使用して AWS に HA フェイルオーバーを実装しようとしています。これら 3 台のマシンの名前が HA1、HA2、および HA3 であるとします。HA1 には Elastic IP があり、他の 2 つには SSH 接続を確立するための標準のパブリック IP があります。以下のリストにあるこれら 3 つのリソースを既にフォローしています。
- https://medium.com/@2infiniti/creating-highly-available-nodes-on-icon-stage-1-active-passive-failover-with-pacemaker-and-a9d56b1484da
- https://medium.com/@gt.anand1994/ha-cluster-with-elasticip-using-corosync-and-pacemaker-a013d288ae8
- https://www.howtoforge.com/tutorial/how-to-set-up-nginx-high-availability-with-pacemaker-corosync-and-crmsh-on-ubuntu-1604/#step-configure-corosync
crm status
シェルで以下の出力が表示されるため、実行するまではまったく問題ありません。
Current DC: PRep-01 (version 1.1.18-2b07d5c5a9) - partition with quorum
Last updated: Mon Dec 16 15:01:40 2019
Last change: Mon Dec 16 15:01:31 2019 by root via cibadmin on PRep-01
3 nodes configured
1 resource configured
Online: [ PRep-01 PRep-02 PRep-03 ]
Full list of resources:
deneme123 (ocf::heartbeat:awseip): Stopped
ご覧のとおり、主な問題は、以下のコマンドで作成したリソースが起動しないことです。
sudo crm configure primitive deneme123 ocf:heartbeat:awseip params elastic_ip="xx.xx.xx.xx" awscli="$(which aws)" allocation_id="eipalloc-xxxxxxxxxx" op start timeout="60s" interval="0s" on-fail="restart" op monitor timeout="60s" interval="10s" on-fail="restart" op stop timeout="60s" interval="0s" on-fail="block" meta migration-threshold="2" failure-timeout="60s" resource-stickiness="100"
最後に、3 つのインスタンスすべてでペースメーカーのステータスを確認すると、次のようになります。
Dec 16 15:01:32 ip-172-31-47-76 crmd[30721]: notice: Result of probe operation for deneme123 on PRep-02: 7 (not ru
Dec 16 15:01:32 ip-172-31-47-76 crmd[30721]: notice: PRep-02-deneme123_monitor_0:5 [ You must specify a region. Yo
Dec 16 15:01:37 ip-172-31-47-76 lrmd[30714]: notice: deneme123_start_0:30780:stderr [ You must specify a region. Y
Dec 16 15:01:37 ip-172-31-47-76 lrmd[30714]: notice: deneme123_start_0:30780:stderr [ You must specify a region. Y
Dec 16 15:01:37 ip-172-31-47-76 lrmd[30714]: notice: deneme123_start_0:30780:stderr [ You must specify a region. Y
Dec 16 15:01:37 ip-172-31-47-76 crmd[30721]: notice: Result of start operation for deneme123 on PRep-02: 7 (not ru
Dec 16 15:01:37 ip-172-31-47-76 crmd[30721]: notice: PRep-02-deneme123_start_0:6 [ You must specify a region. You
Dec 16 15:01:38 ip-172-31-47-76 lrmd[30714]: notice: deneme123_stop_0:30807:stderr [ You must specify a region. Yo
Dec 16 15:01:38 ip-172-31-47-76 lrmd[30714]: notice: deneme123_stop_0:30807:stderr [ You must specify a region. Yo
Dec 16 15:01:38 ip-172-31-47-76 crmd[30721]: notice: Result of stop operation for deneme123 on PRep-02: 0 (ok)
しかし、私はすでにaws configure
リージョンを入力して入力しており、~/.aws/config でリージョンを確認することもできます。同時に、ファイルにも追加AWS_DEFAULT_REGION=eu-xx-1
しました。/etc/systemd/system/multi-user.target.wants/pacemaker.service
質問は、ここで何が問題なのですか? AWS リージョンの何が問題なのかわかりません。何が原因ですか?