1、查看NFS软件包
       [root@server7 ~]# rpm -qa | egrep "nfs|rpcbind"
2、安装NFS和RPC服务
       [root@server7 ~]# yum install nfs-utils  rpcbind -y
3.启动NFS服务之前先启动rpcbind服务
查看rcpbind状态
[root@server7 ~]# systemctl status rpcbind
默认未启动,系统开机重启后不启动,启动nfs服务,将设置为开机启动。
[root@server7 ~]# systemctl start rpcbind
[root@server7 ~]# systemctl enable rpcbind
启动NFS后我们再次查看rpc注册的端口信息
[root@server7 ~]# rpcinfo -p localhost
4.RPC服务启动后再启动NFS服务
查看状态
[root@server7 ~]# systemctl status  nfs
默认未启动,系统开机重启后不启动,启动nfs服务,将设置为开机启动。
[root@server7 ~]# systemctl start nfs
[root@server7 ~]# systemctl enable nfs
5.在确认启动没用问题后我们看一看NFS到底开了哪些端口
[root@server7 ~]# netstat -tulnp |grep -E '(rpc|nfs)'
6.配置NFS服务
[root@server7 etc]# vi /etc/exports
/data 172.16.53.153(rw,sync) 
#[共享目录]   [客户端地址1(权限)]        [客户端地址2(权限)]
1)待共享的目录 存东西的目录 取东西的目录例如:/data
2)访问的主机,
172.16.1.7 单个主机
172.16.1.0/24 网段
172.16.1.* 网段
master 主机名
3)()权限
rw 可读写 read write
ro 只读 read only
sync 写到磁盘才算完成,安全 慢
async 异步写到远程缓冲区,快 不安全
7.创建目录
[root@nfs01 ~]# mkdir -p /data
[root@nfs01 ~]# ls -ld /data
drwxr-xr-x 2 root root 51 4月 16 10:24 /data3
8.NFS默认用户nfsnobody
[root@nfs01 ~]# grep nfsno /etc/passwd
nfsnobody:x:65534:65534:Anonymous NFS User:/var/lib/nfs:/sbin/nologin
[root@nfs01 ~]# chown -R nfsnobody.nfsnobody /data3
[root@nfs01 ~]# ls -ld /data
drwxr-xr-x 2 nfsnobody nfsnobody 51 4月 16 10:24 /data3
9.重启NFS
[root@nfs01 ~]# systemctl reload nfs #《==生产场景必须要实现平滑重启。
[root@nfs01 ~]# exportfs -r
上述二者等价,选一个即可。
10.在客户端上安装nfs-utils  rpcbind
yum install nfs-utils  rpcbind
11.查看目录和挂载目录
[root@nfs01 ~]# showmount -e 172.16.5.152
Export list for 172.16.53.152:
/data3 172.16.5.153
服务单本地挂载:
[root@nfs01 ~]# mount -t nfs 172.16.5.152:/data3 /mnt
[root@nfs01 ~]# df -h
关于客户端挂载命令
执行命令showmount -e xxx.com,查看已创建的NFS共享。
执行命令mount -t nfs -o vers=3,timeo=600 xxx.com:/share_path /local_path。
  • xxx.com:InfoEqualizer特性中已配置的动态域名称或动态分区域名。
  • /share_path:OceanStor DFS中的共享路径。
  • /local_path:要挂载到的客户端本地路径。

