NFS - multiple nfs server when creating a volume

Hi,

How do you configure a multiple nfs server? any idea?

docker volume create --driver local \
    --opt type=nfs \
    --opt o=addr=192.168.1.1,rw \
    --opt device=:/path/to/dir \
    foo

Hi @echanobe
Can you be more specific with this question please?

Hi Thanks for the response. So say, I have multiple NFS servers e.g. 192.168.1.1, 192.168.1.2. When I create a volume for multiple NFS …

docker volume create
–driver local
–opt type=nfs
–opt o=addr=192.168.0.1,rw
–opt o=addr=192.168.0.2,rw
–opt device=:/private
br-nfs-volume

Then inspect it

root@worker01:~# docker volume inspect br-nfs-volume
[
{
“CreatedAt”: “2022-09-19T08:07:10+08:00”,
“Driver”: “local”,
“Labels”: {},
“Mountpoint”: “/var/lib/docker/volumes/br-nfs-volume/_data”,
“Name”: “br-nfs-volume”,
“Options”: {
“device”: “:/private”,
“o”: “addr=192.168.0.2,rw”,
“type”: “nfs”
},
“Scope”: “local”
}
]

It only shows 1 server … I want to have a multiple NFS server as a requirement.

So when you run a container and mount to the volume … this will only be mounted to 1 NFS as shown above.

–mount source=br-nfs-volume,target=/mnt/private

Do you also notice this? Looks like its a limitation?

Many Thanks

I don’t think it can be done the way you’re doing it. Try creating 2 docker volumes, mount both inside the container and then do something like this from within the container

Thank you Alistair. I will give it a try.