Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -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

- 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).
Original file line number Diff line number Diff line change
@@ -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)。
1 change: 1 addition & 0 deletions sidebars.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down