Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I have started 2 ECS optimized instances on EC2, but how can I register them as ECS container instances ?

Can not figure out a way of doing that.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
978 views
Welcome To Ask or Share your Answers For Others

1 Answer

When you start an ECS optimized image, it starts the ECS agent on the instance by default. The ecs agent registers the instance with the default ecs cluster.

For your instance to be available on the cluster, you will have to create the default cluster.

if you have a custom ecs cluster, you can set the cluster name using the userdata section.

The ecs agent expects the cluster name inside the ecs.config file available at /etc/ecs/ecs.config.

You can set it up at instance boot up using userdata script

#!/bin/bash
echo ECS_CLUSTER={cluster_name} >> /etc/ecs/ecs.config

Please refer to the following ecs documentation for more information http://docs.aws.amazon.com/AmazonECS/latest/developerguide/launch_container_instance.html


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...