免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 49920 | 回复: 5
打印 上一主题 下一主题

[网络配置] NFS挂载超时 mount.nfs: Connection timed out [复制链接]

论坛徽章:
1
天秤座
日期:2013-09-05 10:45:07
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2014-01-28 22:07 |只看该作者 |倒序浏览
本帖最后由 howandsen 于 2014-01-28 22:09 编辑

台式机和笔记本都是Fedora 20,想用NFS共享数据。台式机(主机名localhost)作为NFS server,笔记本(主机名Emma)为client。
但是现在出现一个问题,client挂载目录总是连接超时,
  1. [root@Emma Dotcra]# mount -t nfs 192.168.1.102:/home/Dotcra Legacy/
  2. mount.nfs: Connection timed out
复制代码
家里通过宽带路由器共享上网,DHCP分配IP,台式机有线连接,IP 192.168.1.102,笔记本用无线网卡,IP 192.168.1.104,两台主机能相互ping,且对台式机NFS server的配置均是在笔记本上通过ssh完成的。说明不是网络问题。
继续排查。
/etc/hosts.allow和/etc/hosts.deny里都无内容,/etc/sysconfig/nfs为默认,未改动; /etc/exports内容如下,
  1. /home/Dotcra        192.168.1.*(rw)
复制代码
  1. [root@localhost ~]# exportfs -r
复制代码
未报错。
rpcbind与nfs服务都工作正常:

  1. [root@localhost ~]# systemctl status rpcbind
  2. rpcbind.service - RPC bind service
  3.    Loaded: loaded (/usr/lib/systemd/system/rpcbind.service; enabled)
  4.    Active: active (running) since Tue 2014-01-28 18:39:33 CST; 1h 2min ago
  5.   Process: 1704 ExecStart=/sbin/rpcbind -w ${RPCBIND_ARGS} (code=exited, status=0/SUCCESS)
  6. Main PID: 1705 (rpcbind)
  7.    CGroup: /system.slice/rpcbind.service
  8.            └─1705 /sbin/rpcbind -w

  9. [root@localhost ~]# systemctl status nfs
  10. nfs-server.service - NFS Server
  11.    Loaded: loaded (/usr/lib/systemd/system/nfs-server.service; disabled)
  12.    Active: active (exited) since Tue 2014-01-28 18:39:34 CST; 1h 2min ago
  13.   Process: 1695 ExecStopPost=/usr/sbin/exportfs -f (code=exited, status=0/SUCCESS)
  14.   Process: 1691 ExecStop=/usr/sbin/rpc.nfsd 0 (code=exited, status=0/SUCCESS)
  15.   Process: 1734 ExecStartPost=/usr/libexec/nfs-utils/scripts/nfs-server.postconfig (code=exited, status=0/SUCCESS)
  16.   Process: 1719 ExecStart=/usr/sbin/rpc.nfsd $RPCNFSDARGS $RPCNFSDCOUNT (code=exited, status=0/SUCCESS)
  17.   Process: 1715 ExecStartPre=/usr/sbin/exportfs -r (code=exited, status=0/SUCCESS)
  18.   Process: 1713 ExecStartPre=/usr/libexec/nfs-utils/scripts/nfs-server.preconfig (code=exited, status=0/SUCCESS)
  19. Main PID: 1719 (code=exited, status=0/SUCCESS)
  20.    CGroup: /system.slice/nfs-server.service
复制代码
selinux设为permissive,停止iptables,重启服务:

  1. [root@localhost ~]# setenforce 0
  2. [root@localhost ~]# systemctl stop iptables
  3. [root@localhost ~]# systemctl restart rpcbind
  4. [root@localhost ~]# systemctl restart nfs
复制代码
一系列动作后,依旧超时,会是什么问题呢?

论坛徽章:
2
辰龙
日期:2015-01-11 00:34:002015年亚洲杯之巴勒斯坦
日期:2015-01-28 10:35:37
2 [报告]
发表于 2014-01-29 02:33 |只看该作者
showmount -e 的提示是什么?

论坛徽章:
1
天秤座
日期:2013-09-05 10:45:07
3 [报告]
发表于 2014-01-29 10:57 |只看该作者
本帖最后由 howandsen 于 2014-01-29 12:08 编辑

回复 2# securitypluscn
  1. [root@localhost ~]# showmount -e
  2. Export list for localhost.localdomain:
  3. /home/Dotcra 192.168.1.*
  4. [root@Emma ~]# showmount -e 192.168.1.102
  5. clnt_create: RPC: Port mapper failure - Unable to receive: errno 113 (No route to host)
复制代码

论坛徽章:
2
辰龙
日期:2015-01-11 00:34:002015年亚洲杯之巴勒斯坦
日期:2015-01-28 10:35:37
4 [报告]
发表于 2014-01-29 23:31 |只看该作者
本帖最后由 securitypluscn 于 2014-01-29 23:57 编辑

回复 3# howandsen


试试在/etc/sysconfig/nfs 中uncomment mount_port 892。 再在防火墙上打一个892TCP的洞。重启IPTABLES和其他的相关服务后用showmount 和 mount 命令试试。如不行,把错误信息,IPTABLES 和LOG FILE 的内容贴上来看看。


   

论坛徽章:
1
天秤座
日期:2013-09-05 10:45:07
5 [报告]
发表于 2014-01-31 19:16 |只看该作者
回复 4# securitypluscn

果然还是防火墙的事,但有一点被忽略了——现在Fedora的默认防火墙是firewalld而非iptables。iptables默认就是不启动的。
systemctl stop firewalld就好了。
systemctl start/stop/restart 没有反馈信息,不然应该能早发现的。
谢谢了。新年快乐。
   

论坛徽章:
2
辰龙
日期:2015-01-11 00:34:002015年亚洲杯之巴勒斯坦
日期:2015-01-28 10:35:37
6 [报告]
发表于 2014-02-01 00:03 |只看该作者
本帖最后由 securitypluscn 于 2014-02-01 00:08 编辑

回复 5# howandsen

我这几天也为FEDORA的防火墙郁闷着呢。刚刚开始用FEDORA19.以前没用过FIREWALLD 和SYSTEMD。


   
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP