一、首先检查系统是否安装了所需的安装包(nfs-utils、rpcbind):ide
[root@v1 ~]# rpm -qa | grep rpcbind
rpcbind-0.2.0-11.el6.x86_64
[root@v1 ~]# rpm -qa | grep nfs
nfs-utils-1.2.3-39.el6.x86_64
nfs4-acl-tools-0.3.3-6.el6.x86_64
nfs-utils-lib-1.1.5-6.el6.x86_64spa
二、若是结果如上图所示, 说明系统中已经安装了nfs所须要的软件; 不然须要安装, 能够用yum命令安装:orm
[root@v1 ~]# yum -y install nfs-utils rpcbindblog
三、建立共享目录:rpc
[root@v1 ~]# mkdir /opt/share
get
四、NFS共享文件路径配置:博客
编辑 /etc/exports添加以下一行:it
[root@v1 ~]# vi /etc/exports
/opt/share *(rw,sync,no_root_squash)io
五、启动NFS服务(先启动rpcbind,再启动nfs)class
[root@v1 ~]# service rpcbind start
Starting rpcbind: [ OK ]
六、设置NFS服务开机自启动:
[root@v1 ~]# chkconfig rpcbind on
[root@v1 ~]# chkconfig nfs on
本文出自 “sky” 博客,请务必保留此出处http://songky.blog.51cto.com/164603/1887485