From b99e7c2129f1ccec696d638822612a0d7bac28cf Mon Sep 17 00:00:00 2001 From: WenyXu Date: Fri, 19 Sep 2025 11:35:33 +0800 Subject: [PATCH 1/4] docs: add datanode grouping doc --- .../configure-datanode-groups.md | 101 ++++++++++++++++++ .../configure-datanode-groups.md | 101 ++++++++++++++++++ sidebars.ts | 1 + 3 files changed, 203 insertions(+) create mode 100644 docs/enterprise/deployments-administration/deploy-on-kubernetes/configure-datanode-groups.md create mode 100644 i18n/zh/docusaurus-plugin-content-docs/current/enterprise/deployments-administration/deploy-on-kubernetes/configure-datanode-groups.md diff --git a/docs/enterprise/deployments-administration/deploy-on-kubernetes/configure-datanode-groups.md b/docs/enterprise/deployments-administration/deploy-on-kubernetes/configure-datanode-groups.md new file mode 100644 index 000000000..df781239d --- /dev/null +++ b/docs/enterprise/deployments-administration/deploy-on-kubernetes/configure-datanode-groups.md @@ -0,0 +1,101 @@ +--- +keywords: [Kubernetes, deployment, GreptimeDB, datanode groups, CRD, installation, verification] +description: Step-by-step guide to deploying a GreptimeDB cluster with datanode groups on Kubernetes, including prerequisites, configuration, installation, and verification. +--- + +# Deploying a GreptimeDB Cluster with Datanode Groups + +In this guide, you will learn how to deploy a GreptimeDB cluster on Kubernetes with a datanode group consisting of multiple datanode instances. + +## Prerequisites + +- [Docker](https://docs.docker.com/get-started/get-docker/) >= v23.0.0 +- [kubectl](https://kubernetes.io/docs/tasks/tools/install-kubectl/) >= v1.18.0 +- [Helm](https://helm.sh/docs/intro/install/) >= v3.0.0 +- [GreptimeDB Operator](https://github.com/GrepTimeTeam/greptimedb-operator) >= v0.3.0 + +## Upgrade operator + +Install the GreptimeDB Operator, setting the image version to be greater than or equal to `v0.3.0`. +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. + +## Datanode Groups Configuration + +In the enterprise edition, you can configure **datanode groups** to separate read and write workloads into different groups. +The datanode accepts a `workload_types` field to distinguish its workload type. Supported types are **`hybrid`**, **`query`**, and **`ingest`**: + +* **`hybrid`** is the default and acts as a superset of `query` and `ingest`, allowing the datanode to handle both workloads. +* **`query`** is optimized for read workloads, datanode only handle read workload. +* **`ingest`** is optimized for write workloads, datanode only handle write workload. + +While `hybrid` is convenient, running both reads and writes on the same datanode may cause them to interfere with each other. For best performance, it is recommended to separate read and write workloads into different datanode groups. + +When configuring datanode groups, ensure that each group includes a `name` field. The following `values.yaml` example demonstrates how to define separate datanode groups: + +```yaml +danodata: + enabled: false + +datanodeGroups: + - name: read + replicas: 1 + config: | + workload_types = ["query"] + template: + main: + resources: + limits: + cpu: 8 + memory: 16Gi + + - name: write + replicas: 1 + config: | + workload_types = ["ingest"] + template: + main: + resources: + requests: + cpu: 4 + memory: 8Gi + storage: + fs: + storageClassName: ${storageClassName} + storageSize: 100Gi + +meta: + replicas: 1 + backendStorage: + etcd: + endpoints: + - "etcd.etcd-cluster.svc.cluster.local:2379" + +frontend: + replicas: 1 +``` + +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. + +You can use the following command to apply the configuration: +``` +helm upgrade --install ${release-name} greptime/greptimedb-cluster --namespace ${namespace} -f values.yaml +``` + +## Verify the Installation + +Check the status of the pods: + +```bash +kubectl get pods -n default +NAME READY STATUS RESTARTS AGE +weny-cluster-datanode-read-0 1/1 Running 0 30s +weny-cluster-datanode-write-0 1/1 Running 0 30s +weny-cluster-frontend-774c76cffc-znvrw 1/1 Running 0 30s +weny-cluster-meta-58977b7897-8k2sf 1/1 Running 0 90s +``` + +## Next steps + +- The Best Practice, 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. + +- Add Read Replica for your table, please refer to [Read Replica](/enterprise/read-replica.md). \ No newline at end of file diff --git a/i18n/zh/docusaurus-plugin-content-docs/current/enterprise/deployments-administration/deploy-on-kubernetes/configure-datanode-groups.md b/i18n/zh/docusaurus-plugin-content-docs/current/enterprise/deployments-administration/deploy-on-kubernetes/configure-datanode-groups.md new file mode 100644 index 000000000..a347b7cc1 --- /dev/null +++ b/i18n/zh/docusaurus-plugin-content-docs/current/enterprise/deployments-administration/deploy-on-kubernetes/configure-datanode-groups.md @@ -0,0 +1,101 @@ +--- +keywords: [Kubernetes, deployment, GreptimeDB, datanode groups, CRD, installation, verification] +description: 在 Kubernetes 上部署带有 datanode 组的 GreptimeDB 集群的分步指南,包括先决条件、配置、安装和验证。 +--- + +# 部署具有 Datanode 组的 GreptimeDB 集群 + +在本指南中,你将学习如何在 Kubernetes 上部署具有 datanode 组的 GreptimeDB 集群,该组由多个 datanode 实例组成。 + +## 先决条件 + +- [Docker](https://docs.docker.com/get-started/get-docker/) >= v23.0.0 +- [kubectl](https://kubernetes.io/docs/tasks/tools/install-kubectl/) >= v1.18.0 +- [Helm](https://helm.sh/docs/intro/install/) >= v3.0.0 +- [GreptimeDB Operator](https://github.com/GrepTimeTeam/greptimedb-operator) >= v0.3.0 + +## 升级 operator + +安装 GreptimeDB Operator,将镜像版本设置为大于或等于 `v0.3.0`。 +有关升级 operator 的详细说明,请参阅 [GreptimeDB Operator 管理](/user-guide/deployments-administration/deploy-on-kubernetes/greptimedb-operator-management.md#升级)指南。 + +## Datanode 组配置 + +在企业版中,你可以配置 **datanode 组**来将读写工作负载分离到不同的组中。 +datanode 接受 `workload_types` 字段来区分其工作负载类型。支持的类型有 **`hybrid`**、**`query`** 和 **`ingest`**: + +* **`hybrid`** 是默认值,作为 `query` 和 `ingest` 的超集,允许 datanode 处理两种工作负载。 +* **`query`** 为读负载优化,datanode 只处理读负载。 +* **`ingest`** 为写负载优化,datanode 只处理写负载。 + +虽然 `hybrid` 很方便,但在同一个 datanode 上同时运行读写操作可能会相互干扰。为了获得最佳性能,建议将读写工作负载分离到不同的 datanode 组中。 + +在配置 datanode 组时,确保每个组都包含 `name` 字段。以下 `values.yaml` 示例展示了如何定义单独的 datanode 组: + +```yaml +danodata: + enabled: false + +datanodeGroups: + - name: read + replicas: 1 + config: | + workload_types = ["query"] + template: + main: + resources: + limits: + cpu: 8 + memory: 16Gi + + - name: write + replicas: 1 + config: | + workload_types = ["ingest"] + template: + main: + resources: + requests: + cpu: 4 + memory: 8Gi + storage: + fs: + storageClassName: ${storageClassName} + storageSize: 100Gi + +meta: + replicas: 1 + backendStorage: + etcd: + endpoints: + - "etcd.etcd-cluster.svc.cluster.local:2379" + +frontend: + replicas: 1 +``` + +有关为 Metasrv 配置替代元数据存储后端的指导,请参阅[元数据存储配置](/user-guide/deployments-administration/manage-metadata/configuration.md)文档。 + +你可以使用以下命令应用上述配置: +``` +helm upgrade --install ${release-name} greptime/greptimedb-cluster --namespace ${namespace} -f values.yaml +``` + +## 校验安装 + +检查 Pod 的状态: + +```bash +kubectl get pods -n default +NAME READY STATUS RESTARTS AGE +weny-cluster-datanode-read-0 1/1 Running 0 30s +weny-cluster-datanode-write-0 1/1 Running 0 30s +weny-cluster-frontend-774c76cffc-znvrw 1/1 Running 0 30s +weny-cluster-meta-58977b7897-8k2sf 1/1 Running 0 90s +``` + +## 后续步骤 + +- 最佳实践:为了获得最佳性能,建议[配置 frontend 组](/user-guide/deployments-administration/deploy-on-kubernetes/configure-frontend-groups.md),这确保读写流量的完全分离,实现最大隔离。 + +- 为你的表添加读副本,请参阅[读副本](/enterprise/read-replica.md)。 diff --git a/sidebars.ts b/sidebars.ts index ba000bae7..02c936d9c 100644 --- a/sidebars.ts +++ b/sidebars.ts @@ -516,6 +516,7 @@ const sidebars: SidebarsConfig = { }, 'enterprise/deployments-administration/deploy-on-kubernetes/installation', 'enterprise/deployments-administration/deploy-on-kubernetes/upgrade', + 'enterprise/deployments-administration/deploy-on-kubernetes/configure-datanode-groups', ] }, 'enterprise/deployments-administration/authentication', From 6f634c3c3ce43acebe5c5967ec9f7ad9e63c5c31 Mon Sep 17 00:00:00 2001 From: WenyXu Date: Fri, 19 Sep 2025 11:46:11 +0800 Subject: [PATCH 2/4] chore: minor --- .../deploy-on-kubernetes/configure-datanode-groups.md | 2 +- .../deploy-on-kubernetes/configure-datanode-groups.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/enterprise/deployments-administration/deploy-on-kubernetes/configure-datanode-groups.md b/docs/enterprise/deployments-administration/deploy-on-kubernetes/configure-datanode-groups.md index df781239d..b50e45431 100644 --- a/docs/enterprise/deployments-administration/deploy-on-kubernetes/configure-datanode-groups.md +++ b/docs/enterprise/deployments-administration/deploy-on-kubernetes/configure-datanode-groups.md @@ -96,6 +96,6 @@ weny-cluster-meta-58977b7897-8k2sf 1/1 Running 0 90s ## Next steps -- The Best Practice, 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. +- 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. - Add Read Replica for your table, please refer to [Read Replica](/enterprise/read-replica.md). \ No newline at end of file diff --git a/i18n/zh/docusaurus-plugin-content-docs/current/enterprise/deployments-administration/deploy-on-kubernetes/configure-datanode-groups.md b/i18n/zh/docusaurus-plugin-content-docs/current/enterprise/deployments-administration/deploy-on-kubernetes/configure-datanode-groups.md index a347b7cc1..cd3fff3b5 100644 --- a/i18n/zh/docusaurus-plugin-content-docs/current/enterprise/deployments-administration/deploy-on-kubernetes/configure-datanode-groups.md +++ b/i18n/zh/docusaurus-plugin-content-docs/current/enterprise/deployments-administration/deploy-on-kubernetes/configure-datanode-groups.md @@ -96,6 +96,6 @@ weny-cluster-meta-58977b7897-8k2sf 1/1 Running 0 90s ## 后续步骤 -- 最佳实践:为了获得最佳性能,建议[配置 frontend 组](/user-guide/deployments-administration/deploy-on-kubernetes/configure-frontend-groups.md),这确保读写流量的完全分离,实现最大隔离。 +- 为了获得最佳性能,建议[配置 frontend 组](/user-guide/deployments-administration/deploy-on-kubernetes/configure-frontend-groups.md),这确保读写流量的完全分离,实现最大隔离。 - 为你的表添加读副本,请参阅[读副本](/enterprise/read-replica.md)。 From 3a6b9c4512cbda6fb38213198e4915b44ba8d195 Mon Sep 17 00:00:00 2001 From: WenyXu Date: Fri, 19 Sep 2025 14:51:28 +0800 Subject: [PATCH 3/4] chore: apply suggestions --- .../deploy-on-kubernetes/configure-datanode-groups.md | 2 +- .../deploy-on-kubernetes/configure-datanode-groups.md | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/docs/enterprise/deployments-administration/deploy-on-kubernetes/configure-datanode-groups.md b/docs/enterprise/deployments-administration/deploy-on-kubernetes/configure-datanode-groups.md index b50e45431..30b268716 100644 --- a/docs/enterprise/deployments-administration/deploy-on-kubernetes/configure-datanode-groups.md +++ b/docs/enterprise/deployments-administration/deploy-on-kubernetes/configure-datanode-groups.md @@ -28,7 +28,7 @@ The datanode accepts a `workload_types` field to distinguish its workload type. * **`query`** is optimized for read workloads, datanode only handle read workload. * **`ingest`** is optimized for write workloads, datanode only handle write workload. -While `hybrid` is convenient, running both reads and writes on the same datanode may cause them to interfere with each other. For best performance, it is recommended to separate read and write workloads into different datanode groups. +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. When configuring datanode groups, ensure that each group includes a `name` field. The following `values.yaml` example demonstrates how to define separate datanode groups: diff --git a/i18n/zh/docusaurus-plugin-content-docs/current/enterprise/deployments-administration/deploy-on-kubernetes/configure-datanode-groups.md b/i18n/zh/docusaurus-plugin-content-docs/current/enterprise/deployments-administration/deploy-on-kubernetes/configure-datanode-groups.md index cd3fff3b5..d56a140b3 100644 --- a/i18n/zh/docusaurus-plugin-content-docs/current/enterprise/deployments-administration/deploy-on-kubernetes/configure-datanode-groups.md +++ b/i18n/zh/docusaurus-plugin-content-docs/current/enterprise/deployments-administration/deploy-on-kubernetes/configure-datanode-groups.md @@ -28,8 +28,7 @@ datanode 接受 `workload_types` 字段来区分其工作负载类型。支持 * **`query`** 为读负载优化,datanode 只处理读负载。 * **`ingest`** 为写负载优化,datanode 只处理写负载。 -虽然 `hybrid` 很方便,但在同一个 datanode 上同时运行读写操作可能会相互干扰。为了获得最佳性能,建议将读写工作负载分离到不同的 datanode 组中。 - +虽然 `hybrid` 很方便,但在同一个 datanode 上同时进行读写操作可能会相互干扰,例如,一个大查询可能占用过多资源,从而影响在线写入。为了获得最佳性能,建议将读写工作负载分离到不同的 datanode 组中。 在配置 datanode 组时,确保每个组都包含 `name` 字段。以下 `values.yaml` 示例展示了如何定义单独的 datanode 组: ```yaml From 4cf6ba75bfd5d7a6154038964095524c9e9bc979 Mon Sep 17 00:00:00 2001 From: WenyXu Date: Fri, 19 Sep 2025 15:46:00 +0800 Subject: [PATCH 4/4] chore: apply suggestions --- .../configure-datanode-groups.md | 23 +++++++++---------- .../configure-datanode-groups.md | 23 +++++++++---------- 2 files changed, 22 insertions(+), 24 deletions(-) diff --git a/docs/enterprise/deployments-administration/deploy-on-kubernetes/configure-datanode-groups.md b/docs/enterprise/deployments-administration/deploy-on-kubernetes/configure-datanode-groups.md index 30b268716..8a0fe6f4b 100644 --- a/docs/enterprise/deployments-administration/deploy-on-kubernetes/configure-datanode-groups.md +++ b/docs/enterprise/deployments-administration/deploy-on-kubernetes/configure-datanode-groups.md @@ -3,7 +3,7 @@ keywords: [Kubernetes, deployment, GreptimeDB, datanode groups, CRD, installatio description: Step-by-step guide to deploying a GreptimeDB cluster with datanode groups on Kubernetes, including prerequisites, configuration, installation, and verification. --- -# Deploying a GreptimeDB Cluster with Datanode Groups +# Deploy a GreptimeDB Cluster with Datanode Groups In this guide, you will learn how to deploy a GreptimeDB cluster on Kubernetes with a datanode group consisting of multiple datanode instances. @@ -37,17 +37,6 @@ danodata: enabled: false datanodeGroups: - - name: read - replicas: 1 - config: | - workload_types = ["query"] - template: - main: - resources: - limits: - cpu: 8 - memory: 16Gi - - name: write replicas: 1 config: | @@ -62,6 +51,16 @@ datanodeGroups: fs: storageClassName: ${storageClassName} storageSize: 100Gi + - name: read + replicas: 1 + config: | + workload_types = ["query"] + template: + main: + resources: + limits: + cpu: 8 + memory: 16Gi meta: replicas: 1 diff --git a/i18n/zh/docusaurus-plugin-content-docs/current/enterprise/deployments-administration/deploy-on-kubernetes/configure-datanode-groups.md b/i18n/zh/docusaurus-plugin-content-docs/current/enterprise/deployments-administration/deploy-on-kubernetes/configure-datanode-groups.md index d56a140b3..b9a8cbbe0 100644 --- a/i18n/zh/docusaurus-plugin-content-docs/current/enterprise/deployments-administration/deploy-on-kubernetes/configure-datanode-groups.md +++ b/i18n/zh/docusaurus-plugin-content-docs/current/enterprise/deployments-administration/deploy-on-kubernetes/configure-datanode-groups.md @@ -35,18 +35,7 @@ datanode 接受 `workload_types` 字段来区分其工作负载类型。支持 danodata: enabled: false -datanodeGroups: - - name: read - replicas: 1 - config: | - workload_types = ["query"] - template: - main: - resources: - limits: - cpu: 8 - memory: 16Gi - +datanodeGroups: - name: write replicas: 1 config: | @@ -61,6 +50,16 @@ datanodeGroups: fs: storageClassName: ${storageClassName} storageSize: 100Gi + - name: read + replicas: 1 + config: | + workload_types = ["query"] + template: + main: + resources: + limits: + cpu: 8 + memory: 16Gi meta: replicas: 1