192.168.1.12 作为主机
192.168.1.11 作为客户端
192.168.1.10 作为客户端
1、在主机上配置
[[email protected] ~]# vi /etc/exports
/home/youchou/ROOT/upload 192.168.1.10(rw,sync,root_squash)
/home/youchou/index 192.168.1.10(rw,sync,root_squash)
/home/youchou/ROOT/upload/ 192.168.1.11(rw,sync,root_squash)
/home/youchou/index 192.168.1.11(rw,sync,root_squash)
2、在主机上配置
[[email protected] ~]# exportfs -rv
exporting 192.168.1.10:/home/youchou/index
exporting 192.168.1.11:/home/youchou/index
exporting 192.168.1.10:/home/youchou/ROOT/upload
exporting 192.168.1.11:/home/youchou/ROOT/upload
[[email protected] ~]#
3、在客户端挂载
mount -t nfs 192.168.1.12:/home/youchou/ROOT/upload/ /home/youchou/ROOT/upload/
mount -t nfs 192.168.1.12:/home/youchou/index/ /home/youchou/index/
4、问题
1)mount: 192.168.1.111:/utuLinux failed, reason given by server: Permission denied
查看配置文件exports,是否为允许挂载的客户。
2)mount: RPC: Unable to receive; errno = No route to host
首先看是否在同一网段
再者输入:
[[email protected] etc]# service iptables status
看防火墙是否开启,有则将其关闭
[[email protected] etc]# service iptables stop
3)mount: RPC: Unable to receive; errno = Connection refused
首先看nfs服务是否开启,其次看rpcbind是否开启,如果rpcbind没有运行,那在重新开启rpcbind后,要再restart nfs服务,因为重启rpcbind已对nfs的一些配置造成影响,需要restart.