centos共享远程目录

admin6年前IT技术1324

服务器端设置:
1.安装依赖包 yum -y install nfs*
2.修改文件vim /etc/exports   添加如下内容
    /要共享的目录路径   客户端ip/24(rw,no_root_squash,sync,no_wdelay)
3.启动nfs,rpcbind,并设为开机自启
(centos7)
systemctl start nfs
systemctl start rpcbind
systemctl enable nfs
systemctl enable rpcbind
4.查看是否共享成功
showmount -e localhost
5.关闭防火墙
systemctl stop firewalld
systemctl disable firewalld.service
客户端设置:
 1.安装依赖包 yum -y install nfs*  
2.启动nfs (centos7)
systemctl start nfs
systemctl start rpcbind
systemctl enable nfs
systemctl enable rpcbind
3.检测服务器 showmount -e 服务器IP
4.网络挂载  这一步可以不操作
mount -t nfs -o nolock 服务端IP:共享目录绝对路径 本地挂载目录
5.开机自动挂载
vi /etc/fstab # 新增一行 服务端IP:/服务器目录/      /本地目录 nfs4 defaults 0 0
centos7的nfs默认使用的是nfs4,所以mount -t 无需指定nfs4也可以

 

 

相关文章

VB封装ASP 记录集

 定义字符VERSION 1.0 CLASSBEGIN  MultiUse = -1  'True ...

过滤emoji表情的正则表达式

\p{Cs}?imageView2/2/w/300/interlace/1/q/90^[\u4e00-\u9fa5]+$...

汇成游戏发布网站系统v1.1

汇成游戏发布网站系统v1.1˂a href="shengji/gamefbv11.rar" target="_blank"˃官方下载在空余时间开发了一套简单,体积很小的游戏发布网站,由于时间仓促,可能...

在Hyper-V 虚拟机环境设置centos 7固定IP

在Hyper-V 虚拟机环境设置centos 7固定IP

Hyper-V 管理器的自动停止操作的选项里,设置"保持虚拟机状态"如下图所示:...

未命名

<?phpnamespace Article;class Comment { }namespace MessageBoard;class Comment { }//调用当前空间(MessageB...

sublime编译运行PHP

创建PHP编译系统添加 PHP 的 build system,如图所示, Tools->Build System-> New Build System :新建一个,默认的内容是:{&nbs...

发表评论    

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。