Skip to content

Commit

Permalink
refactor: refine k8s deployment quick start (#1471)
Browse files Browse the repository at this point in the history
  • Loading branch information
zyy17 authored Jan 15, 2025
1 parent 6768442 commit fb9ba81
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -263,9 +263,9 @@ http://etcd-2.etcd-headless.etcd-cluster.svc.cluster.local:2379 is healthy: succ
```
</details>
## Install the GreptimeDB cluster with monitoring integration
## Install the GreptimeDB cluster with self-monitoring
Now that the GreptimeDB Operator and etcd cluster are installed, you can deploy a minimum GreptimeDB cluster with monitoring integration:
Now that the GreptimeDB Operator and etcd cluster are installed, you can deploy a minimum GreptimeDB cluster with self-monitoring and Flow enabled:
:::warning
The default configuration for the GreptimeDB cluster is not recommended for production use.
Expand All @@ -276,6 +276,7 @@ You should adjust the configuration according to your requirements.
helm install mycluster \
--set monitoring.enabled=true \
--set grafana.enabled=true \
--set flownode.enabled=true \
greptime/greptimedb-cluster \
-n default
```
Expand Down Expand Up @@ -305,9 +306,11 @@ The greptimedb-cluster is starting, use `kubectl get pods -n default` to check i
```
</details>
When the `monitoring` option is enabled, a GreptimeDB Standalone instance named `${cluster}-monitor` will be deployed in the same namespace as the cluster to store monitoring data such as metrics and logs from the cluster. Additionally, we will deploy a [Vector](https://github.com/vectordotdev/vector) sidecar for each pod in the cluster to collect metrics and logs and send them to the GreptimeDB Standalone instance.
When both `monitoring` and `grafana` options are enabled, we will enable **self-monitoring** for the GreptimeDB cluster: a GreptimeDB standalone instance will be deployed to monitor the GreptimeDB cluster, and the monitoring data will be visualized using Grafana, making it easier to troubleshoot issues in the GreptimeDB cluster.
When the `grafana` option is enabled, we will deploy a [Grafana](https://grafana.com/) instance and configure it to use the GreptimeDB Standalone instance as a data source (using both Prometheus and MySQL protocols), allowing us to visualize the GreptimeDB cluster's monitoring data out of the box. By default, Grafana will use `mycluster` and `default` as the cluster name and namespace to create data sources. If you want to monitor clusters with different names or namespaces, you'll need to create different data source configurations based on the cluster names and namespaces. You can create a `values.yaml` file like this:
We will deploy a GreptimeDB standalone instance named `${cluster}-monitor` in the same namespace as the cluster to store monitoring data such as metrics and logs from the cluster. Additionally, we will deploy a [Vector](https://github.com/vectordotdev/vector) sidecar for each pod in the cluster to collect metrics and logs and send them to the GreptimeDB standalone instance.
We will deploy a [Grafana](https://grafana.com/) instance and configure it to use the GreptimeDB standalone instance as a data source (using both Prometheus and MySQL protocols), allowing us to visualize the GreptimeDB cluster's monitoring data out of the box. By default, Grafana will use `mycluster` and `default` as the cluster name and namespace to create data sources. If you want to monitor clusters with different names or namespaces, you'll need to create different data source configurations based on the cluster names and namespaces. You can create a `values.yaml` file like this:
```yaml
grafana:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -305,16 +305,17 @@ http://etcd-2.etcd-headless.etcd-cluster.svc.cluster.local:2379 is healthy: succ
```
</details>
## 安装带有监控集成的 GreptimeDB 集群
## 安装带有自监控的 GreptimeDB 集群
目前我们已经准备好了 GreptimeDB Operator 和 etcd 集群,现在我们可以部署一个带监控集成的最小 GreptimeDB 集群:
目前我们已经准备好了 GreptimeDB Operator 和 etcd 集群,现在我们可以部署一个带自监控并启用 Flow 功能的最小 GreptimeDB 集群:
:::warning
本文档中的默认配置不适用于生产环境,你应该根据自己的需求调整配置。
:::
```bash
helm install mycluster \
--set flownode.enabled=true \
--set monitoring.enabled=true \
--set grafana.enabled=true \
greptime/greptimedb-cluster \
Expand All @@ -331,6 +332,7 @@ helm install mycluster \
--set initializer.registry=greptime-registry.cn-hangzhou.cr.aliyuncs.com \
--set grafana.enabled=true \
--set grafana.image.registry=greptime-registry.cn-hangzhou.cr.aliyuncs.com \
--set flownode.enabled=true \
--set monitoring.enabled=true \
--set monitoring.vector.registry=greptime-registry.cn-hangzhou.cr.aliyuncs.com \
-n default
Expand Down Expand Up @@ -364,10 +366,11 @@ The greptimedb-cluster is starting, use `kubectl get pods -n default` to check i
```
</details>
当启用 `monitoring` 选项时,我们将会在 cluster 所属的命名空间下部署一个名为 `${cluster}-monitor` GreptimeDB Standalone 实例,用于存储集群的 metrics 和 logs 这类监控数据。同时,我们也会为集群内的每一个 Pod 部署一个 [Vector](https://github.com/vectordotdev/vector) sidecar 来收集集群的 metrics 和 logs,并发送给 GreptimeDB Standalone 实例
当同时启用 `monitoring` `grafana` 选项时,我们将对 GreptimeDB 集群启动**自监控**:启动一个 GreptimeDB standalone 实例来监控 GreptimeDB 集群,并将相应的监控数据用 Grafana 进行渲染,从而更方便地排查 GreptimeDB 集群使用中的问题
我们将会在 cluster 所属的命名空间下部署一个名为 `${cluster}-monitor` 的 GreptimeDB standalone 实例,用于存储集群的 metrics 和 logs 这类监控数据。同时,我们也会为集群内的每一个 Pod 部署一个 [Vector](https://github.com/vectordotdev/vector) sidecar 来收集集群的 metrics 和 logs,并发送给 GreptimeDB standalone 实例。
当启用 `grafana` 选项时,我们将会部署一个 Grafana 实例,并配置 [Grafana](https://grafana.com/) 使用 GreptimeDB Standalone 实例作为数据源(分别使用 Prometheus 和 MySQL 协议),从而我们开箱即可使用 Grafana 来可视化 GreptimeDB 集群的监控数据。默认地,Grafana 将会使用 `mycluster``default` 作为集群名称和命名空间来创建数据源。如果你想要监控具有不同名称或不同命名空间的集群,那就需要基于不同的集群名称和命名空间来创建不同的数据源配置。你可以创建一个如下所示的 `values.yaml` 文件:
我们也将会部署一个 Grafana 实例,并配置 [Grafana](https://grafana.com/) 使用 GreptimeDB standalone 实例作为数据源(分别使用 Prometheus 和 MySQL 协议),从而我们开箱即可使用 Grafana 来可视化 GreptimeDB 集群的监控数据。默认地,Grafana 将会使用 `mycluster``default` 作为集群名称和命名空间来创建数据源。如果你想要监控具有不同名称或不同命名空间的集群,那就需要基于不同的集群名称和命名空间来创建不同的数据源配置。你可以创建一个如下所示的 `values.yaml` 文件:
```yaml
grafana:
Expand Down Expand Up @@ -438,7 +441,7 @@ mycluster-monitor-standalone-0 1/1 Running 0 6m35s
```
</details>
正如你所看到的,我们默认创建了一个最小的 GreptimeDB 集群,包括 1 个 frontend、1 个 datanode 和 1 个 metasrv。关于一个完整的 GreptimeDB 集群的组成,你可以参考 [architecture](/user-guide/concepts/architecture.md)。除此之外,我们还部署了一个独立的 GreptimeDB Standalone 实例(`mycluster-monitor-standalone-0`)用以存储监控数据和一个 Grafana 实例(`mycluster-grafana-675b64786-ktqps`)用以可视化集群的监控数据。
正如你所看到的,我们默认创建了一个最小的 GreptimeDB 集群,包括 1 个 frontend、1 个 datanode 和 1 个 metasrv。关于一个完整的 GreptimeDB 集群的组成,你可以参考 [architecture](/user-guide/concepts/architecture.md)。除此之外,我们还部署了一个独立的 GreptimeDB standalone 实例(`mycluster-monitor-standalone-0`)用以存储监控数据和一个 Grafana 实例(`mycluster-grafana-675b64786-ktqps`)用以可视化集群的监控数据。
## 探索 GreptimeDB 集群
Expand Down

0 comments on commit fb9ba81

Please sign in to comment.