Skip to content

Commit 1db3ede

Browse files
authored
docs: add datanode grouping doc (#2126)
1 parent 0439a57 commit 1db3ede

File tree

3 files changed

+200
-0
lines changed

3 files changed

+200
-0
lines changed
Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
---
2+
keywords: [Kubernetes, deployment, GreptimeDB, datanode groups, CRD, installation, verification]
3+
description: Step-by-step guide to deploying a GreptimeDB cluster with datanode groups on Kubernetes, including prerequisites, configuration, installation, and verification.
4+
---
5+
6+
# Deploy a GreptimeDB Cluster with Datanode Groups
7+
8+
In this guide, you will learn how to deploy a GreptimeDB cluster on Kubernetes with a datanode group consisting of multiple datanode instances.
9+
10+
## Prerequisites
11+
12+
- [Docker](https://docs.docker.com/get-started/get-docker/) >= v23.0.0
13+
- [kubectl](https://kubernetes.io/docs/tasks/tools/install-kubectl/) >= v1.18.0
14+
- [Helm](https://helm.sh/docs/intro/install/) >= v3.0.0
15+
- [GreptimeDB Operator](https://github.com/GrepTimeTeam/greptimedb-operator) >= v0.3.0
16+
17+
## Upgrade operator
18+
19+
Install the GreptimeDB Operator, setting the image version to be greater than or equal to `v0.3.0`.
20+
For detailed instructions on upgrading the operator, please refer to the [GreptimeDB Operator Management](/user-guide/deployments-administration/deploy-on-kubernetes/greptimedb-operator-management.md#upgrade) guide.
21+
22+
## Datanode Groups Configuration
23+
24+
In the enterprise edition, you can configure **datanode groups** to separate read and write workloads into different groups.
25+
The datanode accepts a `workload_types` field to distinguish its workload type. Supported types are **`hybrid`**, **`query`**, and **`ingest`**:
26+
27+
* **`hybrid`** is the default and acts as a superset of `query` and `ingest`, allowing the datanode to handle both workloads.
28+
* **`query`** is optimized for read workloads, datanode only handle read workload.
29+
* **`ingest`** is optimized for write workloads, datanode only handle write workload.
30+
31+
While `hybrid` is convenient, running both reads and writes on the same datanode may cause them to interfere with each other, for example, a large query may occupy too many resources, thus affecting the online ingestion. For best performance, it is recommended to separate read and write workloads into different datanode groups.
32+
33+
When configuring datanode groups, ensure that each group includes a `name` field. The following `values.yaml` example demonstrates how to define separate datanode groups:
34+
35+
```yaml
36+
danodata:
37+
enabled: false
38+
39+
datanodeGroups:
40+
- name: write
41+
replicas: 1
42+
config: |
43+
workload_types = ["ingest"]
44+
template:
45+
main:
46+
resources:
47+
requests:
48+
cpu: 4
49+
memory: 8Gi
50+
storage:
51+
fs:
52+
storageClassName: ${storageClassName}
53+
storageSize: 100Gi
54+
- name: read
55+
replicas: 1
56+
config: |
57+
workload_types = ["query"]
58+
template:
59+
main:
60+
resources:
61+
limits:
62+
cpu: 8
63+
memory: 16Gi
64+
65+
meta:
66+
replicas: 1
67+
backendStorage:
68+
etcd:
69+
endpoints:
70+
- "etcd.etcd-cluster.svc.cluster.local:2379"
71+
72+
frontend:
73+
replicas: 1
74+
```
75+
76+
For guidance on configuring alternative metadata storage backends for Metasrv, refer to the [Metadata Storage Configuration](/user-guide/deployments-administration/manage-metadata/configuration.md) documentation.
77+
78+
You can use the following command to apply the configuration:
79+
```
80+
helm upgrade --install ${release-name} greptime/greptimedb-cluster --namespace ${namespace} -f values.yaml
81+
```
82+
83+
## Verify the Installation
84+
85+
Check the status of the pods:
86+
87+
```bash
88+
kubectl get pods -n default
89+
NAME READY STATUS RESTARTS AGE
90+
weny-cluster-datanode-read-0 1/1 Running 0 30s
91+
weny-cluster-datanode-write-0 1/1 Running 0 30s
92+
weny-cluster-frontend-774c76cffc-znvrw 1/1 Running 0 30s
93+
weny-cluster-meta-58977b7897-8k2sf 1/1 Running 0 90s
94+
```
95+
96+
## Next steps
97+
98+
- For best performance, it is recommended to [Configure frontend groups](/user-guide/deployments-administration/deploy-on-kubernetes/configure-frontend-groups.md), which ensures complete separation of read and write traffic, achieving maximum isolation.
99+
100+
- Add Read Replica for your table, please refer to [Read Replica](/enterprise/read-replica.md).
Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
---
2+
keywords: [Kubernetes, deployment, GreptimeDB, datanode groups, CRD, installation, verification]
3+
description: 在 Kubernetes 上部署带有 datanode 组的 GreptimeDB 集群的分步指南,包括先决条件、配置、安装和验证。
4+
---
5+
6+
# 部署具有 Datanode 组的 GreptimeDB 集群
7+
8+
在本指南中,你将学习如何在 Kubernetes 上部署具有 datanode 组的 GreptimeDB 集群,该组由多个 datanode 实例组成。
9+
10+
## 先决条件
11+
12+
- [Docker](https://docs.docker.com/get-started/get-docker/) >= v23.0.0
13+
- [kubectl](https://kubernetes.io/docs/tasks/tools/install-kubectl/) >= v1.18.0
14+
- [Helm](https://helm.sh/docs/intro/install/) >= v3.0.0
15+
- [GreptimeDB Operator](https://github.com/GrepTimeTeam/greptimedb-operator) >= v0.3.0
16+
17+
## 升级 operator
18+
19+
安装 GreptimeDB Operator,将镜像版本设置为大于或等于 `v0.3.0`
20+
有关升级 operator 的详细说明,请参阅 [GreptimeDB Operator 管理](/user-guide/deployments-administration/deploy-on-kubernetes/greptimedb-operator-management.md#升级)指南。
21+
22+
## Datanode 组配置
23+
24+
在企业版中,你可以配置 **datanode 组**来将读写工作负载分离到不同的组中。
25+
datanode 接受 `workload_types` 字段来区分其工作负载类型。支持的类型有 **`hybrid`****`query`****`ingest`**
26+
27+
* **`hybrid`** 是默认值,作为 `query``ingest` 的超集,允许 datanode 处理两种工作负载。
28+
* **`query`** 为读负载优化,datanode 只处理读负载。
29+
* **`ingest`** 为写负载优化,datanode 只处理写负载。
30+
31+
虽然 `hybrid` 很方便,但在同一个 datanode 上同时进行读写操作可能会相互干扰,例如,一个大查询可能占用过多资源,从而影响在线写入。为了获得最佳性能,建议将读写工作负载分离到不同的 datanode 组中。
32+
在配置 datanode 组时,确保每个组都包含 `name` 字段。以下 `values.yaml` 示例展示了如何定义单独的 datanode 组:
33+
34+
```yaml
35+
danodata:
36+
enabled: false
37+
38+
datanodeGroups:
39+
- name: write
40+
replicas: 1
41+
config: |
42+
workload_types = ["ingest"]
43+
template:
44+
main:
45+
resources:
46+
requests:
47+
cpu: 4
48+
memory: 8Gi
49+
storage:
50+
fs:
51+
storageClassName: ${storageClassName}
52+
storageSize: 100Gi
53+
- name: read
54+
replicas: 1
55+
config: |
56+
workload_types = ["query"]
57+
template:
58+
main:
59+
resources:
60+
limits:
61+
cpu: 8
62+
memory: 16Gi
63+
64+
meta:
65+
replicas: 1
66+
backendStorage:
67+
etcd:
68+
endpoints:
69+
- "etcd.etcd-cluster.svc.cluster.local:2379"
70+
71+
frontend:
72+
replicas: 1
73+
```
74+
75+
有关为 Metasrv 配置替代元数据存储后端的指导,请参阅[元数据存储配置](/user-guide/deployments-administration/manage-metadata/configuration.md)文档。
76+
77+
你可以使用以下命令应用上述配置:
78+
```
79+
helm upgrade --install ${release-name} greptime/greptimedb-cluster --namespace ${namespace} -f values.yaml
80+
```
81+
82+
## 校验安装
83+
84+
检查 Pod 的状态:
85+
86+
```bash
87+
kubectl get pods -n default
88+
NAME READY STATUS RESTARTS AGE
89+
weny-cluster-datanode-read-0 1/1 Running 0 30s
90+
weny-cluster-datanode-write-0 1/1 Running 0 30s
91+
weny-cluster-frontend-774c76cffc-znvrw 1/1 Running 0 30s
92+
weny-cluster-meta-58977b7897-8k2sf 1/1 Running 0 90s
93+
```
94+
95+
## 后续步骤
96+
97+
- 为了获得最佳性能,建议[配置 frontend 组](/user-guide/deployments-administration/deploy-on-kubernetes/configure-frontend-groups.md),这确保读写流量的完全分离,实现最大隔离。
98+
99+
- 为你的表添加读副本,请参阅[读副本](/enterprise/read-replica.md)

sidebars.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -516,6 +516,7 @@ const sidebars: SidebarsConfig = {
516516
},
517517
'enterprise/deployments-administration/deploy-on-kubernetes/installation',
518518
'enterprise/deployments-administration/deploy-on-kubernetes/upgrade',
519+
'enterprise/deployments-administration/deploy-on-kubernetes/configure-datanode-groups',
519520
]
520521
},
521522
'enterprise/deployments-administration/authentication',

0 commit comments

Comments
 (0)