服务器端配置
先下载需要rpm包分发到其他的服务器上
yum install -y nfs-utils --downloadonly --downloaddir=/opt/nfsrpm
或者yum install -y nfs-utils

image.png
vi /etc/exports
/data/nfs 10.67.40.121/24(rw,sync,fsid=0)

image.png
systemctl enable rpcbind.service
systemctl enable nfs-server.service
systemctl start rpcbind.service
systemctl start nfs-server.service
rpcinfo -p
exportfs -r
exportfs

image.png
客户端配置
编写简单安装脚本
#!/bin/bash
yum install *.rpm -y
systemctl enable rpcbind.service
systemctl enable nfs-server.service
systemctl start rpcbind.service
systemctl enable nfs-server.service
showmount -e 10.67.40.121
mkdir /data/nfsdata
mount -t nfs 10.67.40.121:/data/nfs /data/nfsdata
sshpass -p 密码 scp * 10.67.40.124:/data/nfsrpm
执行脚本
本文详细介绍如何在服务器端配置NFS服务,包括rpm包分发、编辑exports文件、启动及检查服务等步骤。同时,提供了客户端配置脚本,涵盖安装rpm包、启动相关服务、挂载NFS共享目录等操作。
1403

被折叠的 条评论
为什么被折叠?



