简体   繁体   English

EC2 实例未加入 ECS 集群

[英]EC2 instances not being joined to ECS cluster

My EC2 instances are not being shown on ECS cluster but they are appearing on EC2 console.我的 EC2 实例没有显示在 ECS 集群上,但它们出现在 EC2 控制台上。 This issue occurs when I specify a different ubuntu image rather than default Amazon image.当我指定不同的 ubuntu 图像而不是默认的 Amazon 图像时会出现此问题。

Providing the ecs-cli command I used below提供我在下面使用的 ecs-cli 命令

ecs-cli up --keypair emaile --capability-iam --size 2 --instance-type t2.medium --launch-type EC2 --image-id ami-03f0fd1a2ba530e75 --cluster-config ec2-cluster --ecs-profile ecs-profile --port 8000

I checked the instances user data and providing you the same我检查了实例用户数据并为您提供了相同的

Content-Type: multipart/mixed; boundary="d9c7ec8c5709925e324f39982c69c71d86d39ec660280837e8a5e69e93c2"
MIME-Version: 1.0

--d9c7ec8c5709925e324f39982c69c71d86d39ec660280837e8a5e69e93c2
Content-Type: text/text/plain; charset="utf-8"
Mime-Version: 1.0

#!/bin/bash
echo ECS_CLUSTER=ec2-cluster >> /etc/ecs/ecs.config

--d9c7ec8c5709925e324f39982c69c71d86d39ec660280837e8a5e69e93c2--

Whenever I try ecs-cli compose up getting the below error每当我尝试 ecs-cli 组合时,都会出现以下错误

ERRO[0000] Error running tasks                           error="InvalidParameterException: No Container Instances were found in your cluster." task definition=0xc00033e5a0
FATA[0000] InvalidParameterException: No Container Instances were found in your cluster

I think the issue is reproducible, Thanks for help in advance我认为这个问题是可重现的,提前感谢您的帮助

edit :编辑

Instance final log error实例最终日志错误

[   22.043805] cloud-init[1555]: Cloud-init v. 20.2-45-g5f7825e2-0ubuntu1~18.04.1 finished at Sat, 07 Nov 2020 10:04:16 +0000. Datasource DataSourceEc2Local.  Up 22.03 seconds

[[0;1;31mFAILED[0m] Failed to start Execute cloud user/final scripts.

See 'systemctl status cloud-final.service' for details.

[[0;32m  OK  [0m] Reached target Cloud-init target.


Ubuntu 18.04 is not on the list of ECS-optimized AMIs. Ubuntu 18.04 不在ECS 优化的AMI 列表中 The list only includes AMIs based on Amazon Linux 1, Amazon Linux 2 and Windows.该列表仅包括基于 Amazon Linux 1、Amazon Linux 2 和 Windows 的 AMI。

If you want to use ubuntu, you have set it up yourself to be able to work with ECS.如果你想使用 ubuntu,你已经自己设置好了能够与 ECS 一起工作。 There are some tutorials on how to do it.有一些关于如何做到这一点的教程。 One example is here .一个例子是here

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM