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..8a0fe6f4b --- /dev/null +++ b/docs/enterprise/deployments-administration/deploy-on-kubernetes/configure-datanode-groups.md @@ -0,0 +1,100 @@ +--- +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. +--- + +# 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. + +## 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 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: + +```yaml +danodata: + enabled: false + +datanodeGroups: + - name: write + replicas: 1 + config: | + workload_types = ["ingest"] + template: + main: + resources: + requests: + cpu: 4 + memory: 8Gi + storage: + fs: + storageClassName: ${storageClassName} + storageSize: 100Gi + - name: read + replicas: 1 + config: | + workload_types = ["query"] + template: + main: + resources: + limits: + cpu: 8 + memory: 16Gi + +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 + +- 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..b9a8cbbe0 --- /dev/null +++ b/i18n/zh/docusaurus-plugin-content-docs/current/enterprise/deployments-administration/deploy-on-kubernetes/configure-datanode-groups.md @@ -0,0 +1,99 @@ +--- +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: write + replicas: 1 + config: | + workload_types = ["ingest"] + template: + main: + resources: + requests: + cpu: 4 + memory: 8Gi + storage: + fs: + storageClassName: ${storageClassName} + storageSize: 100Gi + - name: read + replicas: 1 + config: | + workload_types = ["query"] + template: + main: + resources: + limits: + cpu: 8 + memory: 16Gi + +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',