NFS服务及自动挂载
文件共享服务器
概念,网络文件系统,通过网络,让不同的系统、机器实现文件共享
工作原理:由多个模块共同来完成,端口随机,通过RPC代理程序来帮助连接NFS服务
一、环境
服务端:192.168.1.111
[root@localhost ~]# cat /etc/redhat-release
CentOS Linux release 7.7.1908 (Core)
客户端:192.168.1.107
[root@localhost ~]# cat /etc/redhat-release
CentOS Linux release 7.7.1908 (Core)
二、nfs安装配置-服务端
安装环境支持
[root@localhost ~]# yum install nfs-utils -y
创建NFS共享目录
[root@localhost ~]# mkdir -p /data/nfsshare
随便复制一个文件至共享目录
[root@localhost ~]# cp /etc/fstab /data/nfsshare
配置文件,exports此文件名固定
[root@localhost ~]# vim /etc/exports
/data/nfsshare 192.168.1.107(ro,sync) 对客户端定义,ro为只读,rw为可写
注:
也可以写成网段的形式,要加/24,不可写0.0.0.0