3

I have an NFS server at nas.vm.lan == 192.168.122.30. It exports /srv.

I have three Docker hosts set up as a swarm at docker-gitlab-swarm1/2/3 == 192.168.122.27/28/29.

I have four volumes defined in my docker-compose file. Here is one of them; they all look like this with just some names and paths changed:

Volumes:
    gitlab-config:
        driver_opts:
            type:   "nfs"
            o:      "addr=192.168.122.30,nolock,soft,rw"
            device: ":/srv/gitlab/config"

The three services that make up Gitlab (PostgreSQL, Redis, Gitlab itself) are set to be deployed as a stack. Redis is not expected to persist any data, but PostgreSQL and Gitlab are, and the services make the appropriate references to the four named volumes.

The Redis container starts without complaint.

Since the Gitlab container depends on PostgreSQL, PostgreSQL attempts to start before it. This is the output from docker stack ps gitlab --no-trunc:

ID                          NAME                  IMAGE                                                                                                 NODE                          DESIRED STATE       CURRENT STATE                     ERROR                                                                                                                                              PORTS
vnbbmybelrsh623nkl1mc9z18   gitlab_postgresql.1   postgres:9.6.2-alpine@sha256:f88000211e3c682e7419ac6e6cbd3a7a4980b483ac416a3b5d5ee81d4f831cc9         docker-gitlab-swarm1.lan      Ready               Rejected less than a second ago   "error while mounting volume with options: type='nfs' device=':/srv/postgresql/gitlab' o='addr=192.168.122.30,nolock,soft,rw': no route to host"   

(and many more of the same)

I can mount the filesystem from the NFS server to any of the Docker hosts.

How do I cause there to become a route to the NFS server such that the volume declarations work?

2
  • i just hit this myself, ever find a solution?
    – scphantm
    Oct 7, 2019 at 16:19
  • @scphantm sorry, no, we ended up going down a different path entirely and abandoning this approach for completely unrelated reasons. Oct 8, 2019 at 17:56

1 Answer 1

0

I think this will work when setting the type to nfs4.

Volumes:
    gitlab-config:
        driver_opts:
            type:   "nfs4"
            o:      "addr=192.168.122.30,nolock,soft,rw"
            device: ":/srv/gitlab/config"

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .