如何解决在 Kubernetes 中使用 hostpath 和 glusterfs for mysql 挂载目录问题
背景:
我使用 glusterfs 部署了 MysqL 作为后端存储,但观察到数据库速度缓慢,因为我有基于 IOT 的解决方案,该解决方案生成 10 毫秒和 50 毫秒的数据,这些数据假设存储在数据库中。 我配置了我的 PV 就像
kind: PersistentVolume
Metadata:
name: MysqL-pv
labels:
type: glusterfs
spec:
storageClassName: glusterfs-sc
capacity:
storage: 245Gi
accessModes:
- ReadWriteMany
glusterfs:
endpoints: glusterfs-cluster
path: /gv1
readOnly: false
persistentVolumeReclaimPolicy: Retain
由于速度慢,我做了以下步骤
我现在的PV如下
spec:
storageClassName: manual
capacity:
storage: 245Gi
accessModes:
- ReadWriteOnce
hostPath:
path: "/mnt/MysqL"
我可以观察到 Db 的许多改进启动得到了很大的改进。因为 MysqL 是在本地写入,而 glusterfs 是在做复制。
但昨天我观察到 /mnt/MysqL
正在使用根空间而不是 /brick/brick1/gv1
我认为是由于节点的重新启动 glusterfs 暂时失去了法定人数而发生了这种情况。
我怎样才能避免这种情况?如果 /mnt/MysqL 没有挂载 MysqL 应该停止工作。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。