本文介绍了服务无法下达任务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

好的,我不知道该在哪里进行故障排除。我正在尝试加速一个具有在ECS中运行的基本应用程序的堆栈。我将在下面显示cloudformation。但是我不断得到:

Ok, I am lost with where to to even troubleshoot this. I am trying to spin up a stack that has a basic app running in ECS. I will show the cloudformation below. But I keep getting:

我启动并运行了2个EC2实例,但均未出现在ECS中集群实例。

I get 2 EC2 instances up and running but neither appear in the ECS cluster instances.

以下是我的一些理论:


  • 是我的user_data对吗?我需要对这些值进行细分吗?

  • 健康状况检查

  • 我的应用程序是使用端口4567的sinatra应用程序。

此外,我基本上是从并进行了简化它。所以这是我当前的json,

Also, I basically started with this, http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/quickref-ecs.html and just streamlined it. So here is my current json, https://gist.github.com/kidbrax/388e2c2ae4d622b3ac4806526ec0e502

另一方面,如何简化此过程以消除所有自动缩放?只是想让它以某种形式或方式工作?

On a side note, how could I simplify this to take out all autoscaling? Just want to get it working in some form or fashion?

推荐答案

为使ECS实例加入集群,以下内容必须满足以下条件:

In order for the ECS instance to join the cluster, the following conditions must be met:


  1. 必须正确配置代理以通过群集> /etc/ecs/ecs.config 文件。

  2. 必须为ECS实例分配正确的IAM角色,以允许ECS代理访问ECS终端节点。

  3. ECS实例必须通过igw或NAT连接到Internet才能与控制平面联系。

  4. ECS上的ECS代理实例应该正在运行。

  1. The agent must be configured correctly to connect to the correctcluster via the /etc/ecs/ecs.config file.
  2. The ECS instance must be assigned the correct IAM role to allow the ECS agent to access the ECS endpoints.
  3. The ECS instance must have a connection to the Internet to contact the control plane, either via igw or NAT.
  4. The ECS agent on the ECS Instance should be running.

用于配置 /etc/ecs/ecs.config 文件。

UserData that should be used to configure /etc/ecs/ecs.config file.

#!/bin/bash
echo ECS_CLUSTER=ClusterName >> /etc/ecs/ecs.config

您可以在/中检查COntainer实例未向Cluster注册的原因var / log / ecs / ecs-agent.log *

You can check reason for COntainer Instance not registering with Cluster in /var/log/ecs/ecs-agent.log*

这篇关于服务无法下达任务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-11 12:37