You are not logged in.

#1 2018-12-31 17:49:45

vinsanity82
Member
Registered: 2015-10-23
Posts: 3

[SOLVED] Docker Volume: NFS Connection Refused

I am having trouble mounting a Docker volume. The Docker volume was created using the docker volume create command, and is backed by an NFS share.

Environment:

  • Arch Linux at 10.0.2.5 - the Docker host

  • Ubuntu Server 16.04 at 10.2.0.4 - the NFS server.

On Ubuntu, the export is configured as

/etc/exports

/var/nfs/docker/ghost-content *(rw,sync,no_subtree_check,no_root_squash)

On Arch, the client has nfs-utils installed. It seems to mount fine through the command line.I am able to add/remove/read files and directories to the /tst directory on Arch.

arch$ sudo mkdir /tst
arch$ sudo mount 10.0.2.4:/var/nfs/docker/ghost-content /tst
<do testing>
arch$ sudo umount /tst

I create a docker volume like this:

arch$ docker volume create \
--opt type=nfs \
--opt o=addr=10.0.2.4 \
--opt device=:/var/nfs/docker/ghost-content \
ghost-content

That step itself returns no errors, however, when I actually try to start the docker container, I get a connection refused error.

ERROR: for ghost  Cannot create container for service ghost: b"error while mounting volume with options:
type='nfs' device=':/var/nfs/docker/ghost-content' o='addr=10.0.2.4':
connection refused"

The Arch machine definitely seems to be able to communicate with the Ubuntu machine. Various error messages I saw through testing. They all were identical to the error above, except for the last line.

  • Ubuntu Powered Off: no route to host

  • Ubuntu Powered On, No shares configured in /etc/exports: permission denied

  • Ubuntu Powered On, Shares configured in /etc/exports, did not create /ghost-data directory on Ubuntu: no such file or directory.

Testing on a Debian based Docker host, I am able to mount the volume successfully (running the exact same docker volume create command).

Any suggestions on next steps for troubleshooting this?

Thanks!

Last edited by vinsanity82 (2019-01-03 04:42:52)

Offline

#2 2019-01-03 04:40:23

vinsanity82
Member
Registered: 2015-10-23
Posts: 3

Re: [SOLVED] Docker Volume: NFS Connection Refused

I found a resolution on this somewhat related reddit thread

Turned out to be an NFS v4 versus NFS v3 issue. Was able to mount the volume by changing the type argument in docker volume create from nfs to nfs4.

arch$ docker volume create \
--opt type=nfs4 \
--opt o=addr=10.0.2.4 \
--opt device=:/var/nfs/docker/ghost-content \
ghost-content

For future reference, if anyone could point me to logs that would have explicitly stated that the version 3 versus 4 was the problem, that would be helpful!

Offline

Board footer

Powered by FluxBB