这是我的设置:一台 NFS 服务器机器,两台 NFS 客户端机器。
客户端机器将文件写入 NFS 挂载,但偶尔,文件不会出现在 NFS 服务器机器或其他客户端机器上......
我完全被这个难住了……任何帮助将不胜感激!
不立即出现还是一段时间不出现?
默认情况下,NFS 将在系统的内核级别执行目录和文件内容的缓存级别。如果机器 1 更新了文件,而机器 2 仍然在缓存中获得了该文件的副本,那么如果机器 2 尝试访问该文件,则在其缓存到期之前,它可能看不到该文件的较新版本。
检查 nfs 的手册页以获取以下参数:
acregmin=n The minimum time in seconds that attributes of a regu-
lar file should be cached before requesting fresh
information from a server. The default is 3 seconds.
acregmax=n The maximum time in seconds that attributes of a regu-
lar file can be cached before requesting fresh informa-
tion from a server. The default is 60 seconds.
acdirmin=n The minimum time in seconds that attributes of a direc-
tory should be cached before requesting fresh informa-
tion from a server. The default is 30 seconds.
acdirmax=n The maximum time in seconds that attributes of a direc-
tory can be cached before requesting fresh information
from a server. The default is 60 seconds.
actimeo=n Using actimeo sets all of acregmin, acregmax, acdirmin,
and acdirmax to the same value. There is no default
value.
noac Disable all forms of attribute caching entirely. This
extracts a significant performance penalty but it
allows two different NFS clients to get reasonable
results when both clients are actively writing to a
common export on the server.
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
6163 次 |
| 最近记录: |