Centos7 nfs 共享 mount远程目录

安装 NFS 服务器所需的软件包

服务器 10.44.154.200

安装nfs:yum -y install nfs-utils rpcbind

编辑exports文件

编辑/etc/exports,增加一行

/mnt/files/stone 10.170.184.39(rw,no_root_squash,no_all_squash,sync)

生效 exportfs -r

图片.png

如图xian'shi没问题

查看 exportfs

image

为rpcbind和nfs做开机启动

systemctl enable rpcbind.service
systemctl enable nfs-server.service

手动启动

命令:service rpcbind start

service nfs start

查看已共享的目录,命令:

本机:showmount -e

其他:showmount -e IP

![image](http://upload-images.jianshu.io/upload_images/6734341-9533376b568efeba?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)

安装NFS 客户端

客户端机器 10.170.184.39

systemctl enable rpcbind.service

systemctl start rpcbind.service

挂载远程目录

mount -t nfs -o nolock,nfsvers=3,vers=3 -o proto=tcp 10.44.154.200:/mnt/files/stone /home/mnt/files/stone

查看结果

image

设置开机挂载,编辑/etc/fstab

vi /etc/fstab

加上

10.44.154.200:/mnt/files/stone /home/mnt/files/stone:/ /data nfs4 ro,hard,intr,proto=tcp,port=2049,noauto 0 0

image
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • 系统环境: centos73.10.0-514.26.2.el7.x86_64 机器数量:五台 硬盘:四块一块为系...
    think_lonely阅读 4,742评论 0 5
  • 1.NFS服务  NFS:Network File System 网络文件系统,基于内核的文件系统。Sun公司开...
    尛尛大尹阅读 1,122评论 0 0
  • RHCSA部分 关于密码破解,在上午的考试中需要我们自己安装图形化界面和破解root密码,root的密码按照题目的...
    燕京博士阅读 1,689评论 0 0
  • 在iPhone开发中 Modal是一种常见的切换控制器的方式 默认是从屏幕底部往上弹出,直到完全盖住后面的内容为止...
    光明程辉阅读 652评论 1 2
  • 报文首部 请求行包含用于请求的方法,请求URI和HTTP版本。 状态行包含表明响应结果的状态码,原因短语和HTTP...
    Yix1a阅读 145评论 0 1