Tuesday, January 2, 2018

amazon web services - AWS ECS: Unable to place task

I am trying to set up an AWS service with autoscaling. I have created a cluster with an application loadbalancer and created a task using a docker image that should be open on port 8080 for use. I have created a service based on that task for which I have set minimum and desired number of instances to 1 and maximum to 10, and created rules for scaling up and down. However, no new instances are created and all I get in the list of events at regular intervals is:




service microrecieverservice was unable to place a task because no container instance met all of its requirements. The closest matching container-instance 97d97ce9-967d-49ad-83ad-f4f904aae1f6 is already using a port required by your task. For more information, see the Troubleshooting section.





I have not been able to find anything relevant in the troubleshooting section. I have been able to manually add another instance to the cluster, but with no change in the events given. I could ssh into this instance, and there were two docker images: one was amazon-ecs-agent:latest and the other was my task definition. At this point I tried sending a REST request to the server to see if it would go through but got Connection Refused. At about the same time, the docker image restarted.



The container is not running anything else that would use port 8080 and when I do netstat -lntp the process using port 8080 is that of the my docker image.

No comments:

Post a Comment

linux - How to SSH to ec2 instance in VPC private subnet via NAT server

I have created a VPC in aws with a public subnet and a private subnet. The private subnet does not have direct access to external network. S...