1.所有节点安装nfs
yum install nfs-utils -y
2.配置nfs服务端,在master节点上
vim exports
/data 10.0.0.0/24(rw,async,no_root_squash,no_all_squash)
3.在master节点上创建共享目录
mkdir /data
4.启动服务
systemctl restart rpcbind
systemctl restart nfs
5.修改配置文件
volumes:
- name: mysql
nfs:
path: /data/mysql-wp
server: 10.0.0.11
来源:https://www.cnblogs.com/yangxiaoni/p/12031338.html