【问题标题】:How to disable autofs client mount caching如何禁用 autofs 客户端挂载缓存
【发布时间】:2015-10-06 14:33:31
【问题描述】:

我有以下linux环境配置 机器 1:Samba 服务器

[share]
    comment = Data
    path = /share
    force create mode = 0777
    force directory mode = 0777
    force user = root
    force group = root
    writeable = Yes
    read only = No
    guest ok = Yes

机器 2:安装点到机器 1 共享文件夹,使用 autofs 服务。 auto.app 文件内容:

/store -fstype=cifs,cache=none,forcedirectio,noac ://machine1/share 

机器 3:安装点到机器 1 共享文件夹,使用 autofs 服务。 auto.app 文件内容:

/store -fstype=cifs,cache=none,forcedirectio,noac ://machine1/share

我面临的问题是,如果我要更新机器 2 上 /store 文件夹下的文件,则更改需要几秒钟(~5 秒)才能在 /store 文件夹下的机器 3。我希望更改立即在机器 3 上可用。我不关心任何性能影响。

对我来说这似乎是一个缓存问题,但到目前为止我找不到禁用它的方法。到目前为止,我尝试的是传递 cache=none,forcedirectio,noac 参数,但没有成功。

有什么想法吗?

谢谢

【问题讨论】:

    标签: linux mount nfs samba


    【解决方案1】:

    我知道已经很晚了,但是在 RHEL 5.8 上,echo 0 > /proc/fs/cifs/LookupCacheEnabled 在系统级别禁用了缓存。

    LookupCacheEnabled 文件具有 CIFS 配置,用于在刷新缓存之前等待的秒数。通过将值设置为 0,您将禁用缓存。希望它可以帮助某人。

    【讨论】:

      【解决方案2】:

      我解决缓存问题的方法是删除 samba 并安装 nfs

      【讨论】:

        猜你喜欢
        • 2018-06-06
        • 1970-01-01
        • 2010-11-02
        • 2010-10-26
        • 2013-02-01
        • 2015-11-11
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多