NFS企业上机实战

1.在NFS服务器A上共享 /data/w_shared/data/r_shared 两个文件目录,允许从NFS客户端B,C上分别挂载共享目录后实现从B,C上只读/data/r_shared ,可写/data/w_shared

2.NFS客户端B上的挂载点为/data/b_w(写),/data/b_r(读)

3.NFS客户端C上的挂载点为/data/w_qzc(写),/data/r_qzc(读)

4.从NFS客户端B上的NFS可写挂载耟目录创建任意文件,从C上可以删除这个创建的文件,反之也可以。

#服务端配置  [[email protected] ~]# vim /etc/exports  添加  /data/w_shared 0.0.0.0/24(rw,sync)  /data/r_shared 0.0.0.0/24(ro)    [[email protected] ~]# mkdir /data/w_shared /data/r_shared -p  [[email protected] ~]# chown -R nfsnobody /data/w_shared/ /data/r_shared  [[email protected] ~]# /etc/init.d/rpcbind restart  [[email protected] ~]# /etc/init.d/nfs restart  [[email protected] ~]#chkconfig nfs on  [[email protected] ~]#chkconfig rpcbind on  [[email protected] ~]#/etc/init.d/iptables stop  [[email protected] ~]#getenforce  [[email protected] ~]#showmount -e 127.0.0.1   //测试  
#B客户端配置,挂载    [[email protected] ~]#mkdir /data/{b_w,b_r} -p  [[email protected] ~]#showmount -e 192.168.1.99  [[email protected] ~]#/etc/init.d/rpcbind restart  [[email protected] ~]#chkconfig rpcbind on  [[email protected] ~]#mount -t nfs 192.168.1.99:/data/w_shared /data/b_w/  [[email protected] ~]#mount -t nfs 192.168.1.99:/data/r_shared /data/b_r/  [[email protected] ~]#df -h //检查  
#C客户端配置,挂载    [[email protected] ~]#mkdir /data/{w_qzc,r_qzc} -p  [[email protected] ~]#showmount -e 192.168.1.99  [[email protected] ~]#/etc/init.d/rpcbind restart  [[email protected] ~]#chkconfig rpcbind on  [[email protected] ~]#mount -t nfs 192.168.1.99:/data/w_shared /w_qzc/  [[email protected] ~]#mount -t nfs 192.168.1.99:/data/r_shared /r_qzc/  [[email protected] ~]#df -h //检查  
#挂载优化     读取限制       写入限制     不更新时间  rsize=32768,wsize=32768,intr,noatime    mount -t nfs -o rsize=32768,wsize=32768,intr,noatime 192.168.1.99:/data/w_shared /w_qzc/  

原文出处:qinzc -> https://www.qinzc.me/post-83.html

本站所发布的一切资源仅限用于学习和研究目的;不得将上述内容用于商业或者非法用途,否则,一切后果请用户自负。本站信息来自网络,版权争议与本站无关。您必须在下载后的24个小时之内,从您的电脑中彻底删除上述内容。如果您喜欢该程序,请支持正版软件,购买注册,得到更好的正版服务。如果侵犯你的利益,请发送邮箱到 [email protected],我们会很快的为您处理。