NFS中的soft mount和 hard mount以及silent data corruption

来源:互联网 发布:网络管理队伍状况分析 编辑:程序博客网 时间:2024/06/05 00:15

当发生网络或NFS服务器端故障时,选用hard-mount选项会引起NFS客户端的程序挂起,而soft-mount则不会。

soft-mount: 当客户端加载NFS不成功时,重试retrans设定的次数.如果retrans次都不成功,则放弃此操作,返回错误信息 "Connect time out"

hard-mount: 当客户端加载NFS不成功时,一直重试,直到NFS服务器有响应hard-mount 是系统的缺省值。在选定hard-mount 时,最好同时选 intr , 允许中断系统的调用请求,避免引起系统的挂起。当NFS服务器不能响应NFS客户端的 hard-mount请求时, NFS客户端会显示"NFS server hostname not responding, still trying


from:http://hi.baidu.com/wa0362/item/8d7b1c2c0abbd8d7a417b6c5


hard mount命令:mount -t nfs –o hard 192.168.1.4:/home/cao /home/nfs/cao


使用hard还是soft主要取决于访问的信息。例如,要查看NFS服务器的视频文件,不会希望由于一些意外的情况(如网络速度变得很慢)而使系统输出大量的错误信息。如果此时使用hard方式,系统就会等待,直到能够重新与NFS服务器建立连接传输信息。

from http://book.51cto.com/art/200808/85192.htm


Soft-mounts 会带来silent data corruption

According to the nfs man page, and every other source on the internet, this leads to silent data corruption because applications get told prematurely that a write was successful when in fact the data is still in cache, unable to be written to the NFS server that we just lost connection to.

So you need to make sure that your application could deal with these kind of situations.


from https://www.centos.org/forums/viewtopic.php?t=8787


A soft timeout may cause silent data corruption if it occurs during data or metadata transmissions, so you should only use soft mounts in the cases where client responsiveness is more important than data integrity. If you require the use of soft mounts over an unreliable link such as DSL, try using TCP, which is what Solaris uses by default. This will help manage the impact of brief network interruptions. If using TCP is not possible, then you should reduce the risk of using soft mounts with UDP by specifying long retransmission timeout values and a relatively large number of retries in the mount command options (i.e., timeo=30, retrans=10).

from http://nfs.sourceforge.net/#faq_e4

0 0
原创粉丝点击