`

NFS配置

阅读更多

SuSE Linux 9下如何开启NFS服务
1、现象、问题描述
NFS是Network File System 的简写。NFS 是由SUN公司发展, 并于1984年推出, NFS是一个RPC service ,它使我们能够达到档案的共享, 它的设计是为了在不同的系统间使用, 所以它的通讯协定设计与主机及作业系统无关.当使用者想用远端档案时只要用"mount"就可把remote档案系统挂接在自己的档案系统之下,使得远端 的档案使用上和local机器的档案没两样.

2、关键过程、根本原因分析
备注:配置和启动NFS服务需要root用户身份。

1) 配置NFS的导出目录:
编辑 /etc/exports 文件,增加要导出的目录和可访问的机器IP地址以及权限:
# See the exports(5) manpage for a description of the syntax of this file.
# This file contains a list of all directories that are to be exported to
# other computers via NFS (Network File System).
# This file used by rpc.nfsd and rpc.mountd. See their manpages for details
# on how make changes in this file effective.

/home/norton 10.164.*.*(rw,sync,no_root_squash) 127.0.0.1(rw,sync,no_root_squash)

2) 启动NFS有关服务:
切换到/etc/rc.d目录,运行:
./nfsserver start

3) 检查NFS是否启动成功:
linux:/etc # /usr/sbin/rpcinfo -p localhost | grep nfs
    100003    2   udp   2049  nfs
    100003    3   udp   2049  nfs
    100227    3   udp   2049  nfs_acl
    100003    2   tcp   2049  nfs
    100003    3   tcp   2049  nfs
    100227    3   tcp   2049  nfs_acl
linux:/etc #

4) 如何挂接NFS目录:
使用mount命令,并指定文件类型为nfs即可,例如:
mount -t nfs -o rw 127.0.0.1:/home/norton /mnt/mtest
mount -t nfs -o rw 10.164.79.99:/home/csp212/test1 /home/csp212/testlink

5) 常见问题处理:
1、mount报错:
linux:/home/csp212 # mount -t nfs -o rw 10.164.79.99:/home/csp212/test1 /home/csp212/testlink
mount server reported tcp not available, falling back to udp
mount: RPC: Program not registered

可能原因:portmap端口映射进程没有启动或防火墙问题导致。

2、mount报错:
linux:~ # mount -t nfs -o rw 127.0.0.1:/home/duanyu  /home/csp212/fileserver1
mount: 127.0.0.1:/home/duanyu failed, reason given by server: Permission denied

可能原因:NFS目录没有在exports中没有配置

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics