服务器端配置
先下载需要rpm包分发到其他的服务器上
yum install -y nfs-utils --downloadonly --downloaddir=/opt/nfsrpm
或者yum install -y nfs-utils
![](https://img-blog.csdnimg.cn/img_convert/164d956eacf27a0919abfa6ad64833f2.png)
image.png
vi /etc/exports
/data/nfs 10.67.40.121/24(rw,sync,fsid=0)
![](https://img-blog.csdnimg.cn/img_convert/55c7b56270a0a3e72698a788ce9852a4.png)
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
![](https://img-blog.csdnimg.cn/img_convert/53aaa9bd7b6f85610f092fca55082f2f.png)
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
执行脚本