@@ -225,7 +225,7 @@ http://etcd-2.etcd-headless.etcd-cluster.svc.cluster.local:2379 is healthy: succ
225225# # 配置 `values.yaml`
226226
227227` values.yaml` 文件设置了 GreptimeDB 的一些参数和配置,是定义 helm chart 的关键。
228- 例如一个带有自监控的最小规模 GreptimeDB 集群定义如下:
228+ 例如一个最小规模 GreptimeDB 集群定义如下:
229229
230230` ` ` yaml
231231image:
@@ -244,15 +244,6 @@ initializer:
244244 registry: docker.io
245245 repository: greptime/greptimedb-initializer
246246
247- monitoring:
248- # 启用监控
249- enabled: true
250-
251- grafana:
252- # 用于监控面板
253- # 需要先启用监控 `monitoring.enabled: true` 选项
254- enabled: true
255-
256247frontend:
257248 replicas: 1
258249
@@ -266,7 +257,7 @@ datanode:
266257 replicas: 1
267258` ` `
268259
269- :::note
260+ :::note 备注
270261中国大陆用户如有网络访问问题,可直接使用阿里云 OCI 镜像仓库:
271262
272263` ` ` yaml
@@ -286,20 +277,6 @@ initializer:
286277 registry: greptime-registry.cn-hangzhou.cr.aliyuncs.com
287278 repository: greptime/greptimedb-initializer
288279
289- monitoring:
290- # 启用监控
291- enabled: true
292- vector:
293- # 监控需要使用 Vector
294- registry: greptime-registry.cn-hangzhou.cr.aliyuncs.com
295-
296- grafana:
297- # 用于监控面板
298- # 需要先启用监控 `monitoring.enabled: true` 选项
299- enabled: true
300- image:
301- registry: greptime-registry.cn-hangzhou.cr.aliyuncs.com
302-
303280frontend:
304281 replicas: 1
305282
@@ -318,10 +295,10 @@ datanode:
318295可参考[配置文档](/user-guide/deployments-administration/deploy-on-kubernetes/common-helm-chart-configurations.md)获取完整的 ` values.yaml` 的配置项。
319296
320297
321- # # 安装带有自监控的 GreptimeDB 集群
298+ # # 安装 GreptimeDB 集群
322299
323300在上述步骤中我们已经准备好了 GreptimeDB Operator,etcd 集群以及 GreptimeDB 集群相应的配置,
324- 现在部署一个带自监控并启用 Flow 功能的最小 GreptimeDB 集群:
301+ 现在部署一个最小 GreptimeDB 集群:
325302
326303` ` ` bash
327304helm upgrade --install mycluster \
@@ -357,49 +334,6 @@ The greptimedb-cluster is starting, use `kubectl get pods -n default` to check i
357334` ` `
358335< /details>
359336
360- 当同时启用 ` monitoring` 和 ` grafana` 选项时,我们将对 GreptimeDB 集群启动** 自监控** :启动一个 GreptimeDB standalone 实例来监控 GreptimeDB 集群,并将相应的监控数据用 Grafana 进行渲染,从而更方便地排查 GreptimeDB 集群使用中的问题。
361-
362- 我们将会在 cluster 所属的命名空间下部署一个名为 ` ${cluster} -monitor` 的 GreptimeDB standalone 实例,用于存储集群的 metrics 和 logs 这类监控数据。同时,我们也会为集群内的每一个 Pod 部署一个 [Vector](https://github.com/vectordotdev/vector) sidecar 来收集集群的 metrics 和 logs,并发送给 GreptimeDB standalone 实例。
363-
364- 我们也将会部署一个 Grafana 实例,并配置 [Grafana](https://grafana.com/) 使用 GreptimeDB standalone 实例作为数据源(分别使用 Prometheus 和 MySQL 协议),从而我们开箱即可使用 Grafana 来可视化 GreptimeDB 集群的监控数据。默认地,Grafana 将会使用 ` mycluster` 和 ` default` 作为集群名称和命名空间来创建数据源。如果你想要监控具有不同名称或不同命名空间的集群,那就需要基于不同的集群名称和命名空间来创建不同的数据源配置。你可以创建一个如下所示的 ` values.yaml` 文件:
365-
366- ` ` ` yaml
367- monitoring:
368- enabled: true
369-
370- grafana:
371- enabled: true
372- datasources:
373- datasources.yaml:
374- datasources:
375- - name: greptimedb-metrics
376- type: prometheus
377- url: http://${cluster} -monitor-standalone.${namespace} .svc.cluster.local:4000/v1/prometheus
378- access: proxy
379- isDefault: true
380-
381- - name: greptimedb-logs
382- type: mysql
383- url: ${cluster} -monitor-standalone.${namespace} .svc.cluster.local:4002
384- access: proxy
385- database: public
386- ` ` `
387-
388- 上述配置将在 Grafana dashboard 中为 GreptimeDB 集群的指标和日志创建默认的数据源:
389-
390- - ` greptimedb-metrics` :集群的指标存储在独立的监控数据库中,并对外暴露为 Prometheus 协议(` type: prometheus` );
391-
392- - ` greptimedb-logs` :集群的日志存储在独立的监控数据库中,并对外暴露为 MySQL 协议(` type: mysql` )。默认使用 ` public` 数据库;
393-
394- 然后将上面的 ` values.yaml` 中的 ` ${cluster} ` 和 ` ${namespace} ` 替换为你想要的值,并使用以下命令安装 GreptimeDB 集群:
395-
396- ` ` ` bash
397- helm install ${cluster} \
398- greptime/greptimedb-cluster \
399- -f values.yaml \
400- -n ${namespace}
401- ` ` `
402-
403337当启动集群安装之后,我们可以用如下命令检查 GreptimeDB 集群的状态。若你使用了不同的集群名和命名空间,可将 ` default` 和 ` mycluster` 替换为你的配置:
404338
405339` ` ` bash
@@ -428,13 +362,11 @@ kubectl -n default get pods
428362NAME READY STATUS RESTARTS AGE
429363mycluster-datanode-0 2/2 Running 0 77s
430364mycluster-frontend-6ffdd549b-9s7gx 2/2 Running 0 66s
431- mycluster-grafana-675b64786-ktqps 1/1 Running 0 6m35s
432365mycluster-meta-58bc88b597-ppzvj 2/2 Running 0 86s
433- mycluster-monitor-standalone-0 1/1 Running 0 6m35s
434366` ` `
435367< /details>
436368
437- 正如你所看到的,我们默认创建了一个最小的 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 ` )用以可视化集群的监控数据。
369+ 正如你所看到的,我们默认创建了一个最小的 GreptimeDB 集群,包括 1 个 frontend、1 个 datanode 和 1 个 metasrv。关于一个完整的 GreptimeDB 集群的组成,你可以参考 [architecture](/user-guide/concepts/architecture.md)。
438370
439371# # 探索 GreptimeDB 集群
440372
@@ -480,30 +412,7 @@ kubectl -n default port-forward --address 0.0.0.0 svc/mycluster-frontend 4000:40
480412
481413如果你想使用其他工具如 ` mysql` 或 ` psql` 来连接 GreptimeDB 集群,你可以参考 [快速入门](/getting-started/quick-start.md)。
482414
483- # ## 访问 Grafana dashboard
484-
485- 你可以使用 ` kubectl port-forward` 命令转发 Grafana 服务:
486-
487- ` ` ` bash
488- kubectl -n default port-forward svc/mycluster-grafana 18080:80
489- ` ` `
490-
491- 请注意,当你使用了其他集群名和命名空间时,你可以使用如下命令,并将 ` ${cluster} ` 和 ` ${namespace} ` 替换为你的配置:
492-
493- ` ` ` bash
494- kubectl -n ${namespace} port-forward svc/${cluster} -grafana 18080:80
495- ` ` `
496-
497- 接着打开浏览器并访问 ` http://localhost:18080` 来访问 Grafana dashboard。默认的用户名和密码是 ` admin` 和 ` gt-operator` :
498-
499- ! [Grafana Dashboard](/kubernetes-cluster-grafana-dashboard.jpg)
500-
501- 目前有三个可用的 Dashboard:
502-
503- - ** GreptimeDB** : 用于显示 GreptimeDB 集群的 Metrics;
504- - ** GreptimeDB Logs** : 用于显示 GreptimeDB 集群的日志;
505-
506- # # 清理
415+ # # 删除集群
507416
508417:::danger
509418清理操作将会删除 GreptimeDB 集群的元数据和数据。请确保在继续操作之前已经备份了数据。
@@ -531,7 +440,6 @@ helm -n default uninstall mycluster
531440
532441` ` ` bash
533442kubectl -n default delete pvc -l app.greptime.io/component=mycluster-datanode
534- kubectl -n default delete pvc -l app.greptime.io/component=mycluster-monitor-standalone
535443` ` `
536444
537445# ## 清理 etcd 数据
0 commit comments