使用 ByConity 作为存储引擎

创建时间:2024-09-23 最近修改时间:2024-09-23

#1. 简介

ByConity (opens new window) 是字节跳动基于 ClickHouse(最新同步自 ClickHouse v23.3)Fork 的项目,支持存算分离。

自 6.6 版本起,DeepFlow 支持通过调整部署参数决定使用 ClickHouse 还是 ByConity,默认使用 ClickHouse,可调整为使用 ByConity。

提示

ByConity 共有 17 个 Pod,其中 9 个 Pod 的 Request 和 Limit 为 1.1C 1280M,1 个 Pod 的 Request 和 Limit 为 1C 1G,1 个 Pod 的 Request 和 Limit 为 1C 512M。为了确保 ByConity 正常运行,建议 Kubernetes 集群至少剩余 12C 14G 可分配资源。

#1.1 部署参数

ByConity 默认对接对象存储,修改 values-custom.yaml,注意将 endpointregionbucketpathak_idak_secret 修改为对象存储的正确参数:

global:
  storageEngine: byconity
clickhouse:
  enabled: false
byconity:
  enabled: true
  byconity:
    configOverwrite:
      storage_configuration:
        disks:
          server_s3_disk_0:
            endpoint: https://oss-cn-beijing-internal.aliyuncs.com
            region: cn-beijing
            bucket: FIX_ME_BUCKET
            path: byconity0
            ak_id: FIX_ME_ACCESS_KEY
            ak_secret: FIX_ME_ACCESS_SECRET
    server:
      storage:
        localDisk:
          pvcSpec:
            storageClassName: openebs-hostpath #replace to your storageClassName
        log:
          pvcSpec:
            storageClassName: openebs-hostpath #replace to your storageClassName
      configOverwrite:
        logger:
          level: trace
        disk_cache_strategies:
          simple:
            lru_max_size: 42949672960 # 40Gi # disk Maximum cache space 40 X 1024 X 1024 X 1024
    usersOverwrite:
      users:
        default:
          password: "" # Password of the default user byconity
        probe:
          password: probe
    tso:
      storage:
        localDisk:
          pvcSpec:
            storageClassName: openebs-hostpath #replace to your storageClassName
        log:
          pvcSpec:
            storageClassName: openebs-hostpath #replace to your storageClassName
    defaultWorker:
      storage:
        localDisk:
          pvcSpec:
            storageClassName: openebs-hostpath #replace to your storageClassName
        log:
          pvcSpec:
            storageClassName: openebs-hostpath #replace to your storageClassName
  fdb:
    clusterSpec:
      processes:
        general:
          volumeClaimTemplate:
            spec:
              storageClassName: openebs-hostpath #replace to your storageClassName
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60

重建 DeepFlow:

helm del deepflow -n deepflow
helm install deepflow -n deepflow -f values-custom.yaml deepflow/deepflow
1
2

注意事项:

  • ByConity 只支持 AMD64 架构。
  • 如果出现部分 byconity-fdb-storage Pod 启动失败的情况,请调整内核参数:
    sudo sysctl -w fs.inotify.max_user_watches=2099999999
    sudo sysctl -w fs.inotify.max_user_instances=2099999999
    sudo sysctl -w fs.inotify.max_queued_events=2099999999
    
    1
    2
    3
  • 使用私有仓库导致 foundationDB 部分组件无法拉取镜像情况,可以使用如下命令解决:
    kubectl patch serviceaccount default  -p '{"imagePullSecrets": [{"name": "myregistrykey"}]}'  -n deepflow
    kubectl delete pod -n deepflow -l foundationdb.org/fdb-cluster-name=deepflow-byconity-fdb
    
    1
    2