一、系统环境
centos6
二、安装NFS服务
服务器端:
安装程序
yum -y install nfs-utils rpcbind
配置: 1、创建共享目录;(如,mkdir -p /opt/share) 2、配置export文件
vi /etc/exports
输入:/opt/share 172.25.40.21(rw,no_root_squash,no_all_squash,sync)
3、启动rpchbind、nfs服务
service rpcbind start
service nfs start
#chkconfig nfs(开机自启)
4、exprots文件生效
exportfs -r
客户端配置
1、安装nfs-utils
yum -y install nfs-utils
2、创建挂载目录
mkdir /opt/test; (目录可随便指定)
3、查看服务器抛出的共享目录信息
showmount -e 172.25.40.21
4、TCP协议挂载
mount -t nfs 172.25.40.21:/opt/share /opt/test -o proto=tcp -o nolock
5、卸载已挂在的NFS
umount /opt/test