My Amazon ECS agent is listed as disconnected—how can I resolve this?

The ECS agent associates container instances to your cluster and tells Docker when to start, stop, and query the containers you have specified to run. If the agent is unable to access the service, the container instance is not able to operate as a member of your ECS cluster. The issue can be caused by either a networking issue that prevents communication between the instance and ECS, or a permissions issue that prevents the ECS agent from authenticating.

Check for the following to determine the cause:

  • Verify that the ECS agent is running on the affected container instance. You can view a list of all running containers with the following command:

docker ps

The ECS agent usually has the Docker container name of ecs-agent, but it can vary if you run the container yourself. If it’s not running, it must be restarted. When using an ECS-optimized instance, this can be accomplished with the following command:

sudo start ecs

If you’re not using an ECS-optimized instance, this can be accomplished with your preferred method to restart the ECS Container Agent.

  • Check the ECS agent logs to see why the ECS agent is unable to communicate with the service. This can be viewed with the following command:

docker logs <ecs-agent_container_id>

If the agent logs are not available, you can also view them on the container instance with the following command:

/var/log/ecs/

Amazon EC2 Container Service, ECS, ecs-agent, disconnected


Did this page help you? Yes | No

Back to the AWS Support Knowledge Center

Need help? Visit the AWS Support Center

Published: 2016-08-04