NFS服务的开启过程(1)(2)
NFS服务配置:
- less /etc/exports
- /home/xx/ 192.168.0.*(rw,sync)
- $ sudo /etc/init.d/portmap start
- * Starting portmap daemon...
- * Already running. [ OK ]
- $sudo /etc/init.d/nfs-common start
- * StartingNFScommon utilities [ OK ]
- $ sudo /etc/init.d/nfs-kernel-server start
- * Exporting directories forNFSkernel daemon...
- exportfs: /etc/exports [2]: Neither 'subtree_check' or 'no_subtree_check' specified for export "192.168.0.*:/home/xx/".
- Assuming default behaviour ('subtree_check').
- NOTE: this default will change with nfs-utils version 1.1.0
- [ OK ]
- * Starting NFS kernel daemon [ OK ]
- $ showmount -e
- Export list for Qunhome:
- /home/xx 192.168.0.*
注意:似乎都好了,可是 :
- sudo mount 192.168.0.100:/home/xx /mnt
- 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).
- 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:
- Code Listing 2.10: hosts.allow
- portmap:192.168.1.0/255.255.255.0
- Edit the /etc/exports file of the master node to export a work directory structure (/home is good for this).
- Code Listing 2.11: /etc/exports
- /home/ *(rw)
把hosts.deny删除.子网用掩码的方法表示.
评论暂时关闭