linux NFS配置案例的更多相关文章

  1. Redhat Linux NFS配置

    Linux下,All deviceis file,所有的设备都是文件.当我们需要把某些文件夹就或者文件共享给其他用户,就可以使用网络文件系统. 本文介绍Redhat Linux下的NFS配置. 在使用 ...

  2. linux NFS 配置步骤

    转载 http://woxihuanpes.blog.163.com/blog/static/12423219820097139145238/ NFS server可以看作是一个FILE SERVER ...

  3. Linux nfs配置

    ***************节点2的arch2目录挂载到节点1下.那么节点2是主节点1是备******** 10.230.39.234(节点1)cat /etc/exports /arch2 10. ...

  4. linux下配置NFS服务器

    (声明:本文大部分文字摘自Linux NFS服务器的安装与配置) 一.NFS简介     NFS 是Network File System的缩写,即网络文件系统.一种使用于分散式文件系统的协定,由Su ...

  5. Linux NFS服务器的安装与配置方法(图文详解)

    这篇文章主要介绍了Linux NFS服务器的安装与配置方法(图文详解),需要的朋友可以参考下(http://xb.xcjl0834.com) 一.NFS服务简介 NFS 是Network File S ...

  6. openvpn用户管理、linux客户端配置及企业常用真实案例解析

    1.给企业用户分配VPN账户的流程: 添加拨号需要密码的用户 # source vars NOTE: If you run ./clean-all, I will be doing a rm -rf ...

  7. linux nfs服务配置挂载以及oracle使用nfs存储挂载注意事项

    服务端共享目录 /home/XXX/nfs_shared 172.16.22.0/24(rw,no_root_squash) service nfs restart 常用命令: 查看所有nfs共享目录 ...

  8. Linux NFS服务器的简明配置6.8

    Linux NFS服务器的简明配置6.8   Linux NFS服务器的简明配置 一.NFS服务简介 NFS 是Network File System的缩写,即网络文件系统.一种使用于分散式文件系统的 ...

  9. Linux NFS服务器的安装与配置详解

    一.NFS服务简介 NFS是Network File System(网络文件系统).主要功能是通过网络让不同的服务器之间可以共享文件或者目录.NFS客户端一般是应用服务器(比如web,负载均衡等),可 ...

随机推荐

  1. ubuntu install themes && use it

    one step: I am going to show you the installation of a theme with Numix theme and Unity Tweak Tool. ...

  2. 转:async异步、thread多线程

    很全面的知识,转来留着 1:https://www.cnblogs.com/xibei/p/11826498.html 2:https://www.cnblogs.com/xibei/p/118742 ...

  3. 为什么样本标准差要除以n-1?

    根据中心极限定理,我们可以用样本估计总体的平均值.那么,如果通过n个样本估计总体的标准差则需要除以n-1,这是为什么呢? 标准差是描述数据与平均值的偏离程度. 而因为样本的数据量比总体的数据量少,因此 ...

  4. K Closest Points to Origin

    We have a list of points on the plane.  Find the K closest points to the origin (0, 0). (Here, the d ...

  5. Array of Doubled Pairs

    Given an array of integers A with even length, return true if and only if it is possible to reorder ...

  6. nginx反向代理_负载均衡

    注意ip地址为: 虚拟机ip设置 TYPE="Ethernet"BOOTPROTO="static"NAME="enp0s3"DEVICE= ...

  7. 忘记虚拟机中Linux的登录密码解决办法

    一.重启系统,在开机过程中,快速按下键盘上的方向键↑和↓.目的是告知引导程序,我们需要在引导页面选择不同的操作,以便让引导程序暂停. 2.使用↑和↓将选择行设置为第一行(背景高亮即为选中),按下键盘上 ...

  8. 一千行MySQL学习笔记 (转)

    出处:  一千行MySQL学习笔记 /* 启动MySQL */ net start mysql /* 连接与断开服务器 */ mysql -h 地址 -P 端口 -u 用户名 -p 密码 /* 跳过权 ...

  9. CSS3彩色进度条加载动画 带进度百分比

    在线演示       本地下载

  10. 无法发布-旧项目发布时出现:该项目中不存在目标“GatherAllFilesToPublish”。

    在项目文件夹下面找到 xxxx.csproj 文件,使用 VisualStudio Code 打开(或者任意编辑器,VisualStudio 可能无法编辑) 将以下节点进行更改 <Import ...