(1)NFS离线安装
使用nfs配置两台机器共享目录
假设两台机器188.188.30.32(服务端)、188.188.30.31(客户端)配置nfs
1.在可以联网的机器上下载rpm安装包
yum -y install nfs-utils --downloadonly --downloaddir /home/nfs
2.将nfs包导入到需要安装nfs的机器上(两台机器都需要此操作)
rpm -ivh *.rpm
3.启动nfs服务(两台机器都需要此操作)
systemctl start rpcbind.service && systemctl enable rpcbind.service
systemctl start nfs-server.service && systemctl enable nfs-server.service
4、在服务端(188.188.30.32)上添加配置
vim /etc/exports
/mnt/smart/backup_nc 188.188.30.*(rw,root_squash,async)
/mnt/smart/data 188.188.30.*(rw,root_squash,async)
/mnt/smart/elasticsearch 188.188.30.*(rw,no_root_squash,async)
/mnt/smart/ftp 188.188.30.*(rw,root_squash,async)
/mnt/smart/iserver 188.188.30.*(rw,no_root_squash,async)
/mnt/smart/mysql_nc 188.188.30.*(rw,no_root_squash,async)
/mnt/smart/redis 188.188.30.*(rw,no_root_squash,async)
/mnt/smart/zookeeper/data 188.188.30.*(rw,no_root_squash,async)
/mnt/smart/zookeeper/log 188.188.30.*(rw,no_root_squash,async)
/mnt/smart/kafka 188.188.30.*(rw,no_root_squash,async)
注意:其中no_root_squash 是不是root账号执行
#重新读取配置文件
exportfs -r
2、rancher部署pv、pvc