NFS4 (TCP) over openvpn (UDP) - 可以浏览挂载,但 D/L 会将其杀死

NFS4 (TCP) over openvpn (UDP) - 可以浏览挂载,但 D/L 会将其杀死

设置成功(客户端可以通过 openvpn 浏览 nfs 并执行一些工作和文件传输),但出现了问题,因为 NFS/OpenVPN 挂载会在传输过程中失败/冻结,并且(除其他事项外)会阻止客户端重新启动。在此期间发出 #mount -l 只会挂起该终端。

客户端是 arch(现在使用 rpcbind),服务器是 ubuntu 服务器(如果相关的话,我认为它使用 portmap)。

Fstab 包含以下设置:

10.8.0.1:/  /mnt/vpn    nfs4    _netdev,udp,bg,intr,auto  0  0

# mount -l
10.8.0.1:/ on /mnt/vpn type nfs4 (rw,relatime,vers=4.0,rsize=32768,wsize=32768,namlen=255,hard,proto=udp,timeo=11,retrans=3,sec=sys,clientaddr=192.168.xxx.xxx,local_lock=none,addr=10.8.0.1,_netdev)

“bg” 是为了当以错误的顺序启动时,vpn 不会冻结启动。我相信“udp”是默认的。“intr”应该允许中断。

VPN 上的整体性能较差/较慢。我不太清楚除了客户端挂载选项之外,还有什么因素会影响此性能。非常感谢任何有关通过 openvpn 处理 nfs4 的信息/资源和/或任何其他见解或建议。谢谢。

编辑:

cat /etc/exports
/nfs4   10.8.0.0/24(rw,nohide,sync,insecure,root_squash,no_subtree_check,fsid=0)

cat /etc/default/nfs-kernel-server
# Number of servers to start up
# To disable nfsv4 on the server, specify '--no-nfs-version 4' here
RPCNFSDCOUNT=8

# Runtime priority of server (see nice(1))
RPCNFSDPRIORITY=0

# Options for rpc.mountd.
# If you have a port-based firewall, you might want to set up
# a fixed port here using the --port option. For more information,
# see rpc.mountd(8) or http://wiki.debian.org/SecuringNFS
RPCMOUNTDOPTS=--manage-gids

# Do you want to start the svcgssd daemon? It is only required for Kerberos
# exports. Valid alternatives are "yes" and "no"; the default is "no".
NEED_SVCGSSD=no

# Options for rpc.svcgssd.
RPCSVCGSSDOPTS=

# Options for rpc.nfsd.
RPCNFSDOPTS=

答案1

我认为 udp 多年来一直不是默认传输方式,除非您是一位有良好理解能力的资深用户,否则我建议删除该选项,或者明确切换回更可靠的 TCP。

您可能还想将文件中的选项添加/etc/exports到问题中以供参考,以及任何配置选项/etc/sysconfig/nfs

我希望看到记录一些错误/var/log/messages,因此您可能想检查该文件中是否有任何消息并报告这些消息。


1)http://linux.die.net/man/5/nfs -运输方式
“TCP 是所有现代 NFS 实现使用的默认传输协议。它在几乎所有可以想象到的网络环境中都表现良好,并能出色地防止因网络不可靠而导致的数据损坏。TCP 通常是通过网络防火墙安装服务器的必要条件。”

相关内容