docker用local_lock = all挂载nfs [英] docker mount nfs with local_lock=all

查看:135
本文介绍了docker用local_lock = all挂载nfs的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有docker-compose.yml文件

I have docker-compose.yml file

volumes:
  nfs:
      driver: local
      driver_opts:
        type: nfs
        o: addr=192.168.100.1,rw
        device: ":/mnt/storage"

我的容器已安装了带有以下选项的卷:

my container have mounted volume with options:

type nfs (rw,relatime,vers=3,rsize=1048576,wsize=1048576,namlen=255,hard,proto=tcp,timeo=600,retrans=2,sec=sys,mountaddr=192.168.100.1,mountvers=3,mountproto=tcp,local_lock=none,addr=192.168.100.1)

使用 local_lock = none ,我无法将此选项更改为 local_lock = all 我试过了:

with local_lock=none and i can't change this option to local_lock=all I tried:

volumes:
  nfs:
      driver: local
      driver_opts:
        type: nfs
        o: addr=192.168.100.1,rw,local_lock=all
        device: ":/mnt/storage"

volumes:
  nfs:
      driver: local
      driver_opts:
        type: nfs
        o: addr=192.168.100.1,rw
        device: ":/mnt/storage"
        local_lock: all

但没有任何变化

推荐答案

所需的语法是第一种选择:

The syntax you want is the first option:

volumes:
  nfs:
      driver: local
      driver_opts:
        type: nfs
        o: addr=192.168.100.1,rw,local_lock=all
        device: ":/mnt/storage"

那只是对操作系统的一种传递.您可能看不到与该卷装入有任何区别的原因是 local_lock 被列为NFS 2或仅NFS 3选项,因此,如果您使用的是NFS 4,则该选项可能会被忽略.

That is just a pass through to the OS. The reason you likely don't see any difference with that volume mount is that local_lock is listed as an NFS 2 or NFS 3 only option, so if you're using NFS 4 that option is likely ignored.

这篇关于docker用local_lock = all挂载nfs的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