AWS ECS services are moving to another cluster when instances fail health check

0 votes

We have started using ECS and we are not quite sure if the behaviour we are experiencing is the correct one, and if it is, how to work around it.

We have setup a Beanstalk Docker Multicontainer environment which in the background uses ECS to manage everything, that has been working just fine. Yesterday, we created a standalone cluster in ECS "ecs-int", a task definition "ecs-int-task" and a service "ecs-int-service" associated to a load balance "ecs-int-lb" and we added one instance to the cluster.

When the service first ran, it worked fine and we were able to reach the docker service through the loadbalance. While we were playing with the instance security group that is associated to the cluster "ecs-int" we mistakenly removed the port rule where the container were running, and the health check started failing on the LB resulting it in draining the instance out from it. When it happened, for our surprise the service "ecs-int-service" and the task "ecs-int-task" automatically moved to the Beanstalk cluster and started running there creating an issue for our beanstalk app.

While setting up the service we setup the placement rule we set as "AZ Balanced Spread".

Should the service move around cluster? Shouldn't the service be attached only to the cluster it was originally created to? If this is the normal behaviour though, how can we set a rule so he service even if the instances for some reason fail the health check but to stick within the same cluster?

Aug 27, 2018 in AWS by bug_seeker
• 15,510 points
1,294 views

1 answer to this question.

0 votes

I have re-created all the infrastructure again and the problem went away.
As I suspected, services created for one cluster should not move to different cluster when instance(s) fail.

answered Aug 27, 2018 by Priyaj
• 58,020 points

Related Questions In AWS

+5 votes
2 answers

AWS EC2 Instances are not getting to internet access

Check your VPC settings, whether you are ...READ MORE

answered Oct 16, 2018 in AWS by Omkar
• 69,220 points
13,269 views
0 votes
1 answer

How to create an ECS cluster using AWS CLI?

Hi@akhtar, You can create a new Amazon ECS cluster. ...READ MORE

answered Nov 8, 2020 in AWS by MD
• 95,460 points
901 views
0 votes
1 answer

How to delete an empty ECS cluster using AWS CLI?

Hi@akhtar, You can delete the specified ECS cluster. The ...READ MORE

answered Nov 8, 2020 in AWS by MD
• 95,460 points
2,014 views
0 votes
1 answer

Deploy multiple platforms to Elastic Beanstalk

Solve by using .ebextentions to run pre-install commands in ...READ MORE

answered Nov 28, 2018 in AWS by Archana
• 5,640 points
1,376 views
+1 vote
1 answer

What are the interview questions that could be asked related to AWS?

Genuine answer would be that you never ...READ MORE

answered Jul 12, 2018 in AWS by Priyaj
• 58,020 points
3,099 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP