下载NFS离线安装包
在可以联网的机器上下载NFS安装包,以后在服务端和客户端安装使用。
yum -y install nfs-utils --downloadonly --downloaddir /home/nfs
1.NFS服务端安装
1.1.服务端安装和配置NFS
rpm -Uvh *.rpm --nodeps --force
1.2.创建网络共享目录
mkdir -p /mnt/kubesphere && chmod -R a+w /mnt/kubesphere
1.3.配置网络共享目录
# 指定/mnt/kubesphere目录允许192.168.28.140访问,其中ip需要换成客户端ipecho '/mnt/kubesphere 192.168.28.140(rw,sync,all_squash,anonuid=0,anongid=0)' > /etc/exports# 配置生效exportfs -rv
1.4.启动服务
systemctl enable rpcbind.service && systemctl enable nfs-server.service && systemctl start rpcbind.service && systemctl start nfs-server.service
2.NFS客户端安装
rpm -Uvh *.rpm --nodeps --force
2.1.挂载网络共享目录
# 新建目录mkdir -p /home/kubesphere# 挂载共享目录,ip和目录要写服务端的ip和目录mount 192.168.28.140:/mnt/kubesphere /home/kubesphere#开机自动挂载echo "192.168.28.140:/mnt/kubesphere/ /home/kubesphere nfs defaults 0 0" >> /etc/fstab
2.2.卸载
umount /home/kubesphere
