配置 Doris BE 冷热分离存储

本文描述了如何为 Doris BE on Kubernetes 配置多磁盘存储和冷热分离存储。

Doris BE 支持多个独立数据存储目录,比如通过同时挂载 SSD 和 HDD 存储介质来平衡热数据,冷数据的读写性能和成本。

Doris 部署文档中描述了这部分的内容,Doris Operator 提供了一种简单的方式来实现这一过程的配置,通过DorisCluster CRD 的 spec.be.storage 配置项。

apiVersion: al-assad.github.io/v1beta1
kind: DorisCluster
metadata:
  name: basic
spec:
  version: 2.0.3
  fe:
    baseImage: ghcr.io/linsoss/doris-fe
    replicas: 3
    requests:
      cpu: 500m
      memory: 1Gi
      storage: 50Gi
  be:
    baseImage: ghcr.io/linsoss/doris-be
    replicas: 3
    requests:
      cpu: 500m
      memory: 1Gi
    ## The custom storage of BE used to support cold and hot storage separation.
    ## Ref: https://doris.apache.org/docs/1.2/install/standard-deployment/#deploy-be
    ##    name: custom storage name
    ##    medium: storage medium, SSD(hot storage) or HDD(cold storage)
    ##    request: storage capacity, e.g. "500Gi"
    ##    storageClassName: k8s storage class name for the pvc
    storage:
      - name: storage-cold-1
        medium: HDD
        request: 500Gi
        storageClassName: hdd-pool
      - name: storage-cold-2
        medium: HDD
        request: 500Gi
        storageClassName: hdd-pool
      - name: storage-hot
        medium: SSD
        request: 200Gi
        storageClassName: ssd-pool

关于 StorageClass 和 PV 的制备,请参考:配置 Storage Class