-
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
netshare volume plugin not working in "swarm mode" v1.12.0-rc3 with docker volume create, docker service create --mount #48
Comments
What is the output of Could you try
|
Havn't had time to play with 1.12-rc yet, however I found the following new example in the 1.12 docs Could you try the follwoing example from the doc for creation of the volume?
But I'd say that there is a problem within the new Further the following output from
I wouldn't expect to see BTW: where did you found a detailed reference to the |
Hi, It seems docker team have done some work in 1.12.0-rc4 #24484 For the --mount docs, I found this issue #24277 |
With docker v1.12.1 in swarm mode I get:
...at which point However, I'm mildly concerned. When I ran this the first time, additional volumes (previously invisible) suddenly appeared. The volumes were my previous attempts to get this to work. :-/ |
I was able to get a service to work, using that volume command. But I had to run the volume command by hand on every node in the swarm. It looks like it tried to auto-copy the volumes over, but it failed to work. :-/ |
The service command (for posterity):
|
@docwhat I can confirm that it works with your solution.
EDIT: So the question now is, why do I need docker-volume-netshare when everything seems to work out of the box? |
Could someone clarify if it is required to create the volumes on every node in the swarm in order to get this to work? currently I am getting nfs volumes in the manager, but on the rest of the nodes I just get driver=local, seems like the swarm is distributing the volumes across the nodes but does not understand that the volumes are using the netshare plugin. Furthermore, @simonwahlgren seems to manage to mount nfs using the local driver, is there any disadvantage using this approach? does it also require to create the volumes in every node? |
In Docker version 1.12.3, build 6b644ec and docker-volume-netshare_0.20: You must create nfs volume on every node, otherwise the volume will be empty. leader,node2,node3
Then ssh to node2, node3 and enter nginx, the /share is empty. |
@o3o3o As far as I know (I learnt this recently), this is the way volumes are supposed to work in swarm. The only supported way is to create the volume when creating the service: https://docs.docker.com/engine/reference/commandline/service_create/ In my opinion not a good approach, but I hope this is just because swarm node is quite new and they have not figured out everything just yet. |
Are volumes suppose to persist across docker-volume-netshare service restarts? I setup my volumes with the docker volumes command, but when restarting the docker-volume-netshare service they disappear. This worries me that the containers will lose their volumes if the host reboots. |
@blandman they will not persist. |
There's absolutely no way to define the volume when creating the service? I can get single nodes to work with the volumes, but not all nodes at the same time. |
@blandman that's my predicament, too. I don't want to have to manually create the volume on each host. |
same problem here:
So nothing but the Name of the volume is replicated to the other worker nodes. Unfortunately, the netshare-driver doesn't make this even besser. If I can help with additional infos or tests, please contact me. I would like to help making this "swarm-ready". //edited: |
Looks to me thats this is maybe a general Swarm problem, because for me even original local volumes lost there configuration when they get applied to worker nodes |
This problem has some time, so most likely won't be able to get much help, but nonetheless, I'll give it a shot, maybe someone can help... I'm trying to use the plugin with Docker Swarm. Naturally, I don't want to have to manually create the volumes on every node, that's unthinkable, so I'm using a named volume, which means that if it doesn't exist, it's created, if it does, it re-uses it. The command that I'm using to create the service is as follows
That seems to work, as it follows the parameters as when manually creating the volume. And it looks ok as well.
So, it all looked good, until I try to write to the folder mapped to the volume, where I get an unauthorized error. Can anyone shed some light on this? Maybe I'm not doing the volume creation properly via service create? Cheers |
Output of
docker version
:Output of
docker info
:Additional environment details:
netshare is running in every host, including master
https://github.com/ContainX/docker-volume-netshare/releases/download/v0.18/docker-volume-netshare_0.18_linux_amd64-bin
:sudo /var/lib/boot2docker/bin/docker-volume-netshare nfs -v 3 --basedir=/mnt
netshare is working with docker run -v
netshare is not working with
docker volume create
+docker service create
Nothing is mounted ...
docker service inspect test10
shows:docker service tasks test10
shows:Inside
swnode-1
docker ps -a
shows:And finally,
docker inspect 463fd2f94510
shows:Inside the container
test10.1
a folder named/mnt:ro,nocopy
is created.$ docker exec 463fd2f94510 /bin/ls /
If I change the
target=
to any other folder, I still getting 'folder_name:ro,nocopy' created inside the container.The text was updated successfully, but these errors were encountered: