-
Notifications
You must be signed in to change notification settings - Fork 162
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
EFS: able to mount but problems to resolve #73
Comments
One more clue about issue 2. The |
+1 experiencing the same issue. @eric5102 do you mean containers or images? The image I am trying to run is https://hub.docker.com/r/library/jenkins/tags/2.7.4/ and having no luck with it after multiple attempts. Also I cannot find the UUID in any docker network so I'm not sure what you mean by container bridge endpoint... the container never starts so I don't think there is a way to inspect it. docker network <bridge/host/none> | grep UUID is not yielding any results. |
Latest Amazon ECS AMI (amzn-ami-2016.03.i-amazon-ecs-optimized) Also @eric5102 I tried commenting out the line you mention in /etc/init.d/docker but after doing so docker running sudo service docker restart times out on both shutdown and startup. Re-adding the line allows docker to start. I am running into the same log messages you post on container creation - I cannot even get containers to start. I'm not that knowledgeable about Docker volumes or plugins, so I'm mostly flying blind here. |
Got a bit further. Noticed if I did not specify "--az" option I could successfully start a container. Put more details here as this now seems similar to the issue I'm experiencing |
do a
I didn't say to comment the line but to remove just the We should be able to keep $unshare but have the container join the volume namespace. Others have encountered that problem with Docker. Oracle even suggests to remove $unshare when installing Docker on Oracle Linux. The netshare plugin project is not very active so for the time being I decided to fallback on safer workarounds to use EFS with ECS. |
thanks for the help @eric5102 . I had been following the steps on this blog post https://aws.amazon.com/blogs/compute/using-amazon-efs-to-persist-data-from-amazon-ecs-containers/ but ran into issues as I am using the Jenkins official Docker image, which does not run as root. I was hoping using a volume driver might give a better experience, but maybe it will not solve my problem anyway. Relatedly, there's a 3-year old open Docker issue with hundreds of comments which mostly appear outdated or at least the steps didn't work for me. It's been difficult to track down documentation to figure out what I can do to mount an EFS volume into a Docker container that is NOT running as root (UID = 1000 in my case) from an Amazon ECS host. Any tips or strategies greatly appreciated! |
Mounting the EFS volume works if the docker service is restarted. I've been doing this for months in Beanstalk deployments. This is also what they recommend for ECS but this works only if all your container instances (i.e. the host) mount the volumes at launch. You can't move a container on a host that does not already have the volume. This is too limited and why I was looking at netshare If you don't mind hardwiring your your efs volumes to all your ecs cluster nodes then just mount the volumes on the host with your launchConfiguration. I suggest also installing fs-cache (cachefilesd) and mounting with the fcs option as it speeds things up significantly if your container has a lot of read io |
Thanks so much @eric5102! Needing to restart docker after mounting the volume was what I was missing. The results of not doing so we're very misleading: container starts and mounts a volume but with the wrong permissions and persisted across restarts... very mysterious as I couldn't determine where on the file system data was being stored. After unmounting the efs volume my data was revealed, hidden behind where the efs volume had been mounted. Mysterious, but probably because I just don't understand how docker interacts with mounts |
And still ECS requires docker to be restarted in order to mount an EFS volume.. |
To keep it simple you need to accept the host to mount necessary volumes for the cluster. Just have the LaunchConfiguration for your AutoScalingGroup mount volumes when the ec2 instance is started and immediately restart docker. It does mean all volumes must be mounted on all cluster nodes but that kind of limitation can be lived with until more flexibility is possible. Things will change within a few months ps: the problem is actually how Docker handles resources, not ECS, but this will change too |
This is on the latest Amazon Linux with docker 1.11.2
docker-volume-netshare :: Version: '0.20' - Built: '2016-08-28T20:15:48Z'
/etc/init.d/docker
to prevent it to mount in a separate namespace (i.e. removing$unshare" -m
). Is there a way to make it work without editing/etc/init.d/docker
and without restarting the service?Why is it attempting to resolve the IP when unmounting?
example:
docker run -it --volume-driver=efs -v fs-xxxxxxxxx:/mount ubuntu /bin/bash
However mounting the same volume on the same host with a different container returns an error:
What I am seeing in the daemon logs shows the name is not built correctly so it doesn't resolve:
What can cause the volumeID to be changed to
3a48cd86e6cfca49b1015dc61789eb2c3e41624e81a9d75d2f8d494dc0d3bb7f
? And why would it happen only with some containers?I tried starting the daemon with
–noresolve
and run the container with the endpoint IP instead but I am getting the same error 32 and the daemon doesn't try to mount by IP:Any clue appreciated
Eric
The text was updated successfully, but these errors were encountered: