配置nfs服务
开放/nfs/shared目录,供所有用户查询资料;开放/nfs/upload目录,供所有用户上传下载资料。
首先第一步是装包
[root@localhost ~]# mount /dev/sr0 /mnt
mount: /mnt: WARNING: device write-protected, mounted read-only.
[root@localhost ~]# yum install rpcbind -y
[root@localhost ~]# yum install nfs-utils -y
编辑主配置文件/etc/exportfs
[root@localhost ~]# vim /etc/exports
/nfs/shared *(ro)
/nfs/upload *(rw)
创建对应目录,并向里面写入文件测试
[root@localhost ~]# mkdir /nfs/shared -p
[root@localhost ~]# echo this is test > /nfs/shared/test
[root@localhost ~]# cat /nfs/shared/test
this is test
[root@localhost ~]# mkdir /nfs/upload
[root@localhost ~]# echo this is test > /nfs/upload//test
[root@localhost ~]# cat /nfs/upload/test
this is test
因为/nfs/upload目录是要实现上传下载,所以要修改目录权限
[root@loca