我目前正在尝试在具有3个EC2实例的AWS上实施HA故障转移。假设这三台机器的名称分别为HA1,HA2和HA3。 HA1具有弹性IP,另外两个具有标准的公共IP以建立SSH连接。我已经在下面的列表中关注了这三个资源:
直到我执行crm status
才完全没有问题,因为我可以在shell上看到以下输出:
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"
最后,当我在所有三个实例上检查起搏器的状态时,都会得到以下信息:
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区域有什么问题。是什么原因造成的?
您必须正确配置安全组和ACL规则。
实例之间有ping吗?
似乎该问题与IAM角色及其政策有关。使用所需的策略创建角色后,便可以通过EIP成功部署HA解决方案。