- fe和be的存储用的是本地磁盘目录,
- be的节点数是3,在磁盘上规划了be1 be2 be3三个目录并分别创建pv,用来存储be的storage数据
- 实际在pod的创建过程中,每个be第一次启动时,pod使用的pv是随机的,后续重启的话会固定为这个pv, 这样可能导致:
be0挂载的目录是/xxx/xxx/be2
be2挂载的目录是/xxx/xxx/be1 - 是否有什么方法可以使be不同pod挂载到期望的对应目录:
be0===/xxx/xxx/be1
be1===/xxx/xxx/be2
be2===/xxx/xxx/be3
对应的配置文件如下:
beSpec:
replicas: 3
limits:
cpu: 8
memory: 16Gi
requests:
cpu: 2
memory: 16Gi
image: xxxxx
persistentVolumes:
- mountPath: /opt/apache-doris/be/storage
name: storage2
persistentVolumeClaimSpec:
# when use specific storageclass, the storageClassName should reConfig, example as annotation.
storageClassName: doris-be-storage
accessModes:
- ReadWriteOnce
resources:
# notice: if the storage size less 5G, fe will not start normal.
requests:
storage: 10Gi
selector:
matchLabels:
pv: doris-storage
- mountPath: /opt/apache-doris/fe/log
name: storage3
persistentVolumeClaimSpec:
# when use specific storageclass, the storageClassName should reConfig, example as annotation.
storageClassName: doris-be-log
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 10Gi
selector:
matchLabels:
pv: doris-be-log
pv和pod的使用关系如下: