美文网首页
NFS配置项说明

NFS配置项说明

作者: 二手三流科学家 | 来源:发表于2019-05-06 20:40 被阅读0次

man nfs:
NFS was developed to allow file sharing between systems residing on a local area network.
所以,NFS的理想使用场景是多台客户端挂在在同一主机端的配置。

关于开机自动挂载:
如果将挂载写在/etc/fatab中,可以使用如下格式:
server:path /mountpoint fstype option,option,... 0 0

fg / bg:

Determines how the mount(8) command behaves if an attempt to mount an export fails. 
The fg option causes mount(8) to exit with an error status if any part of the mount request times out or fails outright. 
This is called a "foreground" mount, and is the default behavior if neither the fg nor bg mount option is specified.

If  the  bg option is specified, a timeout or failure causes the mount(8) command to fork a child which continues to attempt to mount the export.  
The parent immediately returns  with a zero exit code.  
This is known as a "background" mount.

If  the  local  mount point directory is missing, the mount(8) command acts as if the mount request timed out.  
This permits nested NFS mounts specified in /etc/fstab to proceed in any order during system initialization, even if some NFS servers are not yet available.
Alternatively these issues can be addressed using an automounter (refer to automount(8) for details).

retry:

The number of minutes that the mount(8) command retries an NFS mount operation in the foreground  or background before giving up.  
If this option is not specified, the default value for foreground mounts is 2 minutes, and the default value for background  mounts  is  10000 minutes  (80  minutes shy of one week).  
If a value of zero is specified, the mount(8) command exits immediately after the first failure.

也就是说,为了尽可能成功挂载服务器的exposts目录,option给成bg,这样,如果在开机过程中,挂载失败,那么,依然会有一个进程执行mount命令,直到挂载成功或者时间到了10000分钟。

遗留问题:
成功挂载后,如果要关机,不首先umount是不行的,关机过程会一直卡住,这是为什么?

如果文件操作失败,NFS会做些什么。

  1. 等待timeo deciseconds长的时间
  2. 重新发起NFS Request
  3. 都失败了,
    The NFS client generates a "server not responding" message after retrans retries, then attempts further recovery (depending on whether the hard mount option is in effect).

相关文章

网友评论

      本文标题:NFS配置项说明

      本文链接:https://www.haomeiwen.com/subject/vvmnjqtx.html