【问题标题】:ECS CLI key pair error when calling up调用时 ECS CLI 密钥对错误
【发布时间】:2018-07-06 09:44:37
【问题描述】:

我正在尝试使用 Amazon 的 ECS cli 创建集群。我不断收到错误:

 reason="The key pair 'my-key-pair' does not exist" resourceType="AWS::AutoScaling::LaunchConfiguration"

我也跑过:

ecs-cli configure profile --profile-name grantspilsbury --access-key foo --secret-key bar
ecs-cli configure --cluster cluster_test --region us-east-1 --config-name myclusterconfig

我已将 my-key-pair 添加到 ECS 和 EC2。

完整的日志是:

~ $ ecs-cli up --keypair my-key-pair --capability-iam --size 2 --instance-type t2.small --force
INFO[0002] Created cluster                               cluster=default region=us-east-1
INFO[0003] Waiting for your CloudFormation stack resources to be deleted...
INFO[0003] Cloudformation stack status                   stackStatus="DELETE_IN_PROGRESS"
INFO[0038] Waiting for your cluster resources to be created...
INFO[0038] Cloudformation stack status                   stackStatus="CREATE_IN_PROGRESS"
INFO[0101] Cloudformation stack status                   stackStatus="CREATE_IN_PROGRESS"
INFO[0164] Cloudformation stack status                   stackStatus="CREATE_IN_PROGRESS"
ERRO[0197] Failure event                                 reason="The key pair 'my-key-pair' does not exist" resourceType="AWS::AutoScaling::LaunchConfiguration"
FATA[0197] Error executing 'up': Cloudformation failure waiting for 'CREATE_COMPLETE'. State is 'ROLLBACK_IN_PROGRESS'

【问题讨论】:

    标签: amazon-ec2 docker-compose amazon-ecs


    【解决方案1】:

    我遇到了同样的问题。我的问题是我给了它pem 文件的完整路径,而不是key on EC2 (link to Ohio region) 的名称。转弯

    ecs-cli up --keypair /home/me/keyPair.pem --capability-iam --size 2 --instance-type t2.medium --cluster-config ec2-tutorial --force

    进入

    ecs-cli up --keypair keyPair --capability-iam --size 2 --instance-type t2.medium --cluster-config ec2-tutorial --force

    只要 EC2 上有一个名为 keyPair 的密钥对就可以工作

    【讨论】:

      【解决方案2】:

      我的问题是我传递的是文件名 (keypair.pem) 而不是 AWS 上的密钥对的名称。确保传递您在 AWS 上看到的 密钥对名称,而不是文件名。

      【讨论】:

        【解决方案3】:

        您的密钥可能与您尝试创建映像的区域不同。 Jeff 的回答让我知道我的密钥对在默认实例(俄亥俄州)中,但我是在本地区域创建我的实例。

        【讨论】:

          【解决方案4】:

          我一直在关注本教程,直到发现同样的问题: https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-cli-tutorial-ec2.html

          与地域无关,问题是我的 Key-Pair 没有上传到 ECS。也许很明显,但如果你像我一样是 AWS 初学者,教程说明并不清楚这一点。

          上一步:创建密钥对

          如果您还没有这样做,首先您必须创建存储在 ".pem" 文件中的密钥对。使用 AWS 控制台遵循此说明非常简单:https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html

          解决方案:

          ".pem" 文件必须上传。可以使用 AWS 控制台,按照菜单完成: EC2 > 网络和安全 > 密钥对 > “创建密钥对”

          菜单网址:https://eu-central-1.console.aws.amazon.com/ec2/v2/home?region=eu-central-1#CreateKeyPair: (注意此 URL 上定义的 2 个区域)

          如上所述: https://www.cloudbooklet.com/how-to-add-new-user-with-key-pair-in-aws-ec2/

          【讨论】:

            【解决方案5】:

            这意味着您的 EC2 账户中不存在密钥对名称。

            Simply create it with s per the aws guide

            【讨论】:

              猜你喜欢
              • 2017-03-26
              • 2017-01-20
              • 1970-01-01
              • 2020-03-29
              • 2011-10-19
              • 1970-01-01
              • 2017-10-01
              • 2020-02-01
              • 2023-02-08
              相关资源
              最近更新 更多