NFS服务配置:

  1. less /etc/exports  
  2. /home/xx/ 192.168.0.*(rw,sync)  
  3. $ sudo /etc/init.d/portmap start  
  4. * Starting portmap daemon...  
  5. * Already running. [ OK ]  
  6. $sudo /etc/init.d/nfs-common start  
  7. * StartingNFScommon utilities [ OK ]  
  8. $ sudo /etc/init.d/nfs-kernel-server start  
  9. * Exporting directories forNFSkernel daemon...  
  10. exportfs: /etc/exports [2]: Neither 'subtree_check' or 'no_subtree_check' specified for export "192.168.0.*:/home/xx/".  
  11. Assuming default behaviour ('subtree_check').  
  12. NOTE: this default will change with nfs-utils version 1.1.0  
  13. [ OK ]  
  14. * Starting NFS kernel daemon [ OK ]  
  15. $ showmount -e  
  16. Export list for Qunhome:  
  17. /home/xx 192.168.0.* 

注意:似乎都好了,可是 :

  1. sudo mount 192.168.0.100:/home/xx /mnt  
  2. mount: 192.168.0.100:/home/xx failed, reason given by server: Permission denied 

在/etc/exports下写入你的IP地址,不要有*号.例如:(/home/zwg IP(rw,sync,no_root_squash))

原因可能是etc目录下没有hosts.allow和hosts.deny这俩个文件.

配置portmap的时候,在etc目录下就没有找到host.allow和hosts.deny这俩个文件,我是自己新建的这俩个文件,以前我记得在etc目录下是有的.

我删除了安装文件和所有相关配置文件,然后一步步重新来,最后成功了

做的改动为:

在etchosts中用IP lists 代替 *

还有一种方法:安装配置NFS服务的没有大问题.不妨在括号里加上no_subtree_check选项,这是减少文件共享访问检查的,如果你的共享目录在本地没有很多读写请求的话man exports).

  1. On the master node, edit your /etc/hosts.allow file to allow connections from slave nodes. If your cluster LAN is on 192.168.1.0/24, your hosts.allow will look like:  
  2. Code Listing 2.10: hosts.allow  
  3. portmap:192.168.1.0/255.255.255.0  
  4. Edit the /etc/exports file of the master node to export a work directory structure (/home is good for this).  
  5. Code Listing 2.11: /etc/exports  
  6. /home/ *(rw) 

把hosts.deny删除.子网用掩码的方法表示.


相关内容