Fedora 15 NFS Server

来源:互联网 发布:淘宝代运营公司排名 编辑:程序博客网 时间:2024/05/22 14:54
NFS Server
2011/05/27
      
Configure NFS Server to share any directories on your Network.
[1]     It's the Configuration on the system you want to build NFS server.
[root@master ~]#yum -y install nfs-utils
[root@master ~]#vi /etc/idmapd.conf
# line 5: uncomment and change to your domain name

Domain =server.world
[root@master ~]#vi /etc/exports
# write like below *note

/home 10.0.0.0/24(rw,sync,no_root_squash,no_all_squash)
# *note
/home⇒ shared directory

10.0.0.0/24⇒ range of networks NFS permits accesses

rw⇒ writable

sync⇒ synchronize

no_root_squash⇒ enable root privilege

no_all_squash⇒ enable users' authority
[root@master ~]#/etc/rc.d/init.d/rpcbind start

Starting rpcbind (via systemctl):
Starting rpcbind: [ OK ]

[ OK ]
[root@master ~]#/etc/rc.d/init.d/nfslock start
Starting nfslock (via systemctl): Starting NFS statd: [ OK ]
[ OK ]
[root@master ~]#/etc/rc.d/init.d/nfs start
Starting nfslock (via systemctl):
Starting NFS statd: [ OK ]
Starting nfs (via systemctl): Starting rpcsvcgssd (via systemctl): [ OK ]
[ 588.419461] RPC: Registered udp transport module.
[ 588.419804] RPC: Registered tcp transport module.
[ 588.420145] RPC: Registered tcp NFSv4.1 backchannel transport module.
[ 588.457779] Installing knfsd (copyright (C) 1996 okir@monad.swb.de).
Starting NFS services: [ OK ]
Starting NFS daemon: [ 588.758896] NFSD: Using /var/lib/nfs/v4recovery as the NFSv4 state recovery directory
[ 588.759539] NFSD: starting 90-second grace period
[ OK ]
Starting NFS mountd: [ OK ]
Starting RPC idmapd: [ OK ]
[ OK ]
[root@master ~]#chkconfig rpcbind on
[root@master ~]#chkconfig nfslock on
[root@master ~]#chkconfig nfs on



mount.nfs: access denied by server while mounting 192.168.0.213:/home/light/nfsshare
此条问题的解决方法。
    在使用fedora13及以后版本 的nfs服务的时候,它的配置与以前有了一定的区别,这里把fedora13前的配置也列一下,安转nfs程序就不说了,在配置nfs的时候,只要在 /etc/exports文件里写入如:"/root/work/nfs 192.168.0.*(rw,sync,no_root_squash)“  保存后重启nfs服务就可以通过本地挂载测试了,但在fedora13中这样还不行,fedora13默认使用NFS4, 这时候挂载将会出下面的错误提示:
    # mount -t nfs 192.168.1.103:/root/work/nfs /mnt
    mount.nfs: access denied by server while mounting 192.168.1.103:/root/work/nfs

        需要修改/etc/sysconfig/nfs文件,将
    # Turn off v2 and v3 protocol support
    #RPCNFSDARGS="-N 2 -N 3"
    # Turn off v4 protocol support
    #RPCNFSDARGS="-N 4"    //这句前面的#去掉就可以了。s