#首先安装软件包 rpcbind nfs-utils
[root@localhost ~]# yum -y install rpcbind
已加载插件:langpacks, product-id, search-disabled-repos, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
file:///media/repodata/repomd.xml: [Errno 14] curl#37 - "Couldn't open file /media/repodata/repomd.xml"
正在尝试其它镜像。
软件包 rpcbind-0.2.0-38.el7.x86_64 已安装并且是最新版本
无须任何处理
[root@localhost ~]# yum -y install nfs-utils
已加载插件:langpacks, product-id, search-disabled-repos, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
file:///media/repodata/repomd.xml: [Errno 14] curl#37 - "Couldn't open file /media/repodata/repomd.xml"
正在尝试其它镜像。
软件包 1:nfs-utils-1.3.0-0.33.el7.x86_64 已安装并且是最新版本
无须任何处理
#创建共享文件夹
[root@localhost /opt]# mkdir nfs_yin
[root@localhost /opt]# ls
nfs_yin
#文件权限
[root@localhost opt]# chmod 777 nfs_yin
#进入配置文件
[root@localhost /]# vi /etc/exports
#写入
/opt/nfs_yin 192.168.10.0/24(rw或ro,sync或async) #读写 同步 异步
#重启服务 开机自启enable
[root@localhost /]# systemctl restart rpcbind
[root@localhost /]# systemctl restart nfs
防火墙:systemctl stop firewalld
selinux:setenforce 0
#服务端查看挂载点信息
[root@localhost opt]# showmount -e 192.168.10.10
Export list for 192.168.10.10:
/opt/nfs_ying 192.168.10.0/24
#客户端也需要安装rpcbind nfs-utils
#客户端挂载文件夹查看文件
[root@localhost ~]# mount -t nfs 192.168.10.10:/opt/nfs_ying /mnt/