本文介绍了如何将自动缩放组连接到我的ecs集群?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在ECS的所有教程中,您需要创建一个集群,然后再创建一个自动缩放组,它将生成实例。在所有这些教程中,这些实例不可思议地显示在集群中,但没有人提供连接自动缩放组和集群的提示。

In all tutorials for ECS you need to create a cluster and after that an autoscaling group, that will spawn instances. Somehow in all these tutorials the instances magically show up in the cluster, but noone gives a hint what's connecting the autoscaling group and the cluster.

我的自动缩放组按预期产生实例,但他们只是不出现在我的ecs集群上,他们拥有我的码头定义。

my autoscaling group spawns instances as expected, but they just dont show up on my ecs cluster, who holds my docker definitions.

我在哪里丢失了连接?

推荐答案

嗯,我发现了。
它的所有关于ecs代理及其配置文件/etc/ecs/ecs.config
(即使从自动缩放配置创建EC2实例,此文件将通过Userdata字段创建。)
请阅读以下配置选项:

但是你甚至可以复制一个ecs .config存储在Amazon S3上,这样做(以下行进入 Userdata 字段):

But you can even copy a ecs.config stored on Amazon S3, do it like this (following lines go into Userdata field):

#!/bin/bash
yum install -y aws-cli
aws configure set default.s3.signature_version s3v4
aws configure set default.s3.addressing_style path
aws configure set default.region eu-central-1
aws s3 cp s3://<bucketname>/ecs.config /etc/ecs/ecs.config

注意:Signature_version v4特定于某些区域,如e U形中央-1。
这个只有工作,如果你的IAM角色的实例(在我的情况下它的ecsInstanceRole)有正确的AmazonS3ReadOnlyAccess

AWS GUI控制台方式为:
使用集群向导。
它将为您的群集创建一个自动缩放格式,在其前面加载一个负载均衡器,并将其完全连接。

The AWS GUI console way for that would be:Use the cluster wizard at https://console.aws.amazon.com/ecs/home#/firstRun .It will create an autoscaling grou for your cluster, a loadbalancer in front of it, and connect it all nicely.

这篇关于如何将自动缩放组连接到我的ecs集群?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-13 12:26