1、在把NFS服务器当做客户端来进行挂载测试的途中出现下面错误:
[root@master ~]# mount -t nfs 10.10.36.112:/nfsdata /mnt
mount.nfs: access denied by server while mounting 10.10.36.112:/nfsdata
此时发现上述错误:
挂载失败原因分析:
解决方案:
第一步:查看最近挂载的日志 分析发现:
cat /var/log/messages | grep mount
Apr 8 09:51:54 master-01 rpc.mountd[26157]: Version 1.3.0 starting
Apr 8 09:53:45 master-01 rpc.mountd[26157]: refused mount request from 10.10.27.90 for /nfsdata (/nfsdata): unmatched host
Apr 8 09:55:47 master-01 rpc.mountd[26157]: refused mount request from 10.10.27.90 for /nfsdata (/nfsdata): unmatched host
Apr 8 09:57:49 master-01 rpc.mountd[26157]: refused mount request from 10.10.27.90 for /nfsdata (/nfsdata): unmatched host
Apr 8 09:59:51 master-01 rpc.mountd[26157]: refused mount request from 10.10.27.90 for /nfsdata (/nfsdata): unmatched host
Apr 8 10:01:53 master-01 rpc.mountd[26157]: refused mount request from 10.10.27.90 for /nfsdata (/nfsdata): unmatched host
Apr 8 10:03:56 master-01 rpc.mountd[26157]: refused mount request from 10.10.27.90 for /nfsdata (/nfsdata): unmatched host
Apr 8 10:05:58 master-01 rpc.mountd[26157]: refused mount request from 10.10.27.90 for /nfsdata (/nfsdata): unmatched host
Apr 8 10:08:00 master-01 rpc.mountd[26157]: refused mount request from 10.10.27.90 for /nfsdata (/nfsdata): unmatched host
Apr 8 10:10:02 master-01 rpc.mountd[26157]: refused mount request from 10.10.27.90 for /nfsdata (/nfsdata): unmatched host
Apr 8 10:12:04 master-01 rpc.mountd[26157]: refused mount request from 10.10.27.90 for /nfsdata (/nfsdata): unmatched host
Apr 8 10:14:06 master-01 rpc.mountd[26157]: refused mount request from 10.10.27.90 for /nfsdata (/nfsdata): unmatched host
Apr 8 10:16:08 master-01 rpc.mountd[26157]: refused mount request from 10.10.27.90 for /nfsdata (/nfsdata): unmatched host
Apr 8 10:18:11 master-01 rpc.mountd[26157]: refused mount request from 10.10.27.90 for /nfsdata (/nfsdata): unmatched host
Apr 8 10:20:13 master-01 rpc.mountd[26157]: refused mount request from 10.10.27.90 for /nfsdata (/nfsdata): unmatched host
Apr 8 10:22:15 master-01 rpc.mountd[26157]: refused mount request from 10.10.27.90 for /nfsdata (/nfsdata): unmatched host
Apr 8 10:24:12 master-01 rpc.mountd[26157]: Caught signal 15, un-registering and exiting.
Apr 8 10:24:12 master-01 rpc.mountd[29833]: Version 1.3.0 starting
Apr 8 10:24:17 master-01 rpc.mountd[29833]: refused mount request from 10.10.27.90 for /nfsdata (/nfsdata): unmatched host
Apr 8 10:26:19 master-01 rpc.mountd[29833]: refused mount request from 10.10.27.90 for /nfsdata (/nfsdata): unmatched host
Apr 8 10:28:21 master-01 rpc.mountd[29833]: refused mount request from 10.10.27.90 for /nfsdata (/nfsdata): unmatched host
Apr 8 10:28:51 master-01 rpc.mountd[29833]: refused mount request from 10.10.36.112 for /nfsdata (/nfsdata): unmatched host
Apr 8 10:29:28 master-01 rpc.mountd[29833]: refused mount request from 10.10.27.87 for /nfsdata (/nfsdata): unmatched host
Apr 8 10:30:23 master-01 rpc.mountd[29833]: refused mount request from 10.10.27.90 for /nfsdata (/nfsdata): unmatched host
上述发现大多数都是unmatched host :
原因:主机不可达 那么问题肯定出在、 /etc/exports 配置 将ip直接改为* 或者对应的IP即可
改完后 一定记【上述操作属于危险操作,生产环境还是指定IP为好】
得重新reload一下nfs服务
此时我们再客户端机器执行挂载命令:
mount -t nfs 10.10.36.112:/nfsdata /mnt 【IP指的是nfs服务器的地址】
然后df -h 查看挂载情况,发现挂载成功
当然nfs挂载不成功,还有很多情况
最基本的是通过docker日志去分析