一.配置NFS的服务器端
1.安装nfs
yum install -y nfs-utils
2.定义共享目录
#执行命令 vi /etc/exports,创建 exports 文件,文件内容如下:
echo "/data/nfs/data/ *(insecure,rw,sync,no_root_squash)" > /etc/exports
3.执行以下命令,启动 nfs 服务
mkdir -p /nfs/data
systemctl enable rpcbind
systemctl enable nfs-server
systemctl start rpcbind
systemctl start nfs-server
exportfs -r
4.检查配置是否生效
exportfs
二.配置NFS的客户端
1.安装nfs
yum install -y nfs-utils
2.检查nfs挂载目录
showmount -e x.x.x.2
3.创建nfs客户端目录
mkdir -p /data/nfs/data/
4.高可用备份的方式(所有节点)
mount -t nfs x.x.x.2:/data/nfs/data /data/nfs/data