nfs安装部署
[root@IM-web-01 ~] rpm -qa |grep nfs-utils rpcmind #检查软件是否安装
[root@IM-web-01 ~] yum -y install nfs-utils rpcmind #如果没有则使用yum安装
[root@IM-web-01 ~] chkconfig rpcmind on
[root@IM-web-01 ~] chkconfig nfs on
编辑配置文件将需要共享的目录进行配置
exports文件格式
[客户端1 选项(访问权限,用户映射,其他)]
[root@IM-web-01 ~] vim /etc/exports
/data 10.0.11.0/24(rw,sync,no_root_squash,no_all_squash)
客户端挂载
[root@IM-web-01 ~] mount -t nfs -o nosuid,noexec,bg,soft 172.16.211.48:/data /data/
nfs常用目录
/etc/exports #NFS服务的主要配置文件
/usr/sbin/exportfs #NFS服务的管理命令
/usr/sbin/showmount #客户端的查看命令
/var/lib/nfs/etab #记录NFS分享出来的目录的完整权限设定值
/var/lib/nfs/xtab #记录曾经登录过的客户端信息
nfs服务端参数讲解
NFS主要有3类选项:
访问权限选项
设置输出目录只读:ro
设置输出目录读写:rw
用户映射选项
all_squash:将远程访问的