Docker Community Forums

Share and learn in the Docker community.

File lock with etcd cluster on nfs volume

When I did setup an etcd cluster in a multi-architecture enviorenment, I made an odd observervation. On two of my host, etcd keept on restarting because of not beeing able to get a lock on a file in the etcd-data volume with the target folder /etcd-data/. On one of the nodes, it worked like a charm.

Now here is the fun part: on the machines where maintaining the locks failed, the nfs-common package was installed, while on the succeeding node it was not. After uninstallating nfs-common on the other nodes as well, the etcd nodes suddenly started to work stable.

The volume declaration used with/without nfs-common looks like this:

volumes:
  etcd-data:
    driver_opts:
      type: nfs 
      o: addr=192.168.200.19,nfsvers=4
      device: :/volume1/docker/etcd/data

first observation: the local driver is able to mount remote shares, even though nfs-common is not installed.
second observation: the behavior of the mounted remote share changes if nfs-common is installed or not.

Actualy both observations surprise me. Can someone explain WHY file locking does not work when nfs-common is installed? … or give me a hint on which params to set to actualy have effective file locking capabilites with nfs?