yum -y install nfs-utils rpcbind
systemctl enable rpcbind nfs-server nfs-lock nfs-idmap --now
mkdir -p /nas/k8s
chmod -R 777 /nas/k8s
配置需要共享的目录到 /etc/exports下,xxx.xxx.xxx.xxx为需要共享的对象ip地址
echo "/nas/k8s 192.168.3.0/24(insecure,rw,async,no_root_squash)" >> /etc/exports
exportfs -a # 使exports的修改生效
# showmount -e 192.168.3.81
Export list for 192.168.3.81:
/nas/k8s 192.168.3.0/24
yum -y install nfs-utils
检查共享目录是否设置正确,xxx.xxx.xxx.xxx 为共享服务器地址
# showmount -e 192.168.3.81
Export list for 192.168.3.81:
/nas/k8s 192.168.3.0/24
# mount -t nfs 192.168.3.81:/nas/k8s /mnt