ECS Agent not booting when installing additional yum packages with user data

时间:2019-04-17 02:08:22

标签: amazon-web-services containers instance amazon-ecs

I'm trying to configure an Launch Configuration for container instances which supplies user data that adds the instance to the proper cluster via ecs-config and also mounts an EFS to the instance like this:

#!/bin/bash
echo ECS_CLUSTER=Cluster_Name >> /etc/ecs/ecs.config
yum update -y
yum install -y nfs-utils
mkdir /efs
mount -t nfs4 -o nfsvers=4.1,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2,noresvport fs-xxxxx.efs.insert_region_here.amazonaws.com:/ /efs
mkdir -p /efs/some_directory && chown -R some:user /efs/some_directory

This was working for me before, but suddenly stopped working (no code changes) yesterday and I'm having trouble figuring out why. Looking at the instance no /var/log/ecs logs are being created and docker ps -a shows no crashed container. As far as I can tell the ecs-agent isn't being started at all. I double checked the AMI and am still using the most current version for my region.

I tried launching simply with

#!/bin/bash
echo ECS_CLUSTER=Cluster_Name >> /etc/ecs/ecs.config

and the ECS Agent booted fine. It seems to be related to my nfs-utils install, but I'm not sure why or how to work around other than creating a custom ECS-optimized AMI with nfs-utils installed, which I don't really want to maintain.

Has anyone experienced anything similar?

0 个答案:

没有答案