在安装NFS中会遇到的问题

来源:互联网 发布:美工助理招聘广州 编辑:程序博客网 时间:2024/06/05 19:45

在安装NFS中会遇到的问题

1,通过yum或者rpm安装完portmap后,发现执行命令serviceportmap start时报如下错误:portmap: unrecognized service

 CentOS6Linux Kernel2.6.32)中,portmap已经被rpcbind代替了,仔细查看安装信息就会发现,执行命令yum install portmap时安装的就是rpcbind。安装完成后也可以通过命令:yum whatprovides portmap来查看详细信息。

2,客户端挂载时,报错误mountclntudp_create: RPC: Port mapper failure - RPC: Unable to receive

通过命令rpcinfo-p来查看portmap服务时候正常启动以及相应的端口(默认111)

检查/etc/sysconfig/iptables防火墙设置,允许tcpudp111端口访问,然后serviceiptables restart

检查/etc/hosts.deny/etc/hosts.allow看客户端连接是否被阻止了

3,客户端执行命令showmount -enfs-server时,报错误:mount clntudp_create: RPC: Program not registered

 nfsrpcbind服务没有启动,使用chkconfignfsrpcbind加到系统服务中并用service来启动或者在/etc/hosts.allow中添加允许客户端访问的规ALL:192.168.0.135

4,客户端执行命令showmount -enfs-server时,报错误:rpc mount export: RPC: Unable to receive; errno = No route to host

 配置文件:/etc/sysconfig/nfs,找到nfs服务相关端口设置的地方,并移除注释后,在iptables防火墙设置中指定允许相应端口的Udptcp流通过。

#MOUNTD_PORT=892

#STATD_PORT=662

#LOCKD_TCPPORT=32803

#LOCKD_UDPPORT=32769

iptables -A INPUT -p TCP --dport 662 -mstate --state NEW -j ACCEPT

iptables -A INPUT -p UDP --dport 661 -mstate --state NEW -j ACCEPT

 5, showmount -e nfs-server成功,正式挂载时报错:mount:mount to NFS server '192.168.1.5' failed: System Error: No route to host.

nfs服务的默认端口2049被防火墙阻塞了,和上面类似修改iptables允许2049端口通过

6, showmount -e nfs-server成功,正式挂载时报错:mount:mount to NFS server '192.168.1.5' failed: timed out (retrying).

 编辑/etc/sysconfig/iptables时,相关端口的tcp端口允许通过,而udp不允许。其他可能的原因参考:mount command fails with NFS server failed error.

Disable name lookup requests from NFSserver to a DNS server. 

or NFS version used by the NFS client is other than version 3.

7exports配置文件中目录权限属性设置为rw(默认为root_squash),但是在客户端mount目录执行touch命令时报错误:touch: cannot touch `a': Permission denied

解决:服务器端共享目录权限查看ll-d /home修改服务器端共享目录权限chown 760 /home(文件所有者root有全权限、文件所有组用户有读写权限、其他用户无权限,然后把目录的组设置为nfsnobody)

修改服务器端共享目录权限组拥有者为nfsnobody(cat /etc/passwd | grep nob)chgrp nfsnobody /home成功在客户端创建新的文件!

原创粉丝点击