diff --git a/docs/enterprise/deployments-administration/deploy-on-kubernetes/installation.md b/docs/enterprise/deployments-administration/deploy-on-kubernetes/installation.md index b7e1788c1..6c54340e5 100644 --- a/docs/enterprise/deployments-administration/deploy-on-kubernetes/installation.md +++ b/docs/enterprise/deployments-administration/deploy-on-kubernetes/installation.md @@ -3,16 +3,75 @@ keywords: [Kubernetes deployment, GreptimeDB Enterprise, install GreptimeDB, sta description: Steps to install GreptimeDB Enterprise on Kubernetes, including obtaining images and starting GreptimeDB. --- -# Deploy GreptimeDB Cluster +# GreptimeDB Enterprise Deployment Guide -GreptimeDB Enterprise is released as docker images. -We provide each customer with a separate private docker registry hosted on Cloud, -which you can pull directly using the docker pull command or configure in helm charts. +## Environment Requirements -## Get GreptimeDB Enterprise Image +- [Docker](https://docs.docker.com/get-started/get-docker/) >= v23.0.0 +- [kubectl](https://kubernetes.io/docs/tasks/tools/install-kubectl/) >= v1.21.0 +- [Helm](https://helm.sh/docs/intro/install/) >= v3.0.0 +- [kubernetes](https://kubernetes.io/) >= 1.21 -You need to configure the image in the `values.yaml` file of the helm chart to obtain the dedicated GreptimeDB Enterprise, -for example: +## Overview + +The GreptimeDB Enterprise Edition deployment includes the following components: +1. GreptimeDB Operator: Used to interact with the Kubernetes cluster. +2. KV Store: Used to store database metadata (supports cloud services or self-hosted). It is recommended to use RDS from cloud services such as AWS RDS PostgreSQL. Optional storage facilities include: +- PostgreSQL +- MySQL +- ETCD + +3. GreptimeDB Database Cluster, including the following components: +- Meta:Database cluster metadata management component +- Datanode:Data node +- Frontend:Entry point and protocol parsing node +- Flownode(optional): Stream computing node +- Vector Sidecar:Metrics collection agent +- GreptimeDB Standalone: Cluster self-monitoring storage node + +4. GreptimeDB Enterprise Dashboard +5. Kafka(optional): Provides Remote WAL for GreptimeDB +6. MinIO(optional): Provides object storage for GreptimeDB. It is recommended to use object storage from cloud services (e.g., AWS S3) + +Components marked with * are optional: + +| Pod Component Name | Replicas | CPU (Core) | Memory (GB) | Disk (Gi) | +|----------------------------------|----------|------------|-------------|-----------| +| ETCD`*` | 3 | 2 | 4 | 10 | +| GreptimeDB Operator | 1 | 1 | 1 | | +| Meta | | | | | +| Datanode | | | | | +| Frontend | | | | | +| Flownode`*` | | | | | +| Vector Sidecar | | | | | +| GreptimeDB Standalone | 1 | 4 | 8 | | +| GreptimeDB Enterprise Dashboard | 1 | | | | +| Kafka`*` | 3 | | | | +| MinIO`*` | 4 | | | | + +## Deploy GreptimeDB Operator + +Refer to [GreptimeDB Operator Management Documentation](/user-guide/deployments-administration/deploy-on-kubernetes/greptimedb-operator-management.md) for detailed installation steps. + +## Deploy ETCD (Option) + +Refer to [Manage ETCD](/user-guide/deployments-administration/manage-metadata/manage-etcd.md) for detailed installation steps. + +## Deploy Kafka (Option) + +Refer to [Deploy Kafka Cluster](/user-guide/deployments-administration/deploy-on-kubernetes/deploy-kafka.md) for detailed installation steps. + +## Deploy MinIO (Option) + +Refer to [Deploy MinIO Cluster](/user-guide/deployments-administration/deploy-on-kubernetes/deploy-minio.md) for detailed installation steps. + +## Install and Start GreptimeDB + +### Obtain GreptimeDB Enterprise Edition Image + +GreptimeDB Enterprise Edition is distributed as a Docker image. We provide each customer with a dedicated private Docker repository hosted on Alibaba Cloud. You can pull it directly using the docker pull command or configure it in the Helm chart. + +You need to configure the image information in the Helm chart's `values.yaml` file to obtain your dedicated GreptimeDB Enterprise Edition, for example: ```yaml customImageRegistry: @@ -31,16 +90,400 @@ image: - greptimedb-custom-image-pull-secret ``` -In the above configuration, -the `registry`, `username` and `password` in `customImageRegistry` are used to create the k8s pull secret, -the `registry`, `repository` and `tag` in `image` are used to specify the GreptimeDB Enterprise image, -therefore `customImageRegistry.secretName` and `image.pullSecrets` must be consistent to ensure that the correct authentication information can be found when pulling the image. +In the above configuration: +- `registry`, `username`, and `password` under `customImageRegistry` are used to create the Kubernetes pull secret +- `registry`, `repository`, and `tag` under `image` are used to specify the GreptimeDB Enterprise Edition image +- Therefore, `customImageRegistry.secretName` and `image.pullSecrets` must match to ensure correct authentication when pulling the image Please contact Greptime staff to obtain the specific values for the above configuration items. -When Greptime staff first deliver GreptimeDB Enterprise to you, -they will inform you of the docker registry address, username and password via email. -Please keep them safe and do not share them with external personnel! +When Greptime staff first deliver the GreptimeDB Enterprise Edition to you, they will inform you of the image registry address, username, and password via email or other means. Please keep this information safe and do not share it with external parties! + +### Configuration Management + +Before installation, you need to create a file to configure the GreptimeDB cluster. Adjust it according to your Kubernetes environment. For more configurations, please refer to the [documentation](/user-guide/deployments-administration/deploy-on-kubernetes/common-helm-chart-configurations.md). Below is a reference configuration for `greptimedb-cluster-values.yaml`: + +```yaml +customImageRegistry: + enabled: true + # -- pull secret name, customizable, must match `image.pullSecrets` + secretName: greptimedb-custom-image-pull-secret + registry: + username: + password: + +image: + registry: + repository: + tag: + pullSecrets: + - greptimedb-custom-image-pull-secret + +additionalLabels: {} + +initializer: + registry: docker.io + repository: greptime/greptimedb-initializer + tag: "VAR::greptimedbOperatorVersion" + +# -- Meta configuration +meta: + # -- Meta replicas + replicas: 3 + + backendStorage: + # Optional + # KV storage configuration, this configuration connects to ETCD + etcd: + endpoints: ["etcd.etcd-cluster.svc.cluster.local:2379"] + # Below is an example using PostgreSQL as the KV store: + # postgresql: + # host: "postgres.default.svc.cluster.local" + # port: 5432 + # database: "metasrv" + # table: "greptime_metakv" + # electionLockID: 1 + # credentials: + # secretName: "meta-postgresql-credentials" + # username: "root" + # password: "root" + + podTemplate: + main: + # Meta resource configuration + resources: + requests: + cpu: '2' + memory: 4Gi + limits: + cpu: '2' + memory: 4Gi + affinity: + podAntiAffinity: + preferredDuringSchedulingIgnoredDuringExecution: + - podAffinityTerm: + labelSelector: + matchLabels: + app.greptime.io/component: greptimedb-meta + topologyKey: kubernetes.io/hostname + weight: 1 + +# -- Datanode configuration +datanode: + # -- Datanode replicas + replicas: 3 + + # -- Datanode configuration + configData: |- + [[region_engine]] + [region_engine.mito] + write_cache_size = "20G" + write_cache_ttl = "7d" + + podTemplate: + main: + # -- Datanode resource + resources: + requests: + cpu: '8' + memory: 16Gi + limits: + cpu: '8' + memory: 16Gi + affinity: + podAntiAffinity: + preferredDuringSchedulingIgnoredDuringExecution: + - podAffinityTerm: + labelSelector: + matchLabels: + app.greptime.io/component: greptimedb-datanode + topologyKey: kubernetes.io/hostname + weight: 1 + # -- Datanode local disk configuration + storage: + storageClassName: null + # -- Local disk size + storageSize: 100Gi + # -- Storage retain policy for datanode persistent volume + storageRetainPolicy: Retain + +# -- Frontend configuration +frontend: + # -- Frontend replicas + replicas: 3 + + podTemplate: + main: + # Frontend resource + resources: + requests: + cpu: '8' + memory: 16Gi + limits: + cpu: '8' + memory: 16Gi + affinity: + podAntiAffinity: + preferredDuringSchedulingIgnoredDuringExecution: + - podAffinityTerm: + labelSelector: + matchLabels: + app.greptime.io/component: greptimedb-frontend + topologyKey: kubernetes.io/hostname + weight: 1 + +# -- Flownode configuration +flownode: + # -- Whether to deploy flownode + enabled: false + # -- Flownode replicas + replicas: 1 + + podTemplate: + main: + resources: + requests: + cpu: '8' + memory: 16Gi + limits: + cpu: '8' + memory: 16Gi + +# -- Database self-monitoring configuration +monitoring: + # -- Enable self-monitoring + enabled: true + standalone: + base: + imagePullSecrets: + - name: "greptimedb-custom-image-pull-secret" + main: + # Self-monitoring resource configuration + resources: + requests: + cpu: '4' + memory: 8Gi + limits: + cpu: '4' + memory: 8Gi + # Self-monitoring standalone storage location, can be optionally configured for object storage + # objectStorage: + # s3: + # secretName: "greptimedb-object-storage-secret" + # bucket: "greptimedb-bucket" + # region: "ap-southeast-1" + # root: "greptimedb-monitor-data" + # endpoint: "http://minio.minio:9000" + # Self-monitoring local disk size + datanodeStorage: + fs: + storageClassName: null + storageSize: 100Gi + # sidecar vector configuration + vector: + registry: docker.io + repository: timberio/vector + tag: 0.46.1-debian + # sidecar vector resource configuration + resources: + requests: + cpu: '1' + memory: 1Gi + limits: + cpu: '1' + memory: "1Gi" + +# Object storage related configuration, enable as needed +# Using MinIO +# objectStorage: +# existingSecretName: "greptimedb-object-storage-secret" +# cache: +# cacheCapacity: "50GiB" +# s3: +# bucket: "greptimedb-bucket" +# region: "ap-southeast-1" +# root: "greptimedb-data" +# endpoint: "http://minio.minio:9000" + +# Enable Enterprise Edition user and permission configuration +auth: + enabled: true + useBuiltIn: true + mountPath: "/etc/greptimedb/auth" + fileName: "passwd" + users: + # Default admin username, modify as needed + - username: "superuser" + # Initial admin account password, modify as needed + password: "1fa44bbc-5ded-42bd-a3f1-c3621affce63" + permission: "admin" + +# Remote WAL related configuration, enable as needed +# remoteWal: +# enabled: true +# kafka: +# brokerEndpoints: +# - "kafka-broker-0.kafka-broker-headless.kafka.svc.cluster.local:9092" +# - "kafka-broker-1.kafka-broker-headless.kafka.svc.cluster.local:9092" +# - "kafka-broker-2.kafka-broker-headless.kafka.svc.cluster.local:9092" +``` + +### Start GreptimeDB + +Install the GreptimeDB cluster in the `greptimedb` namespace: + +```bash +helm upgrade --install greptimedb \ + --create-namespace \ + greptime/greptimedb-cluster \ + -n greptimedb --values greptimedb-cluster-values.yaml +``` + +Verify the GreptimeDB installation: + +```bash +kubectl get pod -n greptimedb +``` + +
+ Expected output +```bash +NAME READY STATUS RESTARTS AGE +greptimedb-datanode-0 2/2 Running 0 2m33s +greptimedb-datanode-1 2/2 Running 0 2m33s +greptimedb-datanode-2 2/2 Running 0 2m33s +greptimedb-frontend-74999c79cc-pzj8w 2/2 Running 0 17s +greptimedb-frontend-74999c79cc-rm2fb 2/2 Running 0 17s +greptimedb-frontend-74999c79cc-zbtdg 2/2 Running 0 17s +greptimedb-meta-56dc894867-jpt5c 2/2 Running 0 4m29s +greptimedb-meta-56dc894867-tpw4c 2/2 Running 0 4m29s +greptimedb-meta-56dc894867-wmh1t 2/2 Running 0 4m29s +greptimedb-monitor-standalone-0 1/1 Running 0 4m42s +``` +
+ +## Deploy Enterprise Dashboard + +### Configuration Management + +Before installation, you need to create a file `dashboard-values.yaml` to configure the dashboard. Below is a configuration example: + +```yaml +replicaCount: 1 + +image: + # Please contact Greptime staff for the value + repository: + tag: + pullPolicy: IfNotPresent + +imagePullSecrets: + - name: greptimedb-custom-image-pull-secret + +nameOverride: "" +fullnameOverride: "" + +config: | + servicePort: 19095 + logLevel: info + enableLicenseManager: true + enableUserAuthentication: true + backendStore: + type: sqlite + sqlite: + dataDir: /data + provisionedInstances: + - name: greptimedb + namespace: greptimedb + type: cluster + settings: + basic: + url: http://greptimedb-frontend.greptimedb.svc.cluster.local:4000 + meta_url: http://greptimedb-meta.greptimedb.svc.cluster.local:4000 + monitoring: + greptimedb: + url: http://greptimedb-monitor-standalone.greptimedb.svc.cluster.local:4000 + license: + secret_name: greptimedb-license + secret_namespace: greptimedb + +servicePort: 19095 + +serviceAccount: + create: true + annotations: {} + name: "" + +podAnnotations: {} + +podSecurityContext: {} + # fsGroup: 2000 + +securityContext: {} + +service: + type: ClusterIP + port: 19095 + annotations: {} + +resources: + requests: + cpu: '1' + memory: 1Gi + limits: + cpu: '1' + memory: 1Gi + +nodeSelector: {} +tolerations: [] +affinity: {} +``` + +### Start Enterprise Dashboard + +```bash +helm upgrade --install greptimedb-enterprise-dashboard \ + oci://greptime-registry.cn-hangzhou.cr.aliyuncs.com/charts/greptimedb-enterprise-dashboard \ + -n greptimedb \ + --values dashboard-values.yaml +``` + +Verify the Enterprise Dashboard installation: + +```bash +kubectl get pod -n greptimedb | grep enterprise-dashboard +``` + +
+ Expected output +```bash +greptimedb-enterprise-dashboard-67f498d6f9-n89z5 1/1 Running 0 27s +``` +
+ +```bash +kubectl get svc -n greptimedb | grep enterprise-dashboard +``` + +
+ Expected output +```bash +greptimedb-enterprise-dashboard ClusterIP 10.96.80.175 19095/TCP 89s +``` +
+ +### Log in to Enterprise Dashboard + +Access port 19095 of the dashboard service to log in. + +![Enterprise Dashboard Login](/enterprise-dashboard-login.png) + +Log in using the superuser account and password from the database deployment. You will see: -## Installation and Startup +![Enterprise Dashboard Page](/enterprise-dashboard-login.png) -Please refer to the [Deploy GreptimeDB Cluster on Kubernetes](/user-guide/deployments-administration/deploy-on-kubernetes/deploy-greptimedb-cluster.md) documentation. +1. Query: Use SQL to query data +2. Logs Query: Use the UI to query log tables +3. Cluster Overview: Current cluster statistics +4. Metrics Monitoring: Database cluster self-monitoring metrics +5. Instance Logs: Database instance logs +6. User Management: Add, delete, and modify user accounts diff --git a/docs/enterprise/deployments-administration/monitoring/self-monitor-cluster.md b/docs/enterprise/deployments-administration/monitoring/self-monitor-cluster.md deleted file mode 100644 index dccdd9f3c..000000000 --- a/docs/enterprise/deployments-administration/monitoring/self-monitor-cluster.md +++ /dev/null @@ -1,115 +0,0 @@ ---- -keywords: [Kubernetes deployment, enterprise cluster, monitoring, GreptimeDB Enterprise Management Console] -description: Complete guide to deploying self-monitoring for GreptimeDB enterprise clusters on Kubernetes, including GreptimeDB Enterprise Management Console setup and configuration options ---- - -# Self-Monitoring GreptimeDB Clusters - -Before reading this document, ensure you understand how to [deploy a GreptimeDB enterprise cluster on Kubernetes](/enterprise/deployments-administration/deploy-on-kubernetes/installation.md). -This guide will walk you through configuring monitoring when deploying a GreptimeDB cluster. - -## Quick Start -You can enable monitoring and the [GreptimeDB Enterprise Management Console](/enterprise/console-ui.md) by adding configurations to the `values.yaml` file when deploying the GreptimeDB cluster using Helm Chart. -Here's a complete example of a `values.yaml` file for deploying a minimal GreptimeDB cluster with monitoring and the GreptimeDB Enterprise Management Console: - -```yaml -customImageRegistry: - enabled: true - # -- pull secret name, customizable, must match `image.pullSecrets` - secretName: greptimedb-custom-image-pull-secret - registry: - username: - password: - -image: - registry: - repository: - tag: - pullSecrets: - - greptimedb-custom-image-pull-secret - -initializer: - # Consult GreptimeDB Enterprise staff - registry: - repository: greptime/greptimedb-initializer - # Consult GreptimeDB Enterprise staff - tag: - -monitoring: - # Enable monitoring - enabled: true - -greptimedb-enterprise-dashboard: - # Enable greptimedb-enterprise-dashboard deployment. - # Requires monitoring to be enabled first (monitoring.enabled: true) - enabled: true - image: - # Consult staff for repository and tag - repository: - tag: - -frontend: - replicas: 1 - -meta: - replicas: 1 - backendStorage: - etcd: - endpoints: ["etcd.etcd-cluster.svc.cluster.local:2379"] - -datanode: - replicas: 1 -``` - -When `monitoring` is enabled, GreptimeDB Operator launches an additional GreptimeDB Standalone instance to collect metrics and logs from the GreptimeDB cluster. -To collect log data, GreptimeDB Operator starts a [Vector](https://vector.dev/) sidecar container in each Pod. - -When `greptimedb-enterprise-dashboard` is enabled, an enterprise dashboard is deployed that uses the GreptimeDB Standalone instance configured for cluster monitoring as its data source and provides management features for the GreptimeDB cluster. - -Then install the GreptimeDB cluster with the above `values.yaml` file: - -```bash -helm upgrade --install mycluster \ - greptime/greptimedb-cluster \ - --values /path/to/values.yaml \ - -n default -``` - -Then refer to the [Access GreptimeDB Management Console](#access-greptimedb-management-console) section below for details on accessing it. - -## Monitoring Configuration - -For detailed monitoring configuration options, please refer to the [monitoring configuration](/user-guide/deployments-administration/monitoring/cluster-monitoring-deployment.md#monitoring-configuration) documentation of the open source GreptimeDB. - -## GreptimeDB Management Console Configuration - -### Enable GreptimeDB Management Console - -To enable GreptimeDB Management Console deployment, add the following configuration to `values.yaml`. -Note that monitoring must be enabled first (`monitoring.enabled: true`): - -```yaml -monitoring: - enabled: true - -greptimedb-enterprise-dashboard: - enabled: true -``` - -### Access GreptimeDB Management Console - -You can access the GreptimeDB Management Console by port-forwarding the service to your local machine: - -```bash -kubectl -n ${namespace} port-forward svc/${cluster-name}-greptimedb-enterprise-console 18080:19095 -``` - -Then open `http://localhost:18080` to access the GreptimeDB Enterprise Management Console. - -For detailed information on using the Management Console features and interface, please refer to the [Management Console](/enterprise/console-ui.md) documentation. - - -## Cleanup the PVCs - -Please refer to the [Cleanup the PVCs](/user-guide/deployments-administration/monitoring/cluster-monitoring-deployment.md#cleanup-the-pvcs) section of the open source GreptimeDB documentation. - diff --git a/docs/user-guide/deployments-administration/deploy-on-kubernetes/deploy-greptimedb-cluster.md b/docs/user-guide/deployments-administration/deploy-on-kubernetes/deploy-greptimedb-cluster.md index 408424259..e451f3ac5 100644 --- a/docs/user-guide/deployments-administration/deploy-on-kubernetes/deploy-greptimedb-cluster.md +++ b/docs/user-guide/deployments-administration/deploy-on-kubernetes/deploy-greptimedb-cluster.md @@ -202,7 +202,10 @@ For example, a minimal GreptimeDB cluster configuration is as follows: ```yaml image: - registry: docker.io + # Image registry: + # Use `docker.io` for OSS GreptimeDB, + # consult staff for Enterprise GreptimeDB + registry: # Image repository: # Use `greptime/greptimedb` for OSS GreptimeDB, # consult staff for Enterprise GreptimeDB @@ -229,6 +232,9 @@ meta: datanode: replicas: 1 + +flownode: + replicas: 1 ``` The configuration above for the GreptimeDB cluster is not recommended for production use. diff --git a/docs/user-guide/deployments-administration/deploy-on-kubernetes/deploy-kafka.md b/docs/user-guide/deployments-administration/deploy-on-kubernetes/deploy-kafka.md new file mode 100644 index 000000000..f60a6d855 --- /dev/null +++ b/docs/user-guide/deployments-administration/deploy-on-kubernetes/deploy-kafka.md @@ -0,0 +1,234 @@ +--- +keywords: [Kubernetes Deployment, Kafka, Helm Chart, Monitoring Integration] +description: A guide to deploying Kafka cluster on Kubernetes using Helm Chart, including installation, verification, and monitoring integration steps. +--- + +# Deploying Kafka Cluster + +In this guide, you will learn how to deploy a Kafka cluster on Kubernetes using a Helm Chart. + +## Prerequisites + +- Kubernetes >= v1.18.0 +- [kubectl](https://kubernetes.io/docs/tasks/tools/install-kubectl/) >= v1.18.0 +- [Helm](https://helm.sh/docs/intro/install/) >= v3.0.0 + +## Configuration Management + +Before installation, you need to create a configuration file for the Kafka cluster. Please adjust the following `kafka-values.yaml` reference configuration according to your Kubernetes environment: + +```yaml +image: + registry: docker.io + repository: greptime/kafka + tag: 3.9.0-debian-12-r1 + +listeners: + client: + containerPort: 9092 + protocol: PLAINTEXT + name: CLIENT + controller: + protocol: PLAINTEXT + +heapOpts: "-Xmx512m -Xms512m -XX:MetaspaceSize=96m -XX:+UseG1GC -XX:MaxGCPauseMillis=20 -XX:InitiatingHeapOccupancyPercent=35 -XX:G1HeapRegionSize=16M -XX:MinMetaspaceFreeRatio=50 -XX:MaxMetaspaceFreeRatio=80 -XX:+ExplicitGCInvokesConcurrent" + +controller: + replicaCount: 3 + resources: + limits: + cpu: '1' + memory: 1Gi + requests: + cpu: 500m + memory: 512Mi + persistence: + enabled: true + storageClass: "" + size: 50Gi + +broker: + replicaCount: 3 + resources: + limits: + cpu: '1' + memory: 1Gi + requests: + cpu: 500m + memory: 512Mi + persistence: + enabled: true + storageClass: "" + size: 50Gi + +extraConfig: | + num.network.threads=3 + num.io.threads=8 + min.insync.replicas=1 + socket.send.buffer.bytes=102400 + socket.receive.buffer.bytes=102400 + socket.request.max.bytes=104857600 + num.recovery.threads.per.data.dir=1 + offsets.topic.replication.factor=1 + transaction.state.log.replication.factor=1 + transaction.state.log.min.isr=1 + allow.everyone.if.no.acl.found=true + auto.create.topics.enable=true + default.replication.factor=1 + max.partition.fetch.bytes=1048576 + max.request.size=1048576 + message.max.bytes=20000000 + log.dirs=/bitnami/kafka/data + log.flush.interval.messages=10000 + log.flush.interval.ms=1000 + log.retention.hours=4 + log.roll.hours=3 + log.retention.bytes=250000000 + log.segment.bytes=1073741824 +``` + +## Installing Kafka Cluster + +Install the Kafka cluster in the kafka namespace: + +```bash +helm upgrade --install kafka \ + --create-namespace \ + oci://registry-1.docker.io/bitnamicharts/kafka \ + --version 31.0.0 \ + -n kafka --values kafka-values.yaml +``` + +
+ Expected Output + +```bash +Release "kafka" does not exist. Installing it now. +Pulled: greptime-registry.cn-hangzhou.cr.aliyuncs.com/charts/kafka:31.0.0 +Digest: sha256:85b135981fd5d951ceef8b51cdcbc6917ebface50d0eb3367eb7ddc4a5db482b +NAME: kafka +LAST DEPLOYED: Tue May 12 00:57:32 2026 +NAMESPACE: kafka +STATUS: deployed +REVISION: 1 +TEST SUITE: None +NOTES: +CHART NAME: kafka +CHART VERSION: 31.0.0 +APP VERSION: 3.9.0 + +** Please be patient while the chart is being deployed ** + +Kafka can be accessed by consumers via port 9092 on the following DNS name from within your cluster: + + kafka.kafka.svc.cluster.local + +Each Kafka broker can be accessed by producers via port 9092 on the following DNS name(s) from within your cluster: + + kafka-controller-0.kafka-controller-headless.kafka.svc.cluster.local:9092 + kafka-broker-0.kafka-broker-headless.kafka.svc.cluster.local:9092 + +To create a pod that you can use as a Kafka client run the following commands: + + kubectl run kafka-client --restart='Never' --image greptime-registry.cn-hangzhou.cr.aliyuncs.com/greptime/kafka:3.9.0-debian-12-r1 --namespace kafka --command -- sleep infinity + kubectl exec --tty -i kafka-client --namespace kafka -- bash + + PRODUCER: + kafka-console-producer.sh \ + --bootstrap-server kafka.kafka.svc.cluster.local:9092 \ + --topic test + + CONSUMER: + kafka-console-consumer.sh \ + --bootstrap-server kafka.kafka.svc.cluster.local:9092 \ + --topic test \ + --from-beginning + +Substituted images detected: +- greptime-registry.cn-hangzhou.cr.aliyuncs.com/greptime/kafka:3.9.0-debian-12-r1 +``` +
+ +## Verifying Kafka Cluster Installation + +Check the status of Kafka components (Broker and Controller): + +```bash +kubectl get pod -n kafka +``` + +
+ Expected Output +```bash +NAME READY STATUS RESTARTS AGE +kafka-broker-0 1/1 Running 0 8m3s +kafka-broker-1 1/1 Running 0 8m2s +kafka-broker-2 1/1 Running 0 8m1s +kafka-controller-0 1/1 Running 0 8m3s +kafka-controller-1 1/1 Running 0 8m2s +kafka-controller-0 1/1 Running 0 8m1s +``` +
+ +# Configuring Kafka Endpoints + +After the Kafka cluster is deployed, GreptimeDB can enable Remote WAL by configuring Kafka endpoints. For more information, refer to [this documentation](/user-guide/deployments-administration/deploy-on-kubernetes/configure-remote-wal.md). + +```yaml +remoteWal: + enabled: true + kafka: + brokerEndpoints: + - "kafka-broker-0.kafka-broker-headless.kafka.svc.cluster.local:9092" + - "kafka-broker-1.kafka-broker-headless.kafka.svc.cluster.local:9092" + - "kafka-broker-2.kafka-broker-headless.kafka.svc.cluster.local:9092" +``` + +# Monitoring + +- Install Prometheus Operator (eg: [kube-prometheus-stack](https://github.com/prometheus-community/helm-charts/tree/main/charts/kube-prometheus-stack))。 +- Install the servicemonitor CRD。 + +To monitor the Kafka cluster, you need to have a monitoring system (such as Prometheus and Grafana) deployed in advance. Then add the following content to `kafka-values.yaml` and re-run the command to update the Kafka configuration: + +```yaml +metrics: + jmx: + enabled: true + image: + registry: greptime-registry.cn-hangzhou.cr.aliyuncs.com + repository: greptime/jmx-exporter + tag: 1.0.1-debian-12-r9 + serviceMonitor: + enabled: true + namespace: "kafka" + interval: "10s" + labels: + release: kube-prometheus-stack +``` + +## Grafana dashboard + +Use [Kubernetes Kafka](https://grafana.com/grafana/dashboards/12483-kubernetes-kafka/) (ID: 12483) to monitor Kafka metrics. + +1. Log in to your Grafana. +2. Navigate to Dashboards -> New -> Import. +3. Enter Dashboard ID: 12483, select a data source and load the dashboard. + +![Kubernetes Kafka](/kubernetes-kafka-monitoring-dashboard.png) + +# Uninstalling Kafka Cluster + +Use the following command to uninstall the Kafka cluster: + +```bash +helm -n kafka uninstall kafka +``` + +## Deleting PVCs + +Deleting PVCs will remove persistent data from the Kafka cluster. Please ensure you have backed up your data before proceeding. + +```bash +kubectl -n kafka delete pvc -l app.kubernetes.io/instance=kafka +``` diff --git a/docs/user-guide/deployments-administration/deploy-on-kubernetes/deploy-minio.md b/docs/user-guide/deployments-administration/deploy-on-kubernetes/deploy-minio.md new file mode 100644 index 000000000..95bd8bb06 --- /dev/null +++ b/docs/user-guide/deployments-administration/deploy-on-kubernetes/deploy-minio.md @@ -0,0 +1,251 @@ +--- +keywords: [Kubernetes Deployment, MinIO, Object Storage, Helm Chart, Monitoring Integration, Distributed Storage] +description: A guide to deploying MinIO distributed object storage cluster on Kubernetes using Helm Chart, including installation, verification, bucket creation, and monitoring integration steps. +--- + +# Deploying MinIO Cluster + +In this guide, you will learn how to deploy a MinIO cluster on Kubernetes using a Helm Chart. + +## Prerequisites + +- Kubernetes >= v1.18.0 +- [kubectl](https://kubernetes.io/docs/tasks/tools/install-kubectl/) >= v1.18.0 +- [Helm](https://helm.sh/docs/intro/install/) >= v3.0.0 + +## Configuration Management + +Before installation, you need to create a `minio-values.yaml` configuration file. Please adjust the following configuration according to your Kubernetes environment: + +```yaml +global: + security: + allowInsecureImages: true + +image: + registry: docker.io + repository: greptime/minio + tag: 2025.4.22-debian-12-r1 + +auth: + rootUser: greptimedbadmin + rootPassword: "greptimedbadmin" + +resources: + requests: + cpu: 500m + memory: 500Mi + limits: + cpu: '2' + memory: 2Gi + +extraEnvVars: + - name: MINIO_REGION + value: "ap-southeast-1" + +statefulset: + replicaCount: 4 + +mode: distributed + +persistence: + storageClass: null + size: 100Gi +``` + +## Installing MinIO Cluster + +Install the MinIO cluster in the minio namespace: + +```bash +helm upgrade \ + --install minio oci://registry-1.docker.io/bitnamicharts/minio \ + --create-namespace \ + --version 16.0.10 \ + -n minio --values minio-values.yaml +``` + +
+ Expected Output + +```bash +Release "minio" does not exist. Installing it now. +Pulled: greptime-registry.cn-hangzhou.cr.aliyuncs.com/charts/minio:16.0.10 +Digest: sha256:96e220fd7cf1596879a243453b39c96a95d34f0005fdd452da3d094a7b386eb4 +NAME: minio +LAST DEPLOYED: Tue May 12 17:21:30 2026 +NAMESPACE: minio +STATUS: deployed +REVISION: 1 +TEST SUITE: None +NOTES: +CHART NAME: minio +CHART VERSION: 16.0.10 +APP VERSION: 2025.4.22 + +Did you know there are enterprise versions of the Bitnami catalog? For enhanced secure software supply chain features, unlimited pulls from Docker, LTS support, or application customization, see Bitnami Premium or Tanzu Application Catalog. See https://www.arrow.com/globalecs/na/vendors/bitnami for more information. + +** Please be patient while the chart is being deployed ** + +MinIO® can be accessed via port on the following DNS name from within your cluster: + +minio.minio.svc.cluster.local + +To get your credentials run: + +export ROOT_USER=$(kubectl get secret --namespace minio minio -o jsonpath="{.data.root-user}" | base64 -d) +export ROOT_PASSWORD=$(kubectl get secret --namespace minio minio -o jsonpath="{.data.root-password}" | base64 -d) + +To connect to your MinIO® server using a client: + +- Run a MinIO® Client pod and append the desired command (e.g. 'admin info'): + + kubectl run --namespace minio minio-client \ + --rm --tty -i --restart='Never' \ + --env MINIO_SERVER_ROOT_USER=$ROOT_USER \ + --env MINIO_SERVER_ROOT_PASSWORD=$ROOT_PASSWORD \ + --env MINIO_SERVER_HOST=minio \ + --image docker.io/bitnami/minio-client:2025.4.16-debian-12-r1 -- admin info minio + +To access the MinIO® web UI: + +- Get the MinIO® URL: + + echo "MinIO® web URL: http://127.0.0.1:9001/minio" + kubectl port-forward --namespace minio svc/minio 9001:9001 + +Substituted images detected: +- greptime-registry.cn-hangzhou.cr.aliyuncs.com/greptime/minio:2025.4.22-debian-12-r1 + +``` +
+ +## Verifying MinIO Cluster Installation + +Check the status of MinIO Pods: + +```bash +kubectl get pod -n minio +``` + +
+ Expected Output +```bash +NAME READY STATUS RESTARTS AGE +minio-0 1/1 Running 0 30s +minio-1 1/1 Running 0 30s +minio-2 1/1 Running 0 30s +minio-3 1/1 Running 0 30s +``` +
+ +# Creating Bucket and Access Key + +## Accessing MinIO Console + +1. First, expose the MinIO console service. You can use the kubectl port-forward command: + +```bash +kubectl port-forward -n minio svc/minio 9001:9001 +``` + +2. Open your browser: http://localhost:9001/login + +3. Log in using the credentials set in the configuration file: +- username: `greptimedbadmin` +- password: `greptimedbadmin` + +![MinIO login](/minio-login-page.png) + +## Creating a Bucket + +After logging into the MinIO console, follow these steps to create a Bucket: + +1. Click "Buckets" in the left sidebar +2. Click the "Create Bucket" button +3. Enter a Bucket name, for example:`greptimedb-bucket` +4. Click "Create Bucket" to confirm creation + +![MinIO create bucket step 1](/minio-create-bucket-1.png) + +![MinIO create bucket step 2](/minio-create-bucket-2.png) + +## Generating Access Key + +1. Click "Access Keys" in the left sidebar +2. Click the "Create Access Key" button +3. Optional: Set permission policies +4. Click "Create" to generate the Access Key and Secret Key + +![MinIO create access key step 1](/minio-create-access-key-1.png) + +![MinIO create access key step 2](/minio-create-access-key-2.png) + +:::warning +⚠️ Important: Please save the following information securely. You will need it when deploying GreptimeDB. +- Bucket name:greptimedb-bucket +- Region:ap-southeast-1 +- MinIO Endpoint:`http://minio.minio:9000` +- Access Key:The Access Key +- Secret Key:The Secret Key +::: + +# Configuring GreptimeDB to Use MinIO + +When deploying a GreptimeDB cluster, you can use MinIO as backend storage with the following configuration: + +```yaml +objectStorage: + credentials: + accessKeyId: "" + secretAccessKey: "" + s3: + bucket: "greptimedb-bucket" + region: "ap-southeast-1" + root: "greptimedb-data" + endpoint: "http://minio.minio:9000" +``` + +# Monitoring + +- Install Prometheus Operator (e.g: [kube-prometheus-stack](https://github.com/prometheus-community/helm-charts/tree/main/charts/kube-prometheus-stack))。 +- Install podmonitor CRD。 + +To monitor the MinIO cluster, you need to have a monitoring system (such as Prometheus and Grafana) deployed in advance. Then add the following content to minio-values.yaml and re-run the command to update the MinIO configuration: + +```yaml +metrics: + enabled: true + serviceMonitor: + enabled: true + namespace: minio + labels: + release: kube-prometheus-stack + interval: 30s +``` + +## Grafana dashboard + +Use the [MinIO Dashboard](https://grafana.com/grafana/dashboards/13502-minio-dashboard/) (ID: 13502) to monitor MinIO metrics. + +1. Log in to your Grafana. +2. Navigate to Dashboards -> New -> Import. +3. Enter Dashboard ID: 13502, select a data source, and load the dashboard. + +![MinIO Dashboard](/kubernetes-minio-monitoring-dashboard.png) + +# Uninstalling MinIO Cluster + +Use the following command to uninstall the MinIO cluster: + +```bash +helm -n minio uninstall minio +``` + +## Deleting PVCs + +Deleting PVCs will remove persistent data from the MinIO cluster. Please ensure you have backed up your data before proceeding. + +```bash +kubectl -n minio delete pvc -l app.kubernetes.io/instance=minio +``` diff --git a/docs/user-guide/deployments-administration/deploy-on-kubernetes/overview.md b/docs/user-guide/deployments-administration/deploy-on-kubernetes/overview.md index befd0261a..99eb447c3 100644 --- a/docs/user-guide/deployments-administration/deploy-on-kubernetes/overview.md +++ b/docs/user-guide/deployments-administration/deploy-on-kubernetes/overview.md @@ -38,6 +38,8 @@ including installation and upgrades. After familiarizing yourself with [the architecture and components of GreptimeDB](/user-guide/concepts/architecture.md), you can explore advanced deployment scenarios: +- [Deploy MinIO cluster](deploy-minio.md):Learn how to deploy, configure, and monitor a MinIO cluster. +- [Deploy Kafka cluster](deploy-kafka.md):Learn how to deploy, configure, and monitor a Kafka cluster. - [Deploy GreptimeDB Cluster with Remote WAL](configure-remote-wal.md): Configure Kafka as a remote write-ahead log (WAL) for your GreptimeDB cluster to persistently record every data modification and ensure no loss of memory-cached data. - [Use MySQL/PostgreSQL as Metadata Store](/user-guide/deployments-administration/deploy-on-kubernetes/common-helm-chart-configurations.md#configuring-metasrv-backend-storage): Integrate MySQL/PostgreSQL databases to provide robust metadata storage capabilities for enhanced reliability and performance. - [Deploy Multi-Frontend GreptimeDB Cluster](configure-frontend-groups.md): Set up a GreptimeDB cluster on Kubernetes with a frontend group consisting of multiple frontend instances for improved load distribution and availability. diff --git a/docs/user-guide/deployments-administration/monitoring/cluster-monitoring-deployment.md b/docs/user-guide/deployments-administration/monitoring/cluster-monitoring-deployment.md index f9e8f8879..f30eaa0e2 100644 --- a/docs/user-guide/deployments-administration/monitoring/cluster-monitoring-deployment.md +++ b/docs/user-guide/deployments-administration/monitoring/cluster-monitoring-deployment.md @@ -15,7 +15,10 @@ Here's a complete example of `values.yaml` for deploying a minimal GreptimeDB cl ```yaml image: - registry: docker.io + # Image registry: + # Use `docker.io` for OSS GreptimeDB, + # consult staff for Enterprise GreptimeDB + registry: # Image repository: # Use `greptime/greptimedb` for OSS GreptimeDB # Consult staff for GreptimeDB Enterprise @@ -51,6 +54,9 @@ meta: datanode: replicas: 1 + +flownode: + replicas: 1 ``` When `monitoring` is enabled, GreptimeDB Operator launches an additional GreptimeDB Standalone instance to collect metrics and logs from the GreptimeDB cluster. diff --git a/i18n/zh/docusaurus-plugin-content-docs/current/enterprise/deployments-administration/deploy-on-kubernetes/installation.md b/i18n/zh/docusaurus-plugin-content-docs/current/enterprise/deployments-administration/deploy-on-kubernetes/installation.md index 4cd87405f..9d25862b2 100644 --- a/i18n/zh/docusaurus-plugin-content-docs/current/enterprise/deployments-administration/deploy-on-kubernetes/installation.md +++ b/i18n/zh/docusaurus-plugin-content-docs/current/enterprise/deployments-administration/deploy-on-kubernetes/installation.md @@ -3,11 +3,73 @@ keywords: [Kubernetes 部署, GreptimeDB 企业版, 安装 GreptimeDB, 启动 Gr description: 在 Kubernetes 上安装 GreptimeDB 企业版的步骤,包括获取镜像、安装 GreptimeDB Operator 和 etcd 集群、配置 values.yaml 和启动 GreptimeDB。 --- -# 部署 GreptimeDB 集群 +# GreptimeDB 企业版部署指南 -GreptimeDB 企业版以 docker 镜像发布。我们为每位国内的客户提供了一个单独的、托管在阿里云上的私有 docker 仓库,你可以使用 docker pull 命令直接拉取,或在 helm chart 中配置。 +## 环境准备 -## 获取 GreptimeDB 企业版镜像 +- [Docker](https://docs.docker.com/get-started/get-docker/) >= v23.0.0 +- [kubectl](https://kubernetes.io/docs/tasks/tools/install-kubectl/) >= v1.21.0 +- [Helm](https://helm.sh/docs/intro/install/) >= v3.0.0 +- [kubernetes](https://kubernetes.io/) >= 1.21 + +## 前言 + +GreptimeDB 企业版部署包括以下组件: +1. GreptimeDB Operator:用于和 Kubernetes 集群交互。 +2. KV 存储:用于存储数据库元数据信息(支持云服务或自建),推荐使用云服务中的 RDS,例如 AWS RDS PostgreSQL。可选以下存储设施: +- PostgreSQL +- MySQL +- ETCD + +3. GreptimeDB 数据库集群,包含以下组件: +- Meta:数据库集群元数据信息管理组件 +- Datanode:数据节点 +- Frontend:入口和协议解析节点 +- Flownode(可选): 流计算节点 +- Vector Sidecar:指标采集 agent +- GreptimeDB Standalone: 集群自监控存储节点 + +4. GreptimeDB Enterprise Dashboard +5. Kafka(可选): 为 GreptimeDB 提供 Remote WAL +6. MinIO(可选): 为 GreptimeDB 提供对象存储,推荐使用云服务中的对象存储(例如:AWS S3) + +其中打`*`的为可选安装: + +| Pod 组件名称 | 副本数量 | CPU (Core) | 内存 (GB) | 磁盘 (Gi) | +|---------------------------------|------|------------|---------|---------| +| ETCD`*` | 3 | 2 | 4 | 10 | +| GreptimeDB Operator | 1 | 1 | 1 | | +| Meta | | | | | +| Datanode | | | | | +| Frontend | | | | | +| Flownode`*` | | | | | +| Vector Sidecar | | | | | +| GreptimeDB Standalone | 1 | 4 | 8 | | +| GreptimeDB Enterprise Dashboard | 1 | | | | +| Kafka`*` | 3 | | | | +| MinIO`*` | 4 | | | | + +## 部署 GreptimeDB Operator + +参考 [GreptimeDB Operator 的管理文档](/user-guide/deployments-administration/deploy-on-kubernetes/greptimedb-operator-management.md)获取详细的安装步骤。 + +## 部署 ETCD (可选) + +参考 [管理 ETCD](/user-guide/deployments-administration/manage-metadata/manage-etcd.md)获取详细的安装步骤。 + +## 部署 Kafka (可选) + +参考 [部署 Kafka 集群](/user-guide/deployments-administration/deploy-on-kubernetes/deploy-kafka.md)获取详细的安装步骤。 + +## 部署 MinIO (可选) + +参考 [部署 MinIO 集群](/user-guide/deployments-administration/deploy-on-kubernetes/deploy-minio.md)获取详细的安装步骤。 + +## 安装及启动 GreptimeDB + +### 获取 GreptimeDB 企业版镜像 + +GreptimeDB 企业版以 docker 镜像发布。我们为每位客户提供了一个单独的、托管在阿里云上的私有 docker 仓库,你可以使用 docker pull 命令直接拉取,或在 helm chart 中配置。 你需要在 helm chart 的 `values.yaml` 文件中配置镜像信息以获得专属的 GreptimeDB 企业版,例如: @@ -34,9 +96,394 @@ image: 因此 `customImageRegistry.secretName` 和 `image.pullSecrets` 需要保持一致以保证拉取镜像时能够找到正确的认证信息。 请联系 Greptime 工作人员获取上述配置项的具体值。 -Greptime 工作人员在首次交付给你 GreptimeDB 企业版时,会通过邮件或其他方式告知你 docker 仓库地址和用户名密码。请妥善保存,并切勿分享给外部人员! +Greptime 工作人员在首次交付给你 GreptimeDB 企业版时,会通过邮件或其他方式告知你镜像仓库地址和用户名密码。请妥善保存,并切勿分享给外部人员! + +### 配置管理 + +在安装之前,你需要创建一个文件来配置 GreptimeDB 集群。请根据你的 Kubernetes 环境调整,更多配置请参考[文档](/user-guide/deployments-administration/deploy-on-kubernetes/common-helm-chart-configurations.md)。以下是 `greptimedb-cluster-values.yaml` 的参考配置: + +```yaml +customImageRegistry: + enabled: true + # -- pull secret 名称,可自定义,需要和 `image.pullSecrets` 保持一致 + secretName: greptimedb-custom-image-pull-secret + registry: + username: + password: + +image: + registry: + repository: + tag: + pullSecrets: + - greptimedb-custom-image-pull-secret + +additionalLabels: {} + +initializer: + registry: greptime-registry.cn-hangzhou.cr.aliyuncs.com + repository: greptime/greptimedb-initializer + tag: "VAR::greptimedbOperatorVersion" + +# -- Meta 配置 +meta: + # -- Meta 副本数 + replicas: 3 + + backendStorage: + # 可选 + # KV 存储配置,本配置连接到 ETCD + etcd: + endpoints: ["etcd.etcd-cluster.svc.cluster.local:2379"] + # 以下是一个使用 PostgreSQL 作为 KV 存储的示例 + # postgresql: + # host: "postgres.default.svc.cluster.local" + # port: 5432 + # database: "metasrv" + # table: "greptime_metakv" + # electionLockID: 1 + # credentials: + # secretName: "meta-postgresql-credentials" + # username: "root" + # password: "root" + + podTemplate: + main: + # Meta 资源配置 + resources: + requests: + cpu: '2' + memory: 4Gi + limits: + cpu: '2' + memory: 4Gi + affinity: + podAntiAffinity: + preferredDuringSchedulingIgnoredDuringExecution: + - podAffinityTerm: + labelSelector: + matchLabels: + app.greptime.io/component: greptimedb-meta + topologyKey: kubernetes.io/hostname + weight: 1 + +# -- Datanode 配置 +datanode: + # -- Datanode 副本数量 + replicas: 3 + + # -- Datanode 配置 + configData: |- + [[region_engine]] + [region_engine.mito] + write_cache_size = "20G" + write_cache_ttl = "7d" + + podTemplate: + main: + # -- Datanode 资源设置 + resources: + requests: + cpu: '8' + memory: 16Gi + limits: + cpu: '8' + memory: 16Gi + affinity: + podAntiAffinity: + preferredDuringSchedulingIgnoredDuringExecution: + - podAffinityTerm: + labelSelector: + matchLabels: + app.greptime.io/component: greptimedb-datanode + topologyKey: kubernetes.io/hostname + weight: 1 + # -- Datanode 本地磁盘配置 + storage: + storageClassName: null + # -- 本地磁盘大小 + storageSize: 100Gi + # -- Storage retain policy for datanode persistent volume + storageRetainPolicy: Retain + +# -- Frontend 配置 +frontend: + # -- Frontend 副本数 + replicas: 3 + + podTemplate: + main: + # Frontend 资源配置 + resources: + requests: + cpu: '8' + memory: 16Gi + limits: + cpu: '8' + memory: 16Gi + affinity: + podAntiAffinity: + preferredDuringSchedulingIgnoredDuringExecution: + - podAffinityTerm: + labelSelector: + matchLabels: + app.greptime.io/component: greptimedb-frontend + topologyKey: kubernetes.io/hostname + weight: 1 + +# -- Flownode 配置 +flownode: + # -- 是否部署 flownode + enabled: false + # -- Flownode 副本数 + replicas: 1 + + podTemplate: + main: + resources: + requests: + cpu: '8' + memory: 16Gi + limits: + cpu: '8' + memory: 16Gi + +# -- 数据库自监控配置 +monitoring: + # -- 打开自监控 + enabled: true + standalone: + base: + imagePullSecrets: + - name: "greptimedb-custom-image-pull-secret" + main: + # 自监控资源配置 + resources: + requests: + cpu: '4' + memory: 8Gi + limits: + cpu: '4' + memory: 8Gi + # 自监控 standalone 存储位置,可按需打开存放至对象存储 + # objectStorage: + # s3: + # secretName: "greptimedb-object-storage-secret" + # bucket: "greptimedb-bucket" + # region: "ap-southeast-1" + # root: "greptimedb-monitor-data" + # endpoint: "http://minio.minio:9000" + # 自监控本地磁盘大小 + datanodeStorage: + fs: + storageClassName: null + storageSize: 100Gi + # sidecar vector 配置 + vector: + registry: greptime-registry.cn-hangzhou.cr.aliyuncs.com + repository: timberio/vector + tag: 0.46.1-debian + # sidecar vector 资源配置 + resources: + requests: + cpu: '1' + memory: 1Gi + limits: + cpu: '1' + memory: "1Gi" + +# 对象存储相关配置,按需打开 +# 使用 MinIO +# objectStorage: +# existingSecretName: "greptimedb-object-storage-secret" +# cache: +# cacheCapacity: "50GiB" +# s3: +# bucket: "greptimedb-bucket" +# region: "ap-southeast-1" +# root: "greptimedb-data" +# endpoint: "http://minio.minio:9000" + +# 打开企业版用户和权限配置 +auth: + enabled: true + useBuiltIn: true + mountPath: "/etc/greptimedb/auth" + fileName: "passwd" + users: + # 默认的 admin 用户名,按需修改 + - username: "superuser" + # 初始化 admin 账户的密码,按需修改 + password: "1fa44bbc-5ded-42bd-a3f1-c3621affce63" + permission: "admin" + +# Remote WAL相关配置,按需打开 +# remoteWal: +# enabled: true +# kafka: +# brokerEndpoints: +# - "kafka-broker-0.kafka-broker-headless.kafka.svc.cluster.local:9092" +# - "kafka-broker-1.kafka-broker-headless.kafka.svc.cluster.local:9092" +# - "kafka-broker-2.kafka-broker-headless.kafka.svc.cluster.local:9092" +``` + +### 启动 GreptimeDB + +在 `greptimedb` 命名空间中安装 GreptimeDB 集群: +```bash +helm upgrade --install greptimedb \ + --create-namespace \ + oci://greptime-registry.cn-hangzhou.cr.aliyuncs.com/charts/greptimedb-cluster \ + -n greptimedb --values greptimedb-cluster-values.yaml +``` + +验证 GreptimeDB 安装: + +```bash +kubectl get pod -n greptimedb +``` + +
+ 预期输出 +```bash +NAME READY STATUS RESTARTS AGE +greptimedb-datanode-0 2/2 Running 0 2m33s +greptimedb-datanode-1 2/2 Running 0 2m33s +greptimedb-datanode-2 2/2 Running 0 2m33s +greptimedb-frontend-74999c79cc-pzj8w 2/2 Running 0 17s +greptimedb-frontend-74999c79cc-rm2fb 2/2 Running 0 17s +greptimedb-frontend-74999c79cc-zbtdg 2/2 Running 0 17s +greptimedb-meta-56dc894867-jpt5c 2/2 Running 0 4m29s +greptimedb-meta-56dc894867-tpw4c 2/2 Running 0 4m29s +greptimedb-meta-56dc894867-wmh1t 2/2 Running 0 4m29s +greptimedb-monitor-standalone-0 1/1 Running 0 4m42s +``` +
+ +## 部署 Enterprise Dashboard + +### 配置管理 + +在安装之前,你需要创建一个文件 `dashboard-values.yaml` 来配置 dashboard,以下是配置示例: + +```yaml +replicaCount: 1 + +image: + # 请咨询 Greptime 工作人员获取 + repository: + tag: + pullPolicy: IfNotPresent + +imagePullSecrets: + - name: greptimedb-custom-image-pull-secret + +nameOverride: "" +fullnameOverride: "" + +config: | + servicePort: 19095 + logLevel: info + enableLicenseManager: true + enableUserAuthentication: true + backendStore: + type: sqlite + sqlite: + dataDir: /data + provisionedInstances: + - name: greptimedb + namespace: greptimedb + type: cluster + settings: + basic: + url: http://greptimedb-frontend.greptimedb.svc.cluster.local:4000 + meta_url: http://greptimedb-meta.greptimedb.svc.cluster.local:4000 + monitoring: + greptimedb: + url: http://greptimedb-monitor-standalone.greptimedb.svc.cluster.local:4000 + license: + secret_name: greptimedb-license + secret_namespace: greptimedb + +servicePort: 19095 + +serviceAccount: + create: true + annotations: {} + name: "" + +podAnnotations: {} + +podSecurityContext: {} + # fsGroup: 2000 + +securityContext: {} + +service: + type: ClusterIP + port: 19095 + annotations: {} + +# dashboard 资源配置 +resources: + requests: + cpu: '1' + memory: 1Gi + limits: + cpu: '1' + memory: 1Gi + +nodeSelector: {} +tolerations: [] +affinity: {} +``` + +### 启动 Enterprise Dashboard + +```bash +helm upgrade --install greptimedb-enterprise-dashboard \ + oci://greptime-registry.cn-hangzhou.cr.aliyuncs.com/charts/greptimedb-enterprise-dashboard \ + -n greptimedb \ + --values dashboard-values.yaml +``` + +验证 Enterprise Dashboard 安装: + +```bash +kubectl get pod -n greptimedb | grep enterprise-dashboard +``` + +
+ 预期输出 +```bash +greptimedb-enterprise-dashboard-67f498d6f9-n89z5 1/1 Running 0 27s +``` +
+ +```bash +kubectl get svc -n greptimedb | grep enterprise-dashboard +``` + +
+ 预期输出 +```bash +greptimedb-enterprise-dashboard ClusterIP 10.96.80.175 19095/TCP 89s +``` +
+ +### 登录 Enterprise Dashboard + +访问 dashboard service 的 19095 端口进行登录 + +![Enterprise Dashboard Login](/enterprise-dashboard-login.png) -## 安装及启动 +使用数据库部署中的 superuser 账号密码进行登录,可见: -请参考[部署 GreptimeDB 集群](/user-guide/deployments-administration/deploy-on-kubernetes/deploy-greptimedb-cluster.md)文档。 +![Enterprise Dashboard Page](/enterprise-dashboard-login.png) +1. 查询:使用 SQL 查询数据 +2. Logs 查询:使用 UI 查询 log 表 +3. 集群概览:当前集群统计信息 +4. 指标监控:数据库集群的自身监控指标 +5. 实例日志:数据库自身的日志 +6. 用户管理:增删改用户账号 diff --git a/i18n/zh/docusaurus-plugin-content-docs/current/enterprise/deployments-administration/deploy-on-kubernetes/overview.md b/i18n/zh/docusaurus-plugin-content-docs/current/enterprise/deployments-administration/deploy-on-kubernetes/overview.md index 75c8e8bdf..fa90f6d9c 100644 --- a/i18n/zh/docusaurus-plugin-content-docs/current/enterprise/deployments-administration/deploy-on-kubernetes/overview.md +++ b/i18n/zh/docusaurus-plugin-content-docs/current/enterprise/deployments-administration/deploy-on-kubernetes/overview.md @@ -1,6 +1,6 @@ --- keywords: [Kubernetes 部署, Operator 模式, 自动化管理, 集群部署, 单机实例, 私有云, 公有云] -description: 在 Kubernetes 上部署 GreptimeDB 的概述,包括集群的安装、升级和监控等内容。 +description: 在 Kubernetes 上部署 GreptimeDB 企业版的概述,包括集群的安装、升级和监控等内容。 --- # 在 Kubernetes 上部署 GreptimeDB @@ -9,7 +9,7 @@ GreptimeDB 企业版在 Kubernetes 上的部署流程与开源版基本一致, ## 安装 -要了解如何通过 Helm Chart 启动 GreptimeDB,请前往[安装 GreptimeDB](./installation.md) 页面。 +要了解如何通过 Helm Chart 启动 GreptimeDB 企业版,请前往[安装 GreptimeDB](./installation.md) 页面。 ## 升级 diff --git a/i18n/zh/docusaurus-plugin-content-docs/current/enterprise/deployments-administration/monitoring/self-monitor-cluster.md b/i18n/zh/docusaurus-plugin-content-docs/current/enterprise/deployments-administration/monitoring/self-monitor-cluster.md deleted file mode 100644 index 83a2f4799..000000000 --- a/i18n/zh/docusaurus-plugin-content-docs/current/enterprise/deployments-administration/monitoring/self-monitor-cluster.md +++ /dev/null @@ -1,116 +0,0 @@ ---- -keywords: [Kubernetes 部署, 企业集群, 监控] -description: 在 Kubernetes 上为 GreptimeDB 企业集群部署自监控的完整指南,包括 Grafana 仪表板设置和配置选项 ---- - -# 自监控 GreptimeDB 集群 - -在阅读本文档之前,请确保你了解如何[在 Kubernetes 上部署 GreptimeDB 企业集群](/enterprise/deployments-administration/deploy-on-kubernetes/installation.md)。 -本文将介绍在部署 GreptimeDB 集群时如何配置监控。 - -## 快速开始 - -你可以通过在使用 Helm Chart 部署 GreptimeDB 集群时向 `values.yaml` 文件添加配置来启用监控和 [GreptimeDB 控制台](/enterprise/console-ui.md)。 -以下是部署带有监控和 GreptimeDB 控制台的最小 GreptimeDB 集群的完整 `values.yaml` 文件示例: - -```yaml -customImageRegistry: - enabled: true - # -- pull secret 名称,可自定义,需要和 `image.pullSecrets` 保持一致 - secretName: greptimedb-custom-image-pull-secret - # 请咨询工作人员获得 registry、username 和 password - registry: - username: - password: - -image: - registry: - repository: - tag: - pullSecrets: - - greptimedb-custom-image-pull-secret - -initializer: - # 请咨询工作人员获得 registry、repository 和 tag - registry: - repository: greptime/greptimedb-initializer - tag: - -monitoring: - # 启用监控 - enabled: true - -greptimedb-enterprise-dashboard: - # 启用 greptimedb-enterprise-dashboard 部署。 - # 需要首先启用监控(monitoring.enabled: true) - enabled: true - image: - # 请咨询工作人员获得 repository 和 tag - repository: - tag: - -frontend: - replicas: 1 - -meta: - replicas: 1 - backendStorage: - etcd: - endpoints: ["etcd.etcd-cluster.svc.cluster.local:2379"] - -datanode: - replicas: 1 -``` - -启用 `monitoring` 后,GreptimeDB Operator 会额外启动一个 GreptimeDB Standalone 实例来收集 GreptimeDB 集群的指标和日志。 -为了收集日志数据,GreptimeDB Operator 会在每个 Pod 中启动一个 [Vector](https://vector.dev/) Sidecar 容器。 - -当启用 `greptimedb-enterprise-dashboard` 时,GreptimeDB Operator 会部署企业版控制台,它使用为集群监控配置的 GreptimeDB Standalone 实例作为数据源,并为 GreptimeDB 集群提供管理功能。 - -使用上述 `values.yaml` 文件安装 GreptimeDB 集群: - -```bash -helm upgrade --install mycluster \ - greptime/greptimedb-cluster \ - --values /path/to/values.yaml \ - -n default -``` - -接下来参考下方的[访问 GreptimeDB 企业控制台](#访问-greptimedb-控制台)部分了解如何访问控制台。 - -## 监控配置 - -请参考开源 GreptimeDB 的[监控配置](/user-guide/deployments-administration/monitoring/cluster-monitoring-deployment.md#配置监控数据的收集)文档获取详细的监控配置说明。 - -## GreptimeDB 控制台配置 - -### 启用 GreptimeDB 控制台 - -请在 `values.yaml` 中添加以下配置启用 GreptimeDB 控制台。 -注意该功能需要首先启用监控(`monitoring.enabled: true`): - -```yaml -monitoring: - enabled: true - -greptimedb-enterprise-dashboard: - enabled: true -``` - -### 访问 GreptimeDB 控制台 - -你可以通过将服务端口转发到本地来访问 GreptimeDB 控制台: - -```bash -kubectl -n ${namespace} port-forward svc/${cluster-name}-greptimedb-enterprise-console 18080:19095 -``` - -然后打开 `http://localhost:18080` 访问 GreptimeDB 控制台。 - -有关控制台功能和界面的详细信息,请参考[控制台](/enterprise/console-ui.md)文档。 - -## 清理 PVC - -请参考开源 GreptimeDB 文档的[清理 PVC](/user-guide/deployments-administration/monitoring/cluster-monitoring-deployment.md#清理-pvc)部分。 - - diff --git a/i18n/zh/docusaurus-plugin-content-docs/current/user-guide/deployments-administration/deploy-on-kubernetes/deploy-greptimedb-cluster.md b/i18n/zh/docusaurus-plugin-content-docs/current/user-guide/deployments-administration/deploy-on-kubernetes/deploy-greptimedb-cluster.md index dedbe7143..843c93166 100644 --- a/i18n/zh/docusaurus-plugin-content-docs/current/user-guide/deployments-administration/deploy-on-kubernetes/deploy-greptimedb-cluster.md +++ b/i18n/zh/docusaurus-plugin-content-docs/current/user-guide/deployments-administration/deploy-on-kubernetes/deploy-greptimedb-cluster.md @@ -234,41 +234,10 @@ http://etcd-2.etcd-headless.etcd-cluster.svc.cluster.local:2379 is healthy: succ ```yaml image: - registry: docker.io - # 镜像仓库: - # OSS GreptimeDB 使用 `greptime/greptimedb`, + # 镜像仓库地址: + # OSS GreptimeDB 使用 `greptime-registry.cn-hangzhou.cr.aliyuncs.com`, # Enterprise GreptimeDB 请咨询工作人员 - repository: - # 镜像标签: - # OSS GreptimeDB 使用数据库版本,例如 `VAR::greptimedbVersion` - # Enterprise GreptimeDB 请咨询工作人员 - tag: - pullSecrets: [] - -initializer: - registry: docker.io - repository: greptime/greptimedb-initializer - tag: "VAR::greptimedbOperatorVersion" - -frontend: - replicas: 1 - -meta: - replicas: 1 - backendStorage: - etcd: - endpoints: ["etcd.etcd-cluster.svc.cluster.local:2379"] - -datanode: - replicas: 1 -``` - -:::note 备注 -中国大陆用户如有网络访问问题,可直接使用阿里云 OCI 镜像仓库: - -```yaml -image: - registry: greptime-registry.cn-hangzhou.cr.aliyuncs.com + registry: # 镜像仓库: # OSS GreptimeDB 使用 `greptime/greptimedb`, # Enterprise GreptimeDB 请咨询工作人员 @@ -295,8 +264,10 @@ meta: datanode: replicas: 1 + +flownode: + replicas: 1 ``` -::: 上述配置不适用于严肃的生产环境,请根据自己的需求调整配置。 可参考[配置文档](/user-guide/deployments-administration/deploy-on-kubernetes/common-helm-chart-configurations.md)获取完整的 `values.yaml` 的配置项。 diff --git a/i18n/zh/docusaurus-plugin-content-docs/current/user-guide/deployments-administration/deploy-on-kubernetes/deploy-greptimedb-standalone.md b/i18n/zh/docusaurus-plugin-content-docs/current/user-guide/deployments-administration/deploy-on-kubernetes/deploy-greptimedb-standalone.md index b3e098fd8..c4dbe1901 100644 --- a/i18n/zh/docusaurus-plugin-content-docs/current/user-guide/deployments-administration/deploy-on-kubernetes/deploy-greptimedb-standalone.md +++ b/i18n/zh/docusaurus-plugin-content-docs/current/user-guide/deployments-administration/deploy-on-kubernetes/deploy-greptimedb-standalone.md @@ -26,7 +26,7 @@ helm upgrade --install greptimedb-standalone greptime/greptimedb-standalone -n d ```
- Expected Output + 期望输出 ```bash Release "greptimedb-standalone" does not exist. Installing it now. NAME: greptimedb-standalone @@ -54,7 +54,7 @@ kubectl get pod -n default ```
- Expected Output + 期望输出 ```bash NAME READY STATUS RESTARTS AGE greptimedb-standalone-0 1/1 Running 0 40s @@ -86,7 +86,7 @@ helm upgrade --install greptimedb-standalone greptime/greptimedb-standalone \ ```
- Expected Output + 期望输出 ```bash Release "greptimedb-standalone" has been upgraded. Happy Helming! NAME: greptimedb-standalone @@ -114,7 +114,7 @@ kubectl get pod -n default ```
- Expected Output + 期望输出 ```bash NAME READY STATUS RESTARTS AGE greptimedb-standalone-0 1/1 Running 0 3s @@ -136,7 +136,7 @@ mysql -h 127.0.0.1 -P 4002 ```
- Expected Output + 期望输出 ```bash Welcome to the MariaDB monitor. Commands end with ; or \g. Your MySQL connection id is 8 @@ -161,7 +161,7 @@ psql -h 127.0.0.1 -p 4003 -d public ```
- Expected Output + 期望输出 ```bash psql (16.2, server 16.3-GreptimeDB-1.0.1) Type "help" for help. @@ -183,7 +183,7 @@ curl -X POST \ ```
- Expected Output + 期望输出 ```json { "output": [ diff --git a/i18n/zh/docusaurus-plugin-content-docs/current/user-guide/deployments-administration/deploy-on-kubernetes/deploy-kafka.md b/i18n/zh/docusaurus-plugin-content-docs/current/user-guide/deployments-administration/deploy-on-kubernetes/deploy-kafka.md new file mode 100644 index 000000000..a2f6d602c --- /dev/null +++ b/i18n/zh/docusaurus-plugin-content-docs/current/user-guide/deployments-administration/deploy-on-kubernetes/deploy-kafka.md @@ -0,0 +1,235 @@ +--- +keywords: [Kubernetes 部署, Kafka, Helm Chart, 监控集成] +description: 在 Kubernetes 上使用 Helm Chart 部署 Kafka 集群的指南,包括安装、验证和监控集成步骤。 +--- + +# 部署 Kafka 集群 + +在该指南中,你将学会如何使用 Helm Chart 在 Kubernetes 上部署 Kafka 集群。 + +## 前置依赖 + +- Kubernetes >= v1.18.0 +- [kubectl](https://kubernetes.io/docs/tasks/tools/install-kubectl/) >= v1.18.0 +- [Helm](https://helm.sh/docs/intro/install/) >= v3.0.0 + +## 配置管理 + +在安装之前,你需要创建一个文件来配置 Kafka 集群。请根据你的 Kubernetes 环境调整,以下是 `kafka-values.yaml` 的参考配置: + +```yaml +image: + registry: greptime-registry.cn-hangzhou.cr.aliyuncs.com + repository: greptime/kafka + tag: 3.9.0-debian-12-r1 + +listeners: + client: + containerPort: 9092 + protocol: PLAINTEXT + name: CLIENT + controller: + protocol: PLAINTEXT + +heapOpts: "-Xmx512m -Xms512m -XX:MetaspaceSize=96m -XX:+UseG1GC -XX:MaxGCPauseMillis=20 -XX:InitiatingHeapOccupancyPercent=35 -XX:G1HeapRegionSize=16M -XX:MinMetaspaceFreeRatio=50 -XX:MaxMetaspaceFreeRatio=80 -XX:+ExplicitGCInvokesConcurrent" + +controller: + replicaCount: 3 + resources: + limits: + cpu: '1' + memory: 1Gi + requests: + cpu: 500m + memory: 512Mi + persistence: + enabled: true + storageClass: "" + size: 50Gi + +broker: + replicaCount: 3 + resources: + limits: + cpu: '1' + memory: 1Gi + requests: + cpu: 500m + memory: 512Mi + persistence: + enabled: true + storageClass: "" + size: 50Gi + +extraConfig: | + num.network.threads=3 + num.io.threads=8 + min.insync.replicas=1 + socket.send.buffer.bytes=102400 + socket.receive.buffer.bytes=102400 + socket.request.max.bytes=104857600 + num.recovery.threads.per.data.dir=1 + offsets.topic.replication.factor=1 + transaction.state.log.replication.factor=1 + transaction.state.log.min.isr=1 + allow.everyone.if.no.acl.found=true + auto.create.topics.enable=true + default.replication.factor=1 + max.partition.fetch.bytes=1048576 + max.request.size=1048576 + message.max.bytes=20000000 + log.dirs=/bitnami/kafka/data + log.flush.interval.messages=10000 + log.flush.interval.ms=1000 + log.retention.hours=4 + log.roll.hours=3 + log.retention.bytes=250000000 + log.segment.bytes=1073741824 +``` + +## 安装 Kafka 集群 + +在 kafka 命名空间中安装 Kafka 集群: + +```bash +helm upgrade --install kafka \ + --create-namespace \ + oci://greptime-registry.cn-hangzhou.cr.aliyuncs.com/charts/kafka \ + --version 31.0.0 \ + -n kafka --values kafka-values.yaml +``` + +
+ 预期输出 + +```bash +Release "kafka" does not exist. Installing it now. +Pulled: greptime-registry.cn-hangzhou.cr.aliyuncs.com/charts/kafka:31.0.0 +Digest: sha256:85b135981fd5d951ceef8b51cdcbc6917ebface50d0eb3367eb7ddc4a5db482b +NAME: kafka +LAST DEPLOYED: Tue May 12 00:57:32 2026 +NAMESPACE: kafka +STATUS: deployed +REVISION: 1 +TEST SUITE: None +NOTES: +CHART NAME: kafka +CHART VERSION: 31.0.0 +APP VERSION: 3.9.0 + +** Please be patient while the chart is being deployed ** + +Kafka can be accessed by consumers via port 9092 on the following DNS name from within your cluster: + + kafka.kafka.svc.cluster.local + +Each Kafka broker can be accessed by producers via port 9092 on the following DNS name(s) from within your cluster: + + kafka-controller-0.kafka-controller-headless.kafka.svc.cluster.local:9092 + kafka-broker-0.kafka-broker-headless.kafka.svc.cluster.local:9092 + +To create a pod that you can use as a Kafka client run the following commands: + + kubectl run kafka-client --restart='Never' --image greptime-registry.cn-hangzhou.cr.aliyuncs.com/greptime/kafka:3.9.0-debian-12-r1 --namespace kafka --command -- sleep infinity + kubectl exec --tty -i kafka-client --namespace kafka -- bash + + PRODUCER: + kafka-console-producer.sh \ + --bootstrap-server kafka.kafka.svc.cluster.local:9092 \ + --topic test + + CONSUMER: + kafka-console-consumer.sh \ + --bootstrap-server kafka.kafka.svc.cluster.local:9092 \ + --topic test \ + --from-beginning + +Substituted images detected: +- greptime-registry.cn-hangzhou.cr.aliyuncs.com/greptime/kafka:3.9.0-debian-12-r1 +``` +
+ +## 验证 Kafka 集群安装 + +检查 Kafka 组件(Broker 和 Controller)的状态: + +```bash +kubectl get pod -n kafka +``` + +
+ 预期输出 +```bash +NAME READY STATUS RESTARTS AGE +kafka-broker-0 1/1 Running 0 8m3s +kafka-broker-1 1/1 Running 0 8m2s +kafka-broker-2 1/1 Running 0 8m1s +kafka-controller-0 1/1 Running 0 8m3s +kafka-controller-1 1/1 Running 0 8m2s +kafka-controller-0 1/1 Running 0 8m1s +``` +
+ +# 配置 Kafka 端点 + +在 Kafka 集群部署完成后,GreptimeDB 可以通过配置 Kafka 端点启用 Remote WAL(远程写前日志),更多参考[此篇文档](/user-guide/deployments-administration/deploy-on-kubernetes/configure-remote-wal.md)。 + +```yaml +remoteWal: + enabled: true + kafka: + brokerEndpoints: + - "kafka-broker-0.kafka-broker-headless.kafka.svc.cluster.local:9092" + - "kafka-broker-1.kafka-broker-headless.kafka.svc.cluster.local:9092" + - "kafka-broker-2.kafka-broker-headless.kafka.svc.cluster.local:9092" +``` + +# 监控 + +- 安装 Prometheus Operator (例如: [kube-prometheus-stack](https://github.com/prometheus-community/helm-charts/tree/main/charts/kube-prometheus-stack))。 +- 安装 podmonitor CRD。 + +要监控 Kafka 集群,你需要提前部署好监控系统(如 Prometheus 和 Grafana)。然后在 `kafka-values.yaml` 中增加以下内容,并重新执行更新 Kafka 配置: + +```yaml +metrics: + jmx: + enabled: true + image: + registry: greptime-registry.cn-hangzhou.cr.aliyuncs.com + repository: greptime/jmx-exporter + tag: 1.0.1-debian-12-r9 + serviceMonitor: + enabled: true + namespace: "kafka" + interval: "10s" + labels: + release: kube-prometheus-stack +``` + +## Grafana dashboard + +使用 [Kubernetes Kafka](https://grafana.com/grafana/dashboards/12483-kubernetes-kafka/) (ID: 12483) 来监控 kafka 的指标。 + +1. 登录你的 Grafana。 +2. 导航至 Dashboards -> New -> Import。 +3. 输入 Dashboard ID: 12483, 选择数据源并加载图表。 + +![Kubernetes Kafka](/kubernetes-kafka-monitoring-dashboard.png) + + +# 卸载 Kafka 集群 + +可以使用以下命令卸载 Kafka 集群: + +```bash +helm -n kafka uninstall kafka +``` + +## 删除 PVCs + +删除 PVCs 操作将会删除 Kafka 集群的持久化数据。请确保在继续操作之前已经备份了数据。 + +```bash +kubectl -n kafka delete pvc -l app.kubernetes.io/instance=kafka +``` diff --git a/i18n/zh/docusaurus-plugin-content-docs/current/user-guide/deployments-administration/deploy-on-kubernetes/deploy-minio.md b/i18n/zh/docusaurus-plugin-content-docs/current/user-guide/deployments-administration/deploy-on-kubernetes/deploy-minio.md new file mode 100644 index 000000000..c68e0cf2a --- /dev/null +++ b/i18n/zh/docusaurus-plugin-content-docs/current/user-guide/deployments-administration/deploy-on-kubernetes/deploy-minio.md @@ -0,0 +1,251 @@ +--- +keywords: [Kubernetes 部署, MinIO, 对象存储, Helm Chart, 监控集成, 分布式存储] +description: 在 Kubernetes 上使用 Helm Chart 部署 MinIO 分布式对象存储集群的指南,包括安装、验证、Bucket 创建和监控集成步骤。 +--- + +# 部署 MinIO 集群 + +在该指南中,你将学会如何使用 Helm Chart 在 Kubernetes 上部署 MinIO 集群。 + +## 前置依赖 + +- Kubernetes >= v1.18.0 +- [kubectl](https://kubernetes.io/docs/tasks/tools/install-kubectl/) >= v1.18.0 +- [Helm](https://helm.sh/docs/intro/install/) >= v3.0.0 + +## 配置管理 + +在安装之前,你需要创建一个 `minio-values.yaml` 配置文件。请根据你的 Kubernetes 环境调整以下配置: + +```yaml +global: + security: + allowInsecureImages: true + +image: + registry: greptime-registry.cn-hangzhou.cr.aliyuncs.com + repository: greptime/minio + tag: 2025.4.22-debian-12-r1 + +auth: + rootUser: greptimedbadmin + rootPassword: "greptimedbadmin" + +resources: + requests: + cpu: 500m + memory: 500Mi + limits: + cpu: '2' + memory: 2Gi + +extraEnvVars: + - name: MINIO_REGION + value: "ap-southeast-1" + +statefulset: + replicaCount: 4 + +mode: distributed + +persistence: + storageClass: null + size: 100Gi +``` + +## 安装 MinIO 集群 + +在 minio 命名空间中安装 MinIO 集群: + +```bash +helm upgrade \ + --install minio oci://greptime-registry.cn-hangzhou.cr.aliyuncs.com/charts/minio \ + --create-namespace \ + --version 16.0.10 \ + -n minio --values minio-values.yaml +``` + +
+ 预期输出 + +```bash +Release "minio" does not exist. Installing it now. +Pulled: greptime-registry.cn-hangzhou.cr.aliyuncs.com/charts/minio:16.0.10 +Digest: sha256:96e220fd7cf1596879a243453b39c96a95d34f0005fdd452da3d094a7b386eb4 +NAME: minio +LAST DEPLOYED: Tue May 12 17:21:30 2026 +NAMESPACE: minio +STATUS: deployed +REVISION: 1 +TEST SUITE: None +NOTES: +CHART NAME: minio +CHART VERSION: 16.0.10 +APP VERSION: 2025.4.22 + +Did you know there are enterprise versions of the Bitnami catalog? For enhanced secure software supply chain features, unlimited pulls from Docker, LTS support, or application customization, see Bitnami Premium or Tanzu Application Catalog. See https://www.arrow.com/globalecs/na/vendors/bitnami for more information. + +** Please be patient while the chart is being deployed ** + +MinIO® can be accessed via port on the following DNS name from within your cluster: + +minio.minio.svc.cluster.local + +To get your credentials run: + +export ROOT_USER=$(kubectl get secret --namespace minio minio -o jsonpath="{.data.root-user}" | base64 -d) +export ROOT_PASSWORD=$(kubectl get secret --namespace minio minio -o jsonpath="{.data.root-password}" | base64 -d) + +To connect to your MinIO® server using a client: + +- Run a MinIO® Client pod and append the desired command (e.g. 'admin info'): + + kubectl run --namespace minio minio-client \ + --rm --tty -i --restart='Never' \ + --env MINIO_SERVER_ROOT_USER=$ROOT_USER \ + --env MINIO_SERVER_ROOT_PASSWORD=$ROOT_PASSWORD \ + --env MINIO_SERVER_HOST=minio \ + --image docker.io/bitnami/minio-client:2025.4.16-debian-12-r1 -- admin info minio + +To access the MinIO® web UI: + +- Get the MinIO® URL: + + echo "MinIO® web URL: http://127.0.0.1:9001/minio" + kubectl port-forward --namespace minio svc/minio 9001:9001 + +Substituted images detected: +- greptime-registry.cn-hangzhou.cr.aliyuncs.com/greptime/minio:2025.4.22-debian-12-r1 + +``` +
+ +## 验证 MinIO 集群安装 + +检查 MinIO Pod 的状态: + +```bash +kubectl get pod -n minio +``` + +
+ 预期输出 +```bash +NAME READY STATUS RESTARTS AGE +minio-0 1/1 Running 0 30s +minio-1 1/1 Running 0 30s +minio-2 1/1 Running 0 30s +minio-3 1/1 Running 0 30s +``` +
+ +# 创建 Bucket 和 Access Key + +## 访问 MinIO 控制台 + +1. 首先需要将 MinIO 控制台服务暴露出来,你可以使用 `kubectl port-forward` 命令: + +```bash +kubectl port-forward -n minio svc/minio 9001:9001 +``` + +2. 打开浏览器访问 http://localhost:9001/login + +3. 使用配置文件中设置的账号密码登录: +- username: `greptimedbadmin` +- password: `greptimedbadmin` + +![MinIO login](/minio-login-page.png) + +## 创建 Bucket + +登录 MinIO 控制台后,按照以下步骤创建 Bucket: + +1. 点击左侧菜单栏的 "Buckets" +2. 点击 "Create Bucket" 按钮 +3. 输入 Bucket 名称,例如:`greptimedb-bucket` +4. 点击 "Create Bucket" 确认创建 + +![MinIO create bucket step 1](/minio-create-bucket-1.png) + +![MinIO create bucket step 2](/minio-create-bucket-2.png) + +## 生成 Access Key + +1. 点击左侧菜单栏的 "Access Keys" +2. 点击 "Create Access Key" 按钮 +3. 可选:设置权限策略 +4. 点击 "Create" 生成 Access Key 和 Secret Key + +![MinIO create access key step 1](/minio-create-access-key-1.png) + +![MinIO create access key step 2](/minio-create-access-key-2.png) + +:::warning +⚠️ 重要:请妥善保存以下信息,在部署 GreptimeDB 时会用到。 +- Bucket 名称:greptimedb-bucket +- Region:ap-southeast-1 +- MinIO Endpoint:`http://minio.minio:9000` +- Access Key:创建时生成的 Access Key +- Secret Key:创建时生成的 Secret Key +::: + +# 配置 GreptimeDB 使用 MinIO + +在部署 GreptimeDB 集群时,可以通过以下配置使用 MinIO 作为后端存储: + +```yaml +objectStorage: + credentials: + accessKeyId: "" + secretAccessKey: "" + s3: + bucket: "greptimedb-bucket" + region: "ap-southeast-1" + root: "greptimedb-data" + endpoint: "http://minio.minio:9000" +``` + +# 监控 + +- 安装 Prometheus Operator (例如: [kube-prometheus-stack](https://github.com/prometheus-community/helm-charts/tree/main/charts/kube-prometheus-stack))。 +- 安装 podmonitor CRD。 + +要监控 MinIO 集群,你需要提前部署好监控系统(如 Prometheus 和 Grafana)。然后在 `minio-values.yaml` 中增加以下内容,并重新执行更新 MinIO 配置: + +```yaml +metrics: + enabled: true + serviceMonitor: + enabled: true + namespace: minio + labels: + release: kube-prometheus-stack + interval: 30s +``` + +## Grafana dashboard + +使用 [MinIO Dashboard](https://grafana.com/grafana/dashboards/13502-minio-dashboard/) (ID: 13502) 来监控 MinIO 的指标。 + +1. 登录你的 Grafana。 +2. 导航至 Dashboards -> New -> Import。 +3. 输入 Dashboard ID: 13502, 选择数据源并加载图表。 + +![MinIO Dashboard](/kubernetes-minio-monitoring-dashboard.png) + +# 卸载 MinIO 集群 + +使用以下命令卸载 MinIO 集群: + +```bash +helm -n minio uninstall minio +``` + +## 删除 PVCs + +删除 PVCs 操作将会删除 MinIO 集群的持久化数据。请确保在继续操作之前已经备份了数据。 + +```bash +kubectl -n minio delete pvc -l app.kubernetes.io/instance=minio +``` diff --git a/i18n/zh/docusaurus-plugin-content-docs/current/user-guide/deployments-administration/deploy-on-kubernetes/overview.md b/i18n/zh/docusaurus-plugin-content-docs/current/user-guide/deployments-administration/deploy-on-kubernetes/overview.md index 2c28bf4d2..163bcb0ec 100644 --- a/i18n/zh/docusaurus-plugin-content-docs/current/user-guide/deployments-administration/deploy-on-kubernetes/overview.md +++ b/i18n/zh/docusaurus-plugin-content-docs/current/user-guide/deployments-administration/deploy-on-kubernetes/overview.md @@ -36,6 +36,8 @@ GreptimeDB 专为云原生环境而构建,从第一天起就可以在 Kubernet 在熟悉了 [GreptimeDB 的架构和组件](/user-guide/concepts/architecture.md)之后,你可以进一步探索高级部署场景: +- [部署 MinIO 集群](deploy-minio.md):学习如何部署,配置和监控 MinIO 集群。 +- [部署 Kafka 集群](deploy-kafka.md):学习如何部署,配置和监控 Kafka 集群。 - [部署带有 Remote WAL 的 GreptimeDB 集群](configure-remote-wal.md):将 Kafka 配置为 GreptimeDB 集群的远程预写日志 (WAL),以持久记录每个数据修改并确保不丢失内存缓存的数据。 - [使用 MySQL/PostgreSQL 作为元数据存储](/user-guide/deployments-administration/deploy-on-kubernetes/common-helm-chart-configurations.md#配置-metasrv-后端存储):集成 MySQL/PostgreSQL 数据库以提供强大的元数据存储功能,增强可靠性和性能。 - [部署多 Frontend 的 GreptimeDB 集群](configure-frontend-groups.md):GreptimeDB 集群的 Frontend 组由多个 Frontend 实例组成,以改善负载分配和可用性。 diff --git a/i18n/zh/docusaurus-plugin-content-docs/current/user-guide/deployments-administration/monitoring/cluster-monitoring-deployment.md b/i18n/zh/docusaurus-plugin-content-docs/current/user-guide/deployments-administration/monitoring/cluster-monitoring-deployment.md index 31dc96a66..336753703 100644 --- a/i18n/zh/docusaurus-plugin-content-docs/current/user-guide/deployments-administration/monitoring/cluster-monitoring-deployment.md +++ b/i18n/zh/docusaurus-plugin-content-docs/current/user-guide/deployments-administration/monitoring/cluster-monitoring-deployment.md @@ -12,49 +12,6 @@ description: 在 Kubernetes 上部署 GreptimeDB 集群的自监控完整指南 你可以在使用 Helm Chart 部署 GreptimeDB 集群时,通过对 `values.yaml` 文件进行配置来启用监控和 Grafana。下面是一个完整的 `values.yaml` 示例,用于部署一个最小化的带有监控和 Grafana 的 GreptimeDB 集群: -```yaml -image: - registry: docker.io - # 镜像仓库: - # OSS GreptimeDB 使用 `greptime/greptimedb`, - # GreptimeDB 企业版配置请咨询工作人员 - repository: - # 镜像标签: - # OSS GreptimeDB 使用数据库版本,例如 `VAR::greptimedbVersion` - # GreptimeDB 企业版配置请咨询工作人员 - tag: - pullSecrets: [] - -initializer: - registry: docker.io - repository: greptime/greptimedb-initializer - tag: "VAR::greptimedbOperatorVersion" - -monitoring: - # 启用监控 - enabled: true - -grafana: - # 用于监控面板 - # 需要先启用监控 `monitoring.enabled: true` 选项 - enabled: true - -frontend: - replicas: 1 - -meta: - replicas: 1 - backendStorage: - etcd: - endpoints: ["etcd.etcd-cluster.svc.cluster.local:2379"] - -datanode: - replicas: 1 -``` - -:::note 备注 -如果你在中国大陆遇到网络访问问题,可直接使用阿里云 OCI 镜像仓库: - ```yaml image: registry: greptime-registry.cn-hangzhou.cr.aliyuncs.com @@ -98,8 +55,10 @@ meta: datanode: replicas: 1 + +flownode: + replicas: 1 ``` -::: 当启用 `monitoring` 后,GreptimeDB Operator 会额外启动一个 GreptimeDB Standalone 实例用于收集 GreptimeDB 集群的指标和日志数据。 为了收集日志数据,GreptimeDB Operator 会在每一个 Pod 中启动一个 [Vector](https://vector.dev/) 的 Sidecar 容器。 @@ -123,7 +82,7 @@ kubectl -n default get pods ```
- Expected Output + 期望输出 ```bash NAME READY STATUS RESTARTS AGE mycluster-datanode-0 2/2 Running 0 77s diff --git a/i18n/zh/docusaurus-plugin-content-docs/version-1.0/enterprise/deployments-administration/deploy-on-kubernetes/installation.md b/i18n/zh/docusaurus-plugin-content-docs/version-1.0/enterprise/deployments-administration/deploy-on-kubernetes/installation.md index 4cd87405f..9d25862b2 100644 --- a/i18n/zh/docusaurus-plugin-content-docs/version-1.0/enterprise/deployments-administration/deploy-on-kubernetes/installation.md +++ b/i18n/zh/docusaurus-plugin-content-docs/version-1.0/enterprise/deployments-administration/deploy-on-kubernetes/installation.md @@ -3,11 +3,73 @@ keywords: [Kubernetes 部署, GreptimeDB 企业版, 安装 GreptimeDB, 启动 Gr description: 在 Kubernetes 上安装 GreptimeDB 企业版的步骤,包括获取镜像、安装 GreptimeDB Operator 和 etcd 集群、配置 values.yaml 和启动 GreptimeDB。 --- -# 部署 GreptimeDB 集群 +# GreptimeDB 企业版部署指南 -GreptimeDB 企业版以 docker 镜像发布。我们为每位国内的客户提供了一个单独的、托管在阿里云上的私有 docker 仓库,你可以使用 docker pull 命令直接拉取,或在 helm chart 中配置。 +## 环境准备 -## 获取 GreptimeDB 企业版镜像 +- [Docker](https://docs.docker.com/get-started/get-docker/) >= v23.0.0 +- [kubectl](https://kubernetes.io/docs/tasks/tools/install-kubectl/) >= v1.21.0 +- [Helm](https://helm.sh/docs/intro/install/) >= v3.0.0 +- [kubernetes](https://kubernetes.io/) >= 1.21 + +## 前言 + +GreptimeDB 企业版部署包括以下组件: +1. GreptimeDB Operator:用于和 Kubernetes 集群交互。 +2. KV 存储:用于存储数据库元数据信息(支持云服务或自建),推荐使用云服务中的 RDS,例如 AWS RDS PostgreSQL。可选以下存储设施: +- PostgreSQL +- MySQL +- ETCD + +3. GreptimeDB 数据库集群,包含以下组件: +- Meta:数据库集群元数据信息管理组件 +- Datanode:数据节点 +- Frontend:入口和协议解析节点 +- Flownode(可选): 流计算节点 +- Vector Sidecar:指标采集 agent +- GreptimeDB Standalone: 集群自监控存储节点 + +4. GreptimeDB Enterprise Dashboard +5. Kafka(可选): 为 GreptimeDB 提供 Remote WAL +6. MinIO(可选): 为 GreptimeDB 提供对象存储,推荐使用云服务中的对象存储(例如:AWS S3) + +其中打`*`的为可选安装: + +| Pod 组件名称 | 副本数量 | CPU (Core) | 内存 (GB) | 磁盘 (Gi) | +|---------------------------------|------|------------|---------|---------| +| ETCD`*` | 3 | 2 | 4 | 10 | +| GreptimeDB Operator | 1 | 1 | 1 | | +| Meta | | | | | +| Datanode | | | | | +| Frontend | | | | | +| Flownode`*` | | | | | +| Vector Sidecar | | | | | +| GreptimeDB Standalone | 1 | 4 | 8 | | +| GreptimeDB Enterprise Dashboard | 1 | | | | +| Kafka`*` | 3 | | | | +| MinIO`*` | 4 | | | | + +## 部署 GreptimeDB Operator + +参考 [GreptimeDB Operator 的管理文档](/user-guide/deployments-administration/deploy-on-kubernetes/greptimedb-operator-management.md)获取详细的安装步骤。 + +## 部署 ETCD (可选) + +参考 [管理 ETCD](/user-guide/deployments-administration/manage-metadata/manage-etcd.md)获取详细的安装步骤。 + +## 部署 Kafka (可选) + +参考 [部署 Kafka 集群](/user-guide/deployments-administration/deploy-on-kubernetes/deploy-kafka.md)获取详细的安装步骤。 + +## 部署 MinIO (可选) + +参考 [部署 MinIO 集群](/user-guide/deployments-administration/deploy-on-kubernetes/deploy-minio.md)获取详细的安装步骤。 + +## 安装及启动 GreptimeDB + +### 获取 GreptimeDB 企业版镜像 + +GreptimeDB 企业版以 docker 镜像发布。我们为每位客户提供了一个单独的、托管在阿里云上的私有 docker 仓库,你可以使用 docker pull 命令直接拉取,或在 helm chart 中配置。 你需要在 helm chart 的 `values.yaml` 文件中配置镜像信息以获得专属的 GreptimeDB 企业版,例如: @@ -34,9 +96,394 @@ image: 因此 `customImageRegistry.secretName` 和 `image.pullSecrets` 需要保持一致以保证拉取镜像时能够找到正确的认证信息。 请联系 Greptime 工作人员获取上述配置项的具体值。 -Greptime 工作人员在首次交付给你 GreptimeDB 企业版时,会通过邮件或其他方式告知你 docker 仓库地址和用户名密码。请妥善保存,并切勿分享给外部人员! +Greptime 工作人员在首次交付给你 GreptimeDB 企业版时,会通过邮件或其他方式告知你镜像仓库地址和用户名密码。请妥善保存,并切勿分享给外部人员! + +### 配置管理 + +在安装之前,你需要创建一个文件来配置 GreptimeDB 集群。请根据你的 Kubernetes 环境调整,更多配置请参考[文档](/user-guide/deployments-administration/deploy-on-kubernetes/common-helm-chart-configurations.md)。以下是 `greptimedb-cluster-values.yaml` 的参考配置: + +```yaml +customImageRegistry: + enabled: true + # -- pull secret 名称,可自定义,需要和 `image.pullSecrets` 保持一致 + secretName: greptimedb-custom-image-pull-secret + registry: + username: + password: + +image: + registry: + repository: + tag: + pullSecrets: + - greptimedb-custom-image-pull-secret + +additionalLabels: {} + +initializer: + registry: greptime-registry.cn-hangzhou.cr.aliyuncs.com + repository: greptime/greptimedb-initializer + tag: "VAR::greptimedbOperatorVersion" + +# -- Meta 配置 +meta: + # -- Meta 副本数 + replicas: 3 + + backendStorage: + # 可选 + # KV 存储配置,本配置连接到 ETCD + etcd: + endpoints: ["etcd.etcd-cluster.svc.cluster.local:2379"] + # 以下是一个使用 PostgreSQL 作为 KV 存储的示例 + # postgresql: + # host: "postgres.default.svc.cluster.local" + # port: 5432 + # database: "metasrv" + # table: "greptime_metakv" + # electionLockID: 1 + # credentials: + # secretName: "meta-postgresql-credentials" + # username: "root" + # password: "root" + + podTemplate: + main: + # Meta 资源配置 + resources: + requests: + cpu: '2' + memory: 4Gi + limits: + cpu: '2' + memory: 4Gi + affinity: + podAntiAffinity: + preferredDuringSchedulingIgnoredDuringExecution: + - podAffinityTerm: + labelSelector: + matchLabels: + app.greptime.io/component: greptimedb-meta + topologyKey: kubernetes.io/hostname + weight: 1 + +# -- Datanode 配置 +datanode: + # -- Datanode 副本数量 + replicas: 3 + + # -- Datanode 配置 + configData: |- + [[region_engine]] + [region_engine.mito] + write_cache_size = "20G" + write_cache_ttl = "7d" + + podTemplate: + main: + # -- Datanode 资源设置 + resources: + requests: + cpu: '8' + memory: 16Gi + limits: + cpu: '8' + memory: 16Gi + affinity: + podAntiAffinity: + preferredDuringSchedulingIgnoredDuringExecution: + - podAffinityTerm: + labelSelector: + matchLabels: + app.greptime.io/component: greptimedb-datanode + topologyKey: kubernetes.io/hostname + weight: 1 + # -- Datanode 本地磁盘配置 + storage: + storageClassName: null + # -- 本地磁盘大小 + storageSize: 100Gi + # -- Storage retain policy for datanode persistent volume + storageRetainPolicy: Retain + +# -- Frontend 配置 +frontend: + # -- Frontend 副本数 + replicas: 3 + + podTemplate: + main: + # Frontend 资源配置 + resources: + requests: + cpu: '8' + memory: 16Gi + limits: + cpu: '8' + memory: 16Gi + affinity: + podAntiAffinity: + preferredDuringSchedulingIgnoredDuringExecution: + - podAffinityTerm: + labelSelector: + matchLabels: + app.greptime.io/component: greptimedb-frontend + topologyKey: kubernetes.io/hostname + weight: 1 + +# -- Flownode 配置 +flownode: + # -- 是否部署 flownode + enabled: false + # -- Flownode 副本数 + replicas: 1 + + podTemplate: + main: + resources: + requests: + cpu: '8' + memory: 16Gi + limits: + cpu: '8' + memory: 16Gi + +# -- 数据库自监控配置 +monitoring: + # -- 打开自监控 + enabled: true + standalone: + base: + imagePullSecrets: + - name: "greptimedb-custom-image-pull-secret" + main: + # 自监控资源配置 + resources: + requests: + cpu: '4' + memory: 8Gi + limits: + cpu: '4' + memory: 8Gi + # 自监控 standalone 存储位置,可按需打开存放至对象存储 + # objectStorage: + # s3: + # secretName: "greptimedb-object-storage-secret" + # bucket: "greptimedb-bucket" + # region: "ap-southeast-1" + # root: "greptimedb-monitor-data" + # endpoint: "http://minio.minio:9000" + # 自监控本地磁盘大小 + datanodeStorage: + fs: + storageClassName: null + storageSize: 100Gi + # sidecar vector 配置 + vector: + registry: greptime-registry.cn-hangzhou.cr.aliyuncs.com + repository: timberio/vector + tag: 0.46.1-debian + # sidecar vector 资源配置 + resources: + requests: + cpu: '1' + memory: 1Gi + limits: + cpu: '1' + memory: "1Gi" + +# 对象存储相关配置,按需打开 +# 使用 MinIO +# objectStorage: +# existingSecretName: "greptimedb-object-storage-secret" +# cache: +# cacheCapacity: "50GiB" +# s3: +# bucket: "greptimedb-bucket" +# region: "ap-southeast-1" +# root: "greptimedb-data" +# endpoint: "http://minio.minio:9000" + +# 打开企业版用户和权限配置 +auth: + enabled: true + useBuiltIn: true + mountPath: "/etc/greptimedb/auth" + fileName: "passwd" + users: + # 默认的 admin 用户名,按需修改 + - username: "superuser" + # 初始化 admin 账户的密码,按需修改 + password: "1fa44bbc-5ded-42bd-a3f1-c3621affce63" + permission: "admin" + +# Remote WAL相关配置,按需打开 +# remoteWal: +# enabled: true +# kafka: +# brokerEndpoints: +# - "kafka-broker-0.kafka-broker-headless.kafka.svc.cluster.local:9092" +# - "kafka-broker-1.kafka-broker-headless.kafka.svc.cluster.local:9092" +# - "kafka-broker-2.kafka-broker-headless.kafka.svc.cluster.local:9092" +``` + +### 启动 GreptimeDB + +在 `greptimedb` 命名空间中安装 GreptimeDB 集群: +```bash +helm upgrade --install greptimedb \ + --create-namespace \ + oci://greptime-registry.cn-hangzhou.cr.aliyuncs.com/charts/greptimedb-cluster \ + -n greptimedb --values greptimedb-cluster-values.yaml +``` + +验证 GreptimeDB 安装: + +```bash +kubectl get pod -n greptimedb +``` + +
+ 预期输出 +```bash +NAME READY STATUS RESTARTS AGE +greptimedb-datanode-0 2/2 Running 0 2m33s +greptimedb-datanode-1 2/2 Running 0 2m33s +greptimedb-datanode-2 2/2 Running 0 2m33s +greptimedb-frontend-74999c79cc-pzj8w 2/2 Running 0 17s +greptimedb-frontend-74999c79cc-rm2fb 2/2 Running 0 17s +greptimedb-frontend-74999c79cc-zbtdg 2/2 Running 0 17s +greptimedb-meta-56dc894867-jpt5c 2/2 Running 0 4m29s +greptimedb-meta-56dc894867-tpw4c 2/2 Running 0 4m29s +greptimedb-meta-56dc894867-wmh1t 2/2 Running 0 4m29s +greptimedb-monitor-standalone-0 1/1 Running 0 4m42s +``` +
+ +## 部署 Enterprise Dashboard + +### 配置管理 + +在安装之前,你需要创建一个文件 `dashboard-values.yaml` 来配置 dashboard,以下是配置示例: + +```yaml +replicaCount: 1 + +image: + # 请咨询 Greptime 工作人员获取 + repository: + tag: + pullPolicy: IfNotPresent + +imagePullSecrets: + - name: greptimedb-custom-image-pull-secret + +nameOverride: "" +fullnameOverride: "" + +config: | + servicePort: 19095 + logLevel: info + enableLicenseManager: true + enableUserAuthentication: true + backendStore: + type: sqlite + sqlite: + dataDir: /data + provisionedInstances: + - name: greptimedb + namespace: greptimedb + type: cluster + settings: + basic: + url: http://greptimedb-frontend.greptimedb.svc.cluster.local:4000 + meta_url: http://greptimedb-meta.greptimedb.svc.cluster.local:4000 + monitoring: + greptimedb: + url: http://greptimedb-monitor-standalone.greptimedb.svc.cluster.local:4000 + license: + secret_name: greptimedb-license + secret_namespace: greptimedb + +servicePort: 19095 + +serviceAccount: + create: true + annotations: {} + name: "" + +podAnnotations: {} + +podSecurityContext: {} + # fsGroup: 2000 + +securityContext: {} + +service: + type: ClusterIP + port: 19095 + annotations: {} + +# dashboard 资源配置 +resources: + requests: + cpu: '1' + memory: 1Gi + limits: + cpu: '1' + memory: 1Gi + +nodeSelector: {} +tolerations: [] +affinity: {} +``` + +### 启动 Enterprise Dashboard + +```bash +helm upgrade --install greptimedb-enterprise-dashboard \ + oci://greptime-registry.cn-hangzhou.cr.aliyuncs.com/charts/greptimedb-enterprise-dashboard \ + -n greptimedb \ + --values dashboard-values.yaml +``` + +验证 Enterprise Dashboard 安装: + +```bash +kubectl get pod -n greptimedb | grep enterprise-dashboard +``` + +
+ 预期输出 +```bash +greptimedb-enterprise-dashboard-67f498d6f9-n89z5 1/1 Running 0 27s +``` +
+ +```bash +kubectl get svc -n greptimedb | grep enterprise-dashboard +``` + +
+ 预期输出 +```bash +greptimedb-enterprise-dashboard ClusterIP 10.96.80.175 19095/TCP 89s +``` +
+ +### 登录 Enterprise Dashboard + +访问 dashboard service 的 19095 端口进行登录 + +![Enterprise Dashboard Login](/enterprise-dashboard-login.png) -## 安装及启动 +使用数据库部署中的 superuser 账号密码进行登录,可见: -请参考[部署 GreptimeDB 集群](/user-guide/deployments-administration/deploy-on-kubernetes/deploy-greptimedb-cluster.md)文档。 +![Enterprise Dashboard Page](/enterprise-dashboard-login.png) +1. 查询:使用 SQL 查询数据 +2. Logs 查询:使用 UI 查询 log 表 +3. 集群概览:当前集群统计信息 +4. 指标监控:数据库集群的自身监控指标 +5. 实例日志:数据库自身的日志 +6. 用户管理:增删改用户账号 diff --git a/i18n/zh/docusaurus-plugin-content-docs/version-1.0/enterprise/deployments-administration/deploy-on-kubernetes/overview.md b/i18n/zh/docusaurus-plugin-content-docs/version-1.0/enterprise/deployments-administration/deploy-on-kubernetes/overview.md index 75c8e8bdf..fa90f6d9c 100644 --- a/i18n/zh/docusaurus-plugin-content-docs/version-1.0/enterprise/deployments-administration/deploy-on-kubernetes/overview.md +++ b/i18n/zh/docusaurus-plugin-content-docs/version-1.0/enterprise/deployments-administration/deploy-on-kubernetes/overview.md @@ -1,6 +1,6 @@ --- keywords: [Kubernetes 部署, Operator 模式, 自动化管理, 集群部署, 单机实例, 私有云, 公有云] -description: 在 Kubernetes 上部署 GreptimeDB 的概述,包括集群的安装、升级和监控等内容。 +description: 在 Kubernetes 上部署 GreptimeDB 企业版的概述,包括集群的安装、升级和监控等内容。 --- # 在 Kubernetes 上部署 GreptimeDB @@ -9,7 +9,7 @@ GreptimeDB 企业版在 Kubernetes 上的部署流程与开源版基本一致, ## 安装 -要了解如何通过 Helm Chart 启动 GreptimeDB,请前往[安装 GreptimeDB](./installation.md) 页面。 +要了解如何通过 Helm Chart 启动 GreptimeDB 企业版,请前往[安装 GreptimeDB](./installation.md) 页面。 ## 升级 diff --git a/i18n/zh/docusaurus-plugin-content-docs/version-1.0/enterprise/deployments-administration/monitoring/self-monitor-cluster.md b/i18n/zh/docusaurus-plugin-content-docs/version-1.0/enterprise/deployments-administration/monitoring/self-monitor-cluster.md deleted file mode 100644 index 83a2f4799..000000000 --- a/i18n/zh/docusaurus-plugin-content-docs/version-1.0/enterprise/deployments-administration/monitoring/self-monitor-cluster.md +++ /dev/null @@ -1,116 +0,0 @@ ---- -keywords: [Kubernetes 部署, 企业集群, 监控] -description: 在 Kubernetes 上为 GreptimeDB 企业集群部署自监控的完整指南,包括 Grafana 仪表板设置和配置选项 ---- - -# 自监控 GreptimeDB 集群 - -在阅读本文档之前,请确保你了解如何[在 Kubernetes 上部署 GreptimeDB 企业集群](/enterprise/deployments-administration/deploy-on-kubernetes/installation.md)。 -本文将介绍在部署 GreptimeDB 集群时如何配置监控。 - -## 快速开始 - -你可以通过在使用 Helm Chart 部署 GreptimeDB 集群时向 `values.yaml` 文件添加配置来启用监控和 [GreptimeDB 控制台](/enterprise/console-ui.md)。 -以下是部署带有监控和 GreptimeDB 控制台的最小 GreptimeDB 集群的完整 `values.yaml` 文件示例: - -```yaml -customImageRegistry: - enabled: true - # -- pull secret 名称,可自定义,需要和 `image.pullSecrets` 保持一致 - secretName: greptimedb-custom-image-pull-secret - # 请咨询工作人员获得 registry、username 和 password - registry: - username: - password: - -image: - registry: - repository: - tag: - pullSecrets: - - greptimedb-custom-image-pull-secret - -initializer: - # 请咨询工作人员获得 registry、repository 和 tag - registry: - repository: greptime/greptimedb-initializer - tag: - -monitoring: - # 启用监控 - enabled: true - -greptimedb-enterprise-dashboard: - # 启用 greptimedb-enterprise-dashboard 部署。 - # 需要首先启用监控(monitoring.enabled: true) - enabled: true - image: - # 请咨询工作人员获得 repository 和 tag - repository: - tag: - -frontend: - replicas: 1 - -meta: - replicas: 1 - backendStorage: - etcd: - endpoints: ["etcd.etcd-cluster.svc.cluster.local:2379"] - -datanode: - replicas: 1 -``` - -启用 `monitoring` 后,GreptimeDB Operator 会额外启动一个 GreptimeDB Standalone 实例来收集 GreptimeDB 集群的指标和日志。 -为了收集日志数据,GreptimeDB Operator 会在每个 Pod 中启动一个 [Vector](https://vector.dev/) Sidecar 容器。 - -当启用 `greptimedb-enterprise-dashboard` 时,GreptimeDB Operator 会部署企业版控制台,它使用为集群监控配置的 GreptimeDB Standalone 实例作为数据源,并为 GreptimeDB 集群提供管理功能。 - -使用上述 `values.yaml` 文件安装 GreptimeDB 集群: - -```bash -helm upgrade --install mycluster \ - greptime/greptimedb-cluster \ - --values /path/to/values.yaml \ - -n default -``` - -接下来参考下方的[访问 GreptimeDB 企业控制台](#访问-greptimedb-控制台)部分了解如何访问控制台。 - -## 监控配置 - -请参考开源 GreptimeDB 的[监控配置](/user-guide/deployments-administration/monitoring/cluster-monitoring-deployment.md#配置监控数据的收集)文档获取详细的监控配置说明。 - -## GreptimeDB 控制台配置 - -### 启用 GreptimeDB 控制台 - -请在 `values.yaml` 中添加以下配置启用 GreptimeDB 控制台。 -注意该功能需要首先启用监控(`monitoring.enabled: true`): - -```yaml -monitoring: - enabled: true - -greptimedb-enterprise-dashboard: - enabled: true -``` - -### 访问 GreptimeDB 控制台 - -你可以通过将服务端口转发到本地来访问 GreptimeDB 控制台: - -```bash -kubectl -n ${namespace} port-forward svc/${cluster-name}-greptimedb-enterprise-console 18080:19095 -``` - -然后打开 `http://localhost:18080` 访问 GreptimeDB 控制台。 - -有关控制台功能和界面的详细信息,请参考[控制台](/enterprise/console-ui.md)文档。 - -## 清理 PVC - -请参考开源 GreptimeDB 文档的[清理 PVC](/user-guide/deployments-administration/monitoring/cluster-monitoring-deployment.md#清理-pvc)部分。 - - diff --git a/i18n/zh/docusaurus-plugin-content-docs/version-1.0/enterprise/deployments-administration/overview.md b/i18n/zh/docusaurus-plugin-content-docs/version-1.0/enterprise/deployments-administration/overview.md index e8d113643..f018567fe 100644 --- a/i18n/zh/docusaurus-plugin-content-docs/version-1.0/enterprise/deployments-administration/overview.md +++ b/i18n/zh/docusaurus-plugin-content-docs/version-1.0/enterprise/deployments-administration/overview.md @@ -1,5 +1,5 @@ --- -keywords: [鉴权认证, 部署, 监控, Kubernetes 部署, GreptimeDB 部署, GreptimeDB 监控] +keywords: [鉴权认证, 部署, 监控, Kubernetes 部署, GreptimeDB 企业版部署, GreptimeDB 监控] description: GreptimeDB 企业版的部署指南,包括鉴权认证、Kubernetes 部署和监控等内容。 --- diff --git a/i18n/zh/docusaurus-plugin-content-docs/version-1.0/user-guide/deployments-administration/deploy-on-kubernetes/deploy-greptimedb-cluster.md b/i18n/zh/docusaurus-plugin-content-docs/version-1.0/user-guide/deployments-administration/deploy-on-kubernetes/deploy-greptimedb-cluster.md index dedbe7143..843c93166 100644 --- a/i18n/zh/docusaurus-plugin-content-docs/version-1.0/user-guide/deployments-administration/deploy-on-kubernetes/deploy-greptimedb-cluster.md +++ b/i18n/zh/docusaurus-plugin-content-docs/version-1.0/user-guide/deployments-administration/deploy-on-kubernetes/deploy-greptimedb-cluster.md @@ -234,41 +234,10 @@ http://etcd-2.etcd-headless.etcd-cluster.svc.cluster.local:2379 is healthy: succ ```yaml image: - registry: docker.io - # 镜像仓库: - # OSS GreptimeDB 使用 `greptime/greptimedb`, + # 镜像仓库地址: + # OSS GreptimeDB 使用 `greptime-registry.cn-hangzhou.cr.aliyuncs.com`, # Enterprise GreptimeDB 请咨询工作人员 - repository: - # 镜像标签: - # OSS GreptimeDB 使用数据库版本,例如 `VAR::greptimedbVersion` - # Enterprise GreptimeDB 请咨询工作人员 - tag: - pullSecrets: [] - -initializer: - registry: docker.io - repository: greptime/greptimedb-initializer - tag: "VAR::greptimedbOperatorVersion" - -frontend: - replicas: 1 - -meta: - replicas: 1 - backendStorage: - etcd: - endpoints: ["etcd.etcd-cluster.svc.cluster.local:2379"] - -datanode: - replicas: 1 -``` - -:::note 备注 -中国大陆用户如有网络访问问题,可直接使用阿里云 OCI 镜像仓库: - -```yaml -image: - registry: greptime-registry.cn-hangzhou.cr.aliyuncs.com + registry: # 镜像仓库: # OSS GreptimeDB 使用 `greptime/greptimedb`, # Enterprise GreptimeDB 请咨询工作人员 @@ -295,8 +264,10 @@ meta: datanode: replicas: 1 + +flownode: + replicas: 1 ``` -::: 上述配置不适用于严肃的生产环境,请根据自己的需求调整配置。 可参考[配置文档](/user-guide/deployments-administration/deploy-on-kubernetes/common-helm-chart-configurations.md)获取完整的 `values.yaml` 的配置项。 diff --git a/i18n/zh/docusaurus-plugin-content-docs/version-1.0/user-guide/deployments-administration/deploy-on-kubernetes/deploy-greptimedb-standalone.md b/i18n/zh/docusaurus-plugin-content-docs/version-1.0/user-guide/deployments-administration/deploy-on-kubernetes/deploy-greptimedb-standalone.md index b3e098fd8..c4dbe1901 100644 --- a/i18n/zh/docusaurus-plugin-content-docs/version-1.0/user-guide/deployments-administration/deploy-on-kubernetes/deploy-greptimedb-standalone.md +++ b/i18n/zh/docusaurus-plugin-content-docs/version-1.0/user-guide/deployments-administration/deploy-on-kubernetes/deploy-greptimedb-standalone.md @@ -26,7 +26,7 @@ helm upgrade --install greptimedb-standalone greptime/greptimedb-standalone -n d ```
- Expected Output + 期望输出 ```bash Release "greptimedb-standalone" does not exist. Installing it now. NAME: greptimedb-standalone @@ -54,7 +54,7 @@ kubectl get pod -n default ```
- Expected Output + 期望输出 ```bash NAME READY STATUS RESTARTS AGE greptimedb-standalone-0 1/1 Running 0 40s @@ -86,7 +86,7 @@ helm upgrade --install greptimedb-standalone greptime/greptimedb-standalone \ ```
- Expected Output + 期望输出 ```bash Release "greptimedb-standalone" has been upgraded. Happy Helming! NAME: greptimedb-standalone @@ -114,7 +114,7 @@ kubectl get pod -n default ```
- Expected Output + 期望输出 ```bash NAME READY STATUS RESTARTS AGE greptimedb-standalone-0 1/1 Running 0 3s @@ -136,7 +136,7 @@ mysql -h 127.0.0.1 -P 4002 ```
- Expected Output + 期望输出 ```bash Welcome to the MariaDB monitor. Commands end with ; or \g. Your MySQL connection id is 8 @@ -161,7 +161,7 @@ psql -h 127.0.0.1 -p 4003 -d public ```
- Expected Output + 期望输出 ```bash psql (16.2, server 16.3-GreptimeDB-1.0.1) Type "help" for help. @@ -183,7 +183,7 @@ curl -X POST \ ```
- Expected Output + 期望输出 ```json { "output": [ diff --git a/i18n/zh/docusaurus-plugin-content-docs/version-1.0/user-guide/deployments-administration/deploy-on-kubernetes/deploy-kafka.md b/i18n/zh/docusaurus-plugin-content-docs/version-1.0/user-guide/deployments-administration/deploy-on-kubernetes/deploy-kafka.md new file mode 100644 index 000000000..a2f6d602c --- /dev/null +++ b/i18n/zh/docusaurus-plugin-content-docs/version-1.0/user-guide/deployments-administration/deploy-on-kubernetes/deploy-kafka.md @@ -0,0 +1,235 @@ +--- +keywords: [Kubernetes 部署, Kafka, Helm Chart, 监控集成] +description: 在 Kubernetes 上使用 Helm Chart 部署 Kafka 集群的指南,包括安装、验证和监控集成步骤。 +--- + +# 部署 Kafka 集群 + +在该指南中,你将学会如何使用 Helm Chart 在 Kubernetes 上部署 Kafka 集群。 + +## 前置依赖 + +- Kubernetes >= v1.18.0 +- [kubectl](https://kubernetes.io/docs/tasks/tools/install-kubectl/) >= v1.18.0 +- [Helm](https://helm.sh/docs/intro/install/) >= v3.0.0 + +## 配置管理 + +在安装之前,你需要创建一个文件来配置 Kafka 集群。请根据你的 Kubernetes 环境调整,以下是 `kafka-values.yaml` 的参考配置: + +```yaml +image: + registry: greptime-registry.cn-hangzhou.cr.aliyuncs.com + repository: greptime/kafka + tag: 3.9.0-debian-12-r1 + +listeners: + client: + containerPort: 9092 + protocol: PLAINTEXT + name: CLIENT + controller: + protocol: PLAINTEXT + +heapOpts: "-Xmx512m -Xms512m -XX:MetaspaceSize=96m -XX:+UseG1GC -XX:MaxGCPauseMillis=20 -XX:InitiatingHeapOccupancyPercent=35 -XX:G1HeapRegionSize=16M -XX:MinMetaspaceFreeRatio=50 -XX:MaxMetaspaceFreeRatio=80 -XX:+ExplicitGCInvokesConcurrent" + +controller: + replicaCount: 3 + resources: + limits: + cpu: '1' + memory: 1Gi + requests: + cpu: 500m + memory: 512Mi + persistence: + enabled: true + storageClass: "" + size: 50Gi + +broker: + replicaCount: 3 + resources: + limits: + cpu: '1' + memory: 1Gi + requests: + cpu: 500m + memory: 512Mi + persistence: + enabled: true + storageClass: "" + size: 50Gi + +extraConfig: | + num.network.threads=3 + num.io.threads=8 + min.insync.replicas=1 + socket.send.buffer.bytes=102400 + socket.receive.buffer.bytes=102400 + socket.request.max.bytes=104857600 + num.recovery.threads.per.data.dir=1 + offsets.topic.replication.factor=1 + transaction.state.log.replication.factor=1 + transaction.state.log.min.isr=1 + allow.everyone.if.no.acl.found=true + auto.create.topics.enable=true + default.replication.factor=1 + max.partition.fetch.bytes=1048576 + max.request.size=1048576 + message.max.bytes=20000000 + log.dirs=/bitnami/kafka/data + log.flush.interval.messages=10000 + log.flush.interval.ms=1000 + log.retention.hours=4 + log.roll.hours=3 + log.retention.bytes=250000000 + log.segment.bytes=1073741824 +``` + +## 安装 Kafka 集群 + +在 kafka 命名空间中安装 Kafka 集群: + +```bash +helm upgrade --install kafka \ + --create-namespace \ + oci://greptime-registry.cn-hangzhou.cr.aliyuncs.com/charts/kafka \ + --version 31.0.0 \ + -n kafka --values kafka-values.yaml +``` + +
+ 预期输出 + +```bash +Release "kafka" does not exist. Installing it now. +Pulled: greptime-registry.cn-hangzhou.cr.aliyuncs.com/charts/kafka:31.0.0 +Digest: sha256:85b135981fd5d951ceef8b51cdcbc6917ebface50d0eb3367eb7ddc4a5db482b +NAME: kafka +LAST DEPLOYED: Tue May 12 00:57:32 2026 +NAMESPACE: kafka +STATUS: deployed +REVISION: 1 +TEST SUITE: None +NOTES: +CHART NAME: kafka +CHART VERSION: 31.0.0 +APP VERSION: 3.9.0 + +** Please be patient while the chart is being deployed ** + +Kafka can be accessed by consumers via port 9092 on the following DNS name from within your cluster: + + kafka.kafka.svc.cluster.local + +Each Kafka broker can be accessed by producers via port 9092 on the following DNS name(s) from within your cluster: + + kafka-controller-0.kafka-controller-headless.kafka.svc.cluster.local:9092 + kafka-broker-0.kafka-broker-headless.kafka.svc.cluster.local:9092 + +To create a pod that you can use as a Kafka client run the following commands: + + kubectl run kafka-client --restart='Never' --image greptime-registry.cn-hangzhou.cr.aliyuncs.com/greptime/kafka:3.9.0-debian-12-r1 --namespace kafka --command -- sleep infinity + kubectl exec --tty -i kafka-client --namespace kafka -- bash + + PRODUCER: + kafka-console-producer.sh \ + --bootstrap-server kafka.kafka.svc.cluster.local:9092 \ + --topic test + + CONSUMER: + kafka-console-consumer.sh \ + --bootstrap-server kafka.kafka.svc.cluster.local:9092 \ + --topic test \ + --from-beginning + +Substituted images detected: +- greptime-registry.cn-hangzhou.cr.aliyuncs.com/greptime/kafka:3.9.0-debian-12-r1 +``` +
+ +## 验证 Kafka 集群安装 + +检查 Kafka 组件(Broker 和 Controller)的状态: + +```bash +kubectl get pod -n kafka +``` + +
+ 预期输出 +```bash +NAME READY STATUS RESTARTS AGE +kafka-broker-0 1/1 Running 0 8m3s +kafka-broker-1 1/1 Running 0 8m2s +kafka-broker-2 1/1 Running 0 8m1s +kafka-controller-0 1/1 Running 0 8m3s +kafka-controller-1 1/1 Running 0 8m2s +kafka-controller-0 1/1 Running 0 8m1s +``` +
+ +# 配置 Kafka 端点 + +在 Kafka 集群部署完成后,GreptimeDB 可以通过配置 Kafka 端点启用 Remote WAL(远程写前日志),更多参考[此篇文档](/user-guide/deployments-administration/deploy-on-kubernetes/configure-remote-wal.md)。 + +```yaml +remoteWal: + enabled: true + kafka: + brokerEndpoints: + - "kafka-broker-0.kafka-broker-headless.kafka.svc.cluster.local:9092" + - "kafka-broker-1.kafka-broker-headless.kafka.svc.cluster.local:9092" + - "kafka-broker-2.kafka-broker-headless.kafka.svc.cluster.local:9092" +``` + +# 监控 + +- 安装 Prometheus Operator (例如: [kube-prometheus-stack](https://github.com/prometheus-community/helm-charts/tree/main/charts/kube-prometheus-stack))。 +- 安装 podmonitor CRD。 + +要监控 Kafka 集群,你需要提前部署好监控系统(如 Prometheus 和 Grafana)。然后在 `kafka-values.yaml` 中增加以下内容,并重新执行更新 Kafka 配置: + +```yaml +metrics: + jmx: + enabled: true + image: + registry: greptime-registry.cn-hangzhou.cr.aliyuncs.com + repository: greptime/jmx-exporter + tag: 1.0.1-debian-12-r9 + serviceMonitor: + enabled: true + namespace: "kafka" + interval: "10s" + labels: + release: kube-prometheus-stack +``` + +## Grafana dashboard + +使用 [Kubernetes Kafka](https://grafana.com/grafana/dashboards/12483-kubernetes-kafka/) (ID: 12483) 来监控 kafka 的指标。 + +1. 登录你的 Grafana。 +2. 导航至 Dashboards -> New -> Import。 +3. 输入 Dashboard ID: 12483, 选择数据源并加载图表。 + +![Kubernetes Kafka](/kubernetes-kafka-monitoring-dashboard.png) + + +# 卸载 Kafka 集群 + +可以使用以下命令卸载 Kafka 集群: + +```bash +helm -n kafka uninstall kafka +``` + +## 删除 PVCs + +删除 PVCs 操作将会删除 Kafka 集群的持久化数据。请确保在继续操作之前已经备份了数据。 + +```bash +kubectl -n kafka delete pvc -l app.kubernetes.io/instance=kafka +``` diff --git a/i18n/zh/docusaurus-plugin-content-docs/version-1.0/user-guide/deployments-administration/deploy-on-kubernetes/deploy-minio.md b/i18n/zh/docusaurus-plugin-content-docs/version-1.0/user-guide/deployments-administration/deploy-on-kubernetes/deploy-minio.md new file mode 100644 index 000000000..c68e0cf2a --- /dev/null +++ b/i18n/zh/docusaurus-plugin-content-docs/version-1.0/user-guide/deployments-administration/deploy-on-kubernetes/deploy-minio.md @@ -0,0 +1,251 @@ +--- +keywords: [Kubernetes 部署, MinIO, 对象存储, Helm Chart, 监控集成, 分布式存储] +description: 在 Kubernetes 上使用 Helm Chart 部署 MinIO 分布式对象存储集群的指南,包括安装、验证、Bucket 创建和监控集成步骤。 +--- + +# 部署 MinIO 集群 + +在该指南中,你将学会如何使用 Helm Chart 在 Kubernetes 上部署 MinIO 集群。 + +## 前置依赖 + +- Kubernetes >= v1.18.0 +- [kubectl](https://kubernetes.io/docs/tasks/tools/install-kubectl/) >= v1.18.0 +- [Helm](https://helm.sh/docs/intro/install/) >= v3.0.0 + +## 配置管理 + +在安装之前,你需要创建一个 `minio-values.yaml` 配置文件。请根据你的 Kubernetes 环境调整以下配置: + +```yaml +global: + security: + allowInsecureImages: true + +image: + registry: greptime-registry.cn-hangzhou.cr.aliyuncs.com + repository: greptime/minio + tag: 2025.4.22-debian-12-r1 + +auth: + rootUser: greptimedbadmin + rootPassword: "greptimedbadmin" + +resources: + requests: + cpu: 500m + memory: 500Mi + limits: + cpu: '2' + memory: 2Gi + +extraEnvVars: + - name: MINIO_REGION + value: "ap-southeast-1" + +statefulset: + replicaCount: 4 + +mode: distributed + +persistence: + storageClass: null + size: 100Gi +``` + +## 安装 MinIO 集群 + +在 minio 命名空间中安装 MinIO 集群: + +```bash +helm upgrade \ + --install minio oci://greptime-registry.cn-hangzhou.cr.aliyuncs.com/charts/minio \ + --create-namespace \ + --version 16.0.10 \ + -n minio --values minio-values.yaml +``` + +
+ 预期输出 + +```bash +Release "minio" does not exist. Installing it now. +Pulled: greptime-registry.cn-hangzhou.cr.aliyuncs.com/charts/minio:16.0.10 +Digest: sha256:96e220fd7cf1596879a243453b39c96a95d34f0005fdd452da3d094a7b386eb4 +NAME: minio +LAST DEPLOYED: Tue May 12 17:21:30 2026 +NAMESPACE: minio +STATUS: deployed +REVISION: 1 +TEST SUITE: None +NOTES: +CHART NAME: minio +CHART VERSION: 16.0.10 +APP VERSION: 2025.4.22 + +Did you know there are enterprise versions of the Bitnami catalog? For enhanced secure software supply chain features, unlimited pulls from Docker, LTS support, or application customization, see Bitnami Premium or Tanzu Application Catalog. See https://www.arrow.com/globalecs/na/vendors/bitnami for more information. + +** Please be patient while the chart is being deployed ** + +MinIO® can be accessed via port on the following DNS name from within your cluster: + +minio.minio.svc.cluster.local + +To get your credentials run: + +export ROOT_USER=$(kubectl get secret --namespace minio minio -o jsonpath="{.data.root-user}" | base64 -d) +export ROOT_PASSWORD=$(kubectl get secret --namespace minio minio -o jsonpath="{.data.root-password}" | base64 -d) + +To connect to your MinIO® server using a client: + +- Run a MinIO® Client pod and append the desired command (e.g. 'admin info'): + + kubectl run --namespace minio minio-client \ + --rm --tty -i --restart='Never' \ + --env MINIO_SERVER_ROOT_USER=$ROOT_USER \ + --env MINIO_SERVER_ROOT_PASSWORD=$ROOT_PASSWORD \ + --env MINIO_SERVER_HOST=minio \ + --image docker.io/bitnami/minio-client:2025.4.16-debian-12-r1 -- admin info minio + +To access the MinIO® web UI: + +- Get the MinIO® URL: + + echo "MinIO® web URL: http://127.0.0.1:9001/minio" + kubectl port-forward --namespace minio svc/minio 9001:9001 + +Substituted images detected: +- greptime-registry.cn-hangzhou.cr.aliyuncs.com/greptime/minio:2025.4.22-debian-12-r1 + +``` +
+ +## 验证 MinIO 集群安装 + +检查 MinIO Pod 的状态: + +```bash +kubectl get pod -n minio +``` + +
+ 预期输出 +```bash +NAME READY STATUS RESTARTS AGE +minio-0 1/1 Running 0 30s +minio-1 1/1 Running 0 30s +minio-2 1/1 Running 0 30s +minio-3 1/1 Running 0 30s +``` +
+ +# 创建 Bucket 和 Access Key + +## 访问 MinIO 控制台 + +1. 首先需要将 MinIO 控制台服务暴露出来,你可以使用 `kubectl port-forward` 命令: + +```bash +kubectl port-forward -n minio svc/minio 9001:9001 +``` + +2. 打开浏览器访问 http://localhost:9001/login + +3. 使用配置文件中设置的账号密码登录: +- username: `greptimedbadmin` +- password: `greptimedbadmin` + +![MinIO login](/minio-login-page.png) + +## 创建 Bucket + +登录 MinIO 控制台后,按照以下步骤创建 Bucket: + +1. 点击左侧菜单栏的 "Buckets" +2. 点击 "Create Bucket" 按钮 +3. 输入 Bucket 名称,例如:`greptimedb-bucket` +4. 点击 "Create Bucket" 确认创建 + +![MinIO create bucket step 1](/minio-create-bucket-1.png) + +![MinIO create bucket step 2](/minio-create-bucket-2.png) + +## 生成 Access Key + +1. 点击左侧菜单栏的 "Access Keys" +2. 点击 "Create Access Key" 按钮 +3. 可选:设置权限策略 +4. 点击 "Create" 生成 Access Key 和 Secret Key + +![MinIO create access key step 1](/minio-create-access-key-1.png) + +![MinIO create access key step 2](/minio-create-access-key-2.png) + +:::warning +⚠️ 重要:请妥善保存以下信息,在部署 GreptimeDB 时会用到。 +- Bucket 名称:greptimedb-bucket +- Region:ap-southeast-1 +- MinIO Endpoint:`http://minio.minio:9000` +- Access Key:创建时生成的 Access Key +- Secret Key:创建时生成的 Secret Key +::: + +# 配置 GreptimeDB 使用 MinIO + +在部署 GreptimeDB 集群时,可以通过以下配置使用 MinIO 作为后端存储: + +```yaml +objectStorage: + credentials: + accessKeyId: "" + secretAccessKey: "" + s3: + bucket: "greptimedb-bucket" + region: "ap-southeast-1" + root: "greptimedb-data" + endpoint: "http://minio.minio:9000" +``` + +# 监控 + +- 安装 Prometheus Operator (例如: [kube-prometheus-stack](https://github.com/prometheus-community/helm-charts/tree/main/charts/kube-prometheus-stack))。 +- 安装 podmonitor CRD。 + +要监控 MinIO 集群,你需要提前部署好监控系统(如 Prometheus 和 Grafana)。然后在 `minio-values.yaml` 中增加以下内容,并重新执行更新 MinIO 配置: + +```yaml +metrics: + enabled: true + serviceMonitor: + enabled: true + namespace: minio + labels: + release: kube-prometheus-stack + interval: 30s +``` + +## Grafana dashboard + +使用 [MinIO Dashboard](https://grafana.com/grafana/dashboards/13502-minio-dashboard/) (ID: 13502) 来监控 MinIO 的指标。 + +1. 登录你的 Grafana。 +2. 导航至 Dashboards -> New -> Import。 +3. 输入 Dashboard ID: 13502, 选择数据源并加载图表。 + +![MinIO Dashboard](/kubernetes-minio-monitoring-dashboard.png) + +# 卸载 MinIO 集群 + +使用以下命令卸载 MinIO 集群: + +```bash +helm -n minio uninstall minio +``` + +## 删除 PVCs + +删除 PVCs 操作将会删除 MinIO 集群的持久化数据。请确保在继续操作之前已经备份了数据。 + +```bash +kubectl -n minio delete pvc -l app.kubernetes.io/instance=minio +``` diff --git a/i18n/zh/docusaurus-plugin-content-docs/version-1.0/user-guide/deployments-administration/deploy-on-kubernetes/overview.md b/i18n/zh/docusaurus-plugin-content-docs/version-1.0/user-guide/deployments-administration/deploy-on-kubernetes/overview.md index 2c28bf4d2..163bcb0ec 100644 --- a/i18n/zh/docusaurus-plugin-content-docs/version-1.0/user-guide/deployments-administration/deploy-on-kubernetes/overview.md +++ b/i18n/zh/docusaurus-plugin-content-docs/version-1.0/user-guide/deployments-administration/deploy-on-kubernetes/overview.md @@ -36,6 +36,8 @@ GreptimeDB 专为云原生环境而构建,从第一天起就可以在 Kubernet 在熟悉了 [GreptimeDB 的架构和组件](/user-guide/concepts/architecture.md)之后,你可以进一步探索高级部署场景: +- [部署 MinIO 集群](deploy-minio.md):学习如何部署,配置和监控 MinIO 集群。 +- [部署 Kafka 集群](deploy-kafka.md):学习如何部署,配置和监控 Kafka 集群。 - [部署带有 Remote WAL 的 GreptimeDB 集群](configure-remote-wal.md):将 Kafka 配置为 GreptimeDB 集群的远程预写日志 (WAL),以持久记录每个数据修改并确保不丢失内存缓存的数据。 - [使用 MySQL/PostgreSQL 作为元数据存储](/user-guide/deployments-administration/deploy-on-kubernetes/common-helm-chart-configurations.md#配置-metasrv-后端存储):集成 MySQL/PostgreSQL 数据库以提供强大的元数据存储功能,增强可靠性和性能。 - [部署多 Frontend 的 GreptimeDB 集群](configure-frontend-groups.md):GreptimeDB 集群的 Frontend 组由多个 Frontend 实例组成,以改善负载分配和可用性。 diff --git a/i18n/zh/docusaurus-plugin-content-docs/version-1.0/user-guide/deployments-administration/monitoring/cluster-monitoring-deployment.md b/i18n/zh/docusaurus-plugin-content-docs/version-1.0/user-guide/deployments-administration/monitoring/cluster-monitoring-deployment.md index 31dc96a66..336753703 100644 --- a/i18n/zh/docusaurus-plugin-content-docs/version-1.0/user-guide/deployments-administration/monitoring/cluster-monitoring-deployment.md +++ b/i18n/zh/docusaurus-plugin-content-docs/version-1.0/user-guide/deployments-administration/monitoring/cluster-monitoring-deployment.md @@ -12,49 +12,6 @@ description: 在 Kubernetes 上部署 GreptimeDB 集群的自监控完整指南 你可以在使用 Helm Chart 部署 GreptimeDB 集群时,通过对 `values.yaml` 文件进行配置来启用监控和 Grafana。下面是一个完整的 `values.yaml` 示例,用于部署一个最小化的带有监控和 Grafana 的 GreptimeDB 集群: -```yaml -image: - registry: docker.io - # 镜像仓库: - # OSS GreptimeDB 使用 `greptime/greptimedb`, - # GreptimeDB 企业版配置请咨询工作人员 - repository: - # 镜像标签: - # OSS GreptimeDB 使用数据库版本,例如 `VAR::greptimedbVersion` - # GreptimeDB 企业版配置请咨询工作人员 - tag: - pullSecrets: [] - -initializer: - registry: docker.io - repository: greptime/greptimedb-initializer - tag: "VAR::greptimedbOperatorVersion" - -monitoring: - # 启用监控 - enabled: true - -grafana: - # 用于监控面板 - # 需要先启用监控 `monitoring.enabled: true` 选项 - enabled: true - -frontend: - replicas: 1 - -meta: - replicas: 1 - backendStorage: - etcd: - endpoints: ["etcd.etcd-cluster.svc.cluster.local:2379"] - -datanode: - replicas: 1 -``` - -:::note 备注 -如果你在中国大陆遇到网络访问问题,可直接使用阿里云 OCI 镜像仓库: - ```yaml image: registry: greptime-registry.cn-hangzhou.cr.aliyuncs.com @@ -98,8 +55,10 @@ meta: datanode: replicas: 1 + +flownode: + replicas: 1 ``` -::: 当启用 `monitoring` 后,GreptimeDB Operator 会额外启动一个 GreptimeDB Standalone 实例用于收集 GreptimeDB 集群的指标和日志数据。 为了收集日志数据,GreptimeDB Operator 会在每一个 Pod 中启动一个 [Vector](https://vector.dev/) 的 Sidecar 容器。 @@ -123,7 +82,7 @@ kubectl -n default get pods ```
- Expected Output + 期望输出 ```bash NAME READY STATUS RESTARTS AGE mycluster-datanode-0 2/2 Running 0 77s diff --git a/sidebars.ts b/sidebars.ts index 5cbc8ab32..c6e338ea5 100644 --- a/sidebars.ts +++ b/sidebars.ts @@ -457,7 +457,6 @@ const sidebars: SidebarsConfig = { id: 'enterprise/deployments-administration/monitoring/overview', label: 'Overview', }, - 'enterprise/deployments-administration/monitoring/self-monitor-cluster', 'enterprise/deployments-administration/monitoring/check-db-status', 'enterprise/deployments-administration/monitoring/key-metrics', 'enterprise/deployments-administration/monitoring/key-logs', diff --git a/static/enterprise-dashboard-login.png b/static/enterprise-dashboard-login.png new file mode 100644 index 000000000..9bf7d7a19 Binary files /dev/null and b/static/enterprise-dashboard-login.png differ diff --git a/static/enterprise-dashboard-page.png b/static/enterprise-dashboard-page.png new file mode 100644 index 000000000..938909c94 Binary files /dev/null and b/static/enterprise-dashboard-page.png differ diff --git a/static/kubernetes-kafka-monitoring-dashboard.png b/static/kubernetes-kafka-monitoring-dashboard.png new file mode 100644 index 000000000..e753ee2f4 Binary files /dev/null and b/static/kubernetes-kafka-monitoring-dashboard.png differ diff --git a/static/kubernetes-minio-monitoring-dashboard.png b/static/kubernetes-minio-monitoring-dashboard.png new file mode 100644 index 000000000..6a8167a69 Binary files /dev/null and b/static/kubernetes-minio-monitoring-dashboard.png differ diff --git a/static/minio-create-access-key-1.png b/static/minio-create-access-key-1.png new file mode 100644 index 000000000..767be1f38 Binary files /dev/null and b/static/minio-create-access-key-1.png differ diff --git a/static/minio-create-access-key-2.png b/static/minio-create-access-key-2.png new file mode 100644 index 000000000..5a325b663 Binary files /dev/null and b/static/minio-create-access-key-2.png differ diff --git a/static/minio-create-bucket-1.png b/static/minio-create-bucket-1.png new file mode 100644 index 000000000..e74bc1708 Binary files /dev/null and b/static/minio-create-bucket-1.png differ diff --git a/static/minio-create-bucket-2.png b/static/minio-create-bucket-2.png new file mode 100644 index 000000000..4274b19a6 Binary files /dev/null and b/static/minio-create-bucket-2.png differ diff --git a/static/minio-login-page.png b/static/minio-login-page.png new file mode 100644 index 000000000..f5494ae03 Binary files /dev/null and b/static/minio-login-page.png differ diff --git a/variables/variables-1.0.ts b/variables/variables-1.0.ts index c5044040b..be09d3425 100644 --- a/variables/variables-1.0.ts +++ b/variables/variables-1.0.ts @@ -2,7 +2,7 @@ export const variables = { greptimedbVersion: 'v1.0.1', prometheusVersion: 'v2.52.0', nodeExporterVersion: 'v1.8.0', - goSdkVersion: 'v0.7.1', + goSdkVersion: 'v0.7.2', javaSdkVersion: '0.15.0', debugPodVersion: '20250606-04e3c7d', etcdChartVersion: "12.0.8", diff --git a/variables/variables-nightly.ts b/variables/variables-nightly.ts index 336168e91..d023ae42d 100644 --- a/variables/variables-nightly.ts +++ b/variables/variables-nightly.ts @@ -2,7 +2,7 @@ export const variables = { greptimedbVersion: 'v1.0.0-nightly-20260511', prometheusVersion: 'v2.52.0', nodeExporterVersion: 'v1.8.0', - goSdkVersion: 'v0.7.1', + goSdkVersion: 'v0.7.2', javaSdkVersion: '0.15.0', debugPodVersion: '20250606-04e3c7d', etcdChartVersion: "12.0.8", diff --git a/versioned_docs/version-1.0/enterprise/deployments-administration/deploy-on-kubernetes/installation.md b/versioned_docs/version-1.0/enterprise/deployments-administration/deploy-on-kubernetes/installation.md index b7e1788c1..6c54340e5 100644 --- a/versioned_docs/version-1.0/enterprise/deployments-administration/deploy-on-kubernetes/installation.md +++ b/versioned_docs/version-1.0/enterprise/deployments-administration/deploy-on-kubernetes/installation.md @@ -3,16 +3,75 @@ keywords: [Kubernetes deployment, GreptimeDB Enterprise, install GreptimeDB, sta description: Steps to install GreptimeDB Enterprise on Kubernetes, including obtaining images and starting GreptimeDB. --- -# Deploy GreptimeDB Cluster +# GreptimeDB Enterprise Deployment Guide -GreptimeDB Enterprise is released as docker images. -We provide each customer with a separate private docker registry hosted on Cloud, -which you can pull directly using the docker pull command or configure in helm charts. +## Environment Requirements -## Get GreptimeDB Enterprise Image +- [Docker](https://docs.docker.com/get-started/get-docker/) >= v23.0.0 +- [kubectl](https://kubernetes.io/docs/tasks/tools/install-kubectl/) >= v1.21.0 +- [Helm](https://helm.sh/docs/intro/install/) >= v3.0.0 +- [kubernetes](https://kubernetes.io/) >= 1.21 -You need to configure the image in the `values.yaml` file of the helm chart to obtain the dedicated GreptimeDB Enterprise, -for example: +## Overview + +The GreptimeDB Enterprise Edition deployment includes the following components: +1. GreptimeDB Operator: Used to interact with the Kubernetes cluster. +2. KV Store: Used to store database metadata (supports cloud services or self-hosted). It is recommended to use RDS from cloud services such as AWS RDS PostgreSQL. Optional storage facilities include: +- PostgreSQL +- MySQL +- ETCD + +3. GreptimeDB Database Cluster, including the following components: +- Meta:Database cluster metadata management component +- Datanode:Data node +- Frontend:Entry point and protocol parsing node +- Flownode(optional): Stream computing node +- Vector Sidecar:Metrics collection agent +- GreptimeDB Standalone: Cluster self-monitoring storage node + +4. GreptimeDB Enterprise Dashboard +5. Kafka(optional): Provides Remote WAL for GreptimeDB +6. MinIO(optional): Provides object storage for GreptimeDB. It is recommended to use object storage from cloud services (e.g., AWS S3) + +Components marked with * are optional: + +| Pod Component Name | Replicas | CPU (Core) | Memory (GB) | Disk (Gi) | +|----------------------------------|----------|------------|-------------|-----------| +| ETCD`*` | 3 | 2 | 4 | 10 | +| GreptimeDB Operator | 1 | 1 | 1 | | +| Meta | | | | | +| Datanode | | | | | +| Frontend | | | | | +| Flownode`*` | | | | | +| Vector Sidecar | | | | | +| GreptimeDB Standalone | 1 | 4 | 8 | | +| GreptimeDB Enterprise Dashboard | 1 | | | | +| Kafka`*` | 3 | | | | +| MinIO`*` | 4 | | | | + +## Deploy GreptimeDB Operator + +Refer to [GreptimeDB Operator Management Documentation](/user-guide/deployments-administration/deploy-on-kubernetes/greptimedb-operator-management.md) for detailed installation steps. + +## Deploy ETCD (Option) + +Refer to [Manage ETCD](/user-guide/deployments-administration/manage-metadata/manage-etcd.md) for detailed installation steps. + +## Deploy Kafka (Option) + +Refer to [Deploy Kafka Cluster](/user-guide/deployments-administration/deploy-on-kubernetes/deploy-kafka.md) for detailed installation steps. + +## Deploy MinIO (Option) + +Refer to [Deploy MinIO Cluster](/user-guide/deployments-administration/deploy-on-kubernetes/deploy-minio.md) for detailed installation steps. + +## Install and Start GreptimeDB + +### Obtain GreptimeDB Enterprise Edition Image + +GreptimeDB Enterprise Edition is distributed as a Docker image. We provide each customer with a dedicated private Docker repository hosted on Alibaba Cloud. You can pull it directly using the docker pull command or configure it in the Helm chart. + +You need to configure the image information in the Helm chart's `values.yaml` file to obtain your dedicated GreptimeDB Enterprise Edition, for example: ```yaml customImageRegistry: @@ -31,16 +90,400 @@ image: - greptimedb-custom-image-pull-secret ``` -In the above configuration, -the `registry`, `username` and `password` in `customImageRegistry` are used to create the k8s pull secret, -the `registry`, `repository` and `tag` in `image` are used to specify the GreptimeDB Enterprise image, -therefore `customImageRegistry.secretName` and `image.pullSecrets` must be consistent to ensure that the correct authentication information can be found when pulling the image. +In the above configuration: +- `registry`, `username`, and `password` under `customImageRegistry` are used to create the Kubernetes pull secret +- `registry`, `repository`, and `tag` under `image` are used to specify the GreptimeDB Enterprise Edition image +- Therefore, `customImageRegistry.secretName` and `image.pullSecrets` must match to ensure correct authentication when pulling the image Please contact Greptime staff to obtain the specific values for the above configuration items. -When Greptime staff first deliver GreptimeDB Enterprise to you, -they will inform you of the docker registry address, username and password via email. -Please keep them safe and do not share them with external personnel! +When Greptime staff first deliver the GreptimeDB Enterprise Edition to you, they will inform you of the image registry address, username, and password via email or other means. Please keep this information safe and do not share it with external parties! + +### Configuration Management + +Before installation, you need to create a file to configure the GreptimeDB cluster. Adjust it according to your Kubernetes environment. For more configurations, please refer to the [documentation](/user-guide/deployments-administration/deploy-on-kubernetes/common-helm-chart-configurations.md). Below is a reference configuration for `greptimedb-cluster-values.yaml`: + +```yaml +customImageRegistry: + enabled: true + # -- pull secret name, customizable, must match `image.pullSecrets` + secretName: greptimedb-custom-image-pull-secret + registry: + username: + password: + +image: + registry: + repository: + tag: + pullSecrets: + - greptimedb-custom-image-pull-secret + +additionalLabels: {} + +initializer: + registry: docker.io + repository: greptime/greptimedb-initializer + tag: "VAR::greptimedbOperatorVersion" + +# -- Meta configuration +meta: + # -- Meta replicas + replicas: 3 + + backendStorage: + # Optional + # KV storage configuration, this configuration connects to ETCD + etcd: + endpoints: ["etcd.etcd-cluster.svc.cluster.local:2379"] + # Below is an example using PostgreSQL as the KV store: + # postgresql: + # host: "postgres.default.svc.cluster.local" + # port: 5432 + # database: "metasrv" + # table: "greptime_metakv" + # electionLockID: 1 + # credentials: + # secretName: "meta-postgresql-credentials" + # username: "root" + # password: "root" + + podTemplate: + main: + # Meta resource configuration + resources: + requests: + cpu: '2' + memory: 4Gi + limits: + cpu: '2' + memory: 4Gi + affinity: + podAntiAffinity: + preferredDuringSchedulingIgnoredDuringExecution: + - podAffinityTerm: + labelSelector: + matchLabels: + app.greptime.io/component: greptimedb-meta + topologyKey: kubernetes.io/hostname + weight: 1 + +# -- Datanode configuration +datanode: + # -- Datanode replicas + replicas: 3 + + # -- Datanode configuration + configData: |- + [[region_engine]] + [region_engine.mito] + write_cache_size = "20G" + write_cache_ttl = "7d" + + podTemplate: + main: + # -- Datanode resource + resources: + requests: + cpu: '8' + memory: 16Gi + limits: + cpu: '8' + memory: 16Gi + affinity: + podAntiAffinity: + preferredDuringSchedulingIgnoredDuringExecution: + - podAffinityTerm: + labelSelector: + matchLabels: + app.greptime.io/component: greptimedb-datanode + topologyKey: kubernetes.io/hostname + weight: 1 + # -- Datanode local disk configuration + storage: + storageClassName: null + # -- Local disk size + storageSize: 100Gi + # -- Storage retain policy for datanode persistent volume + storageRetainPolicy: Retain + +# -- Frontend configuration +frontend: + # -- Frontend replicas + replicas: 3 + + podTemplate: + main: + # Frontend resource + resources: + requests: + cpu: '8' + memory: 16Gi + limits: + cpu: '8' + memory: 16Gi + affinity: + podAntiAffinity: + preferredDuringSchedulingIgnoredDuringExecution: + - podAffinityTerm: + labelSelector: + matchLabels: + app.greptime.io/component: greptimedb-frontend + topologyKey: kubernetes.io/hostname + weight: 1 + +# -- Flownode configuration +flownode: + # -- Whether to deploy flownode + enabled: false + # -- Flownode replicas + replicas: 1 + + podTemplate: + main: + resources: + requests: + cpu: '8' + memory: 16Gi + limits: + cpu: '8' + memory: 16Gi + +# -- Database self-monitoring configuration +monitoring: + # -- Enable self-monitoring + enabled: true + standalone: + base: + imagePullSecrets: + - name: "greptimedb-custom-image-pull-secret" + main: + # Self-monitoring resource configuration + resources: + requests: + cpu: '4' + memory: 8Gi + limits: + cpu: '4' + memory: 8Gi + # Self-monitoring standalone storage location, can be optionally configured for object storage + # objectStorage: + # s3: + # secretName: "greptimedb-object-storage-secret" + # bucket: "greptimedb-bucket" + # region: "ap-southeast-1" + # root: "greptimedb-monitor-data" + # endpoint: "http://minio.minio:9000" + # Self-monitoring local disk size + datanodeStorage: + fs: + storageClassName: null + storageSize: 100Gi + # sidecar vector configuration + vector: + registry: docker.io + repository: timberio/vector + tag: 0.46.1-debian + # sidecar vector resource configuration + resources: + requests: + cpu: '1' + memory: 1Gi + limits: + cpu: '1' + memory: "1Gi" + +# Object storage related configuration, enable as needed +# Using MinIO +# objectStorage: +# existingSecretName: "greptimedb-object-storage-secret" +# cache: +# cacheCapacity: "50GiB" +# s3: +# bucket: "greptimedb-bucket" +# region: "ap-southeast-1" +# root: "greptimedb-data" +# endpoint: "http://minio.minio:9000" + +# Enable Enterprise Edition user and permission configuration +auth: + enabled: true + useBuiltIn: true + mountPath: "/etc/greptimedb/auth" + fileName: "passwd" + users: + # Default admin username, modify as needed + - username: "superuser" + # Initial admin account password, modify as needed + password: "1fa44bbc-5ded-42bd-a3f1-c3621affce63" + permission: "admin" + +# Remote WAL related configuration, enable as needed +# remoteWal: +# enabled: true +# kafka: +# brokerEndpoints: +# - "kafka-broker-0.kafka-broker-headless.kafka.svc.cluster.local:9092" +# - "kafka-broker-1.kafka-broker-headless.kafka.svc.cluster.local:9092" +# - "kafka-broker-2.kafka-broker-headless.kafka.svc.cluster.local:9092" +``` + +### Start GreptimeDB + +Install the GreptimeDB cluster in the `greptimedb` namespace: + +```bash +helm upgrade --install greptimedb \ + --create-namespace \ + greptime/greptimedb-cluster \ + -n greptimedb --values greptimedb-cluster-values.yaml +``` + +Verify the GreptimeDB installation: + +```bash +kubectl get pod -n greptimedb +``` + +
+ Expected output +```bash +NAME READY STATUS RESTARTS AGE +greptimedb-datanode-0 2/2 Running 0 2m33s +greptimedb-datanode-1 2/2 Running 0 2m33s +greptimedb-datanode-2 2/2 Running 0 2m33s +greptimedb-frontend-74999c79cc-pzj8w 2/2 Running 0 17s +greptimedb-frontend-74999c79cc-rm2fb 2/2 Running 0 17s +greptimedb-frontend-74999c79cc-zbtdg 2/2 Running 0 17s +greptimedb-meta-56dc894867-jpt5c 2/2 Running 0 4m29s +greptimedb-meta-56dc894867-tpw4c 2/2 Running 0 4m29s +greptimedb-meta-56dc894867-wmh1t 2/2 Running 0 4m29s +greptimedb-monitor-standalone-0 1/1 Running 0 4m42s +``` +
+ +## Deploy Enterprise Dashboard + +### Configuration Management + +Before installation, you need to create a file `dashboard-values.yaml` to configure the dashboard. Below is a configuration example: + +```yaml +replicaCount: 1 + +image: + # Please contact Greptime staff for the value + repository: + tag: + pullPolicy: IfNotPresent + +imagePullSecrets: + - name: greptimedb-custom-image-pull-secret + +nameOverride: "" +fullnameOverride: "" + +config: | + servicePort: 19095 + logLevel: info + enableLicenseManager: true + enableUserAuthentication: true + backendStore: + type: sqlite + sqlite: + dataDir: /data + provisionedInstances: + - name: greptimedb + namespace: greptimedb + type: cluster + settings: + basic: + url: http://greptimedb-frontend.greptimedb.svc.cluster.local:4000 + meta_url: http://greptimedb-meta.greptimedb.svc.cluster.local:4000 + monitoring: + greptimedb: + url: http://greptimedb-monitor-standalone.greptimedb.svc.cluster.local:4000 + license: + secret_name: greptimedb-license + secret_namespace: greptimedb + +servicePort: 19095 + +serviceAccount: + create: true + annotations: {} + name: "" + +podAnnotations: {} + +podSecurityContext: {} + # fsGroup: 2000 + +securityContext: {} + +service: + type: ClusterIP + port: 19095 + annotations: {} + +resources: + requests: + cpu: '1' + memory: 1Gi + limits: + cpu: '1' + memory: 1Gi + +nodeSelector: {} +tolerations: [] +affinity: {} +``` + +### Start Enterprise Dashboard + +```bash +helm upgrade --install greptimedb-enterprise-dashboard \ + oci://greptime-registry.cn-hangzhou.cr.aliyuncs.com/charts/greptimedb-enterprise-dashboard \ + -n greptimedb \ + --values dashboard-values.yaml +``` + +Verify the Enterprise Dashboard installation: + +```bash +kubectl get pod -n greptimedb | grep enterprise-dashboard +``` + +
+ Expected output +```bash +greptimedb-enterprise-dashboard-67f498d6f9-n89z5 1/1 Running 0 27s +``` +
+ +```bash +kubectl get svc -n greptimedb | grep enterprise-dashboard +``` + +
+ Expected output +```bash +greptimedb-enterprise-dashboard ClusterIP 10.96.80.175 19095/TCP 89s +``` +
+ +### Log in to Enterprise Dashboard + +Access port 19095 of the dashboard service to log in. + +![Enterprise Dashboard Login](/enterprise-dashboard-login.png) + +Log in using the superuser account and password from the database deployment. You will see: -## Installation and Startup +![Enterprise Dashboard Page](/enterprise-dashboard-login.png) -Please refer to the [Deploy GreptimeDB Cluster on Kubernetes](/user-guide/deployments-administration/deploy-on-kubernetes/deploy-greptimedb-cluster.md) documentation. +1. Query: Use SQL to query data +2. Logs Query: Use the UI to query log tables +3. Cluster Overview: Current cluster statistics +4. Metrics Monitoring: Database cluster self-monitoring metrics +5. Instance Logs: Database instance logs +6. User Management: Add, delete, and modify user accounts diff --git a/versioned_docs/version-1.0/enterprise/deployments-administration/monitoring/self-monitor-cluster.md b/versioned_docs/version-1.0/enterprise/deployments-administration/monitoring/self-monitor-cluster.md deleted file mode 100644 index dccdd9f3c..000000000 --- a/versioned_docs/version-1.0/enterprise/deployments-administration/monitoring/self-monitor-cluster.md +++ /dev/null @@ -1,115 +0,0 @@ ---- -keywords: [Kubernetes deployment, enterprise cluster, monitoring, GreptimeDB Enterprise Management Console] -description: Complete guide to deploying self-monitoring for GreptimeDB enterprise clusters on Kubernetes, including GreptimeDB Enterprise Management Console setup and configuration options ---- - -# Self-Monitoring GreptimeDB Clusters - -Before reading this document, ensure you understand how to [deploy a GreptimeDB enterprise cluster on Kubernetes](/enterprise/deployments-administration/deploy-on-kubernetes/installation.md). -This guide will walk you through configuring monitoring when deploying a GreptimeDB cluster. - -## Quick Start -You can enable monitoring and the [GreptimeDB Enterprise Management Console](/enterprise/console-ui.md) by adding configurations to the `values.yaml` file when deploying the GreptimeDB cluster using Helm Chart. -Here's a complete example of a `values.yaml` file for deploying a minimal GreptimeDB cluster with monitoring and the GreptimeDB Enterprise Management Console: - -```yaml -customImageRegistry: - enabled: true - # -- pull secret name, customizable, must match `image.pullSecrets` - secretName: greptimedb-custom-image-pull-secret - registry: - username: - password: - -image: - registry: - repository: - tag: - pullSecrets: - - greptimedb-custom-image-pull-secret - -initializer: - # Consult GreptimeDB Enterprise staff - registry: - repository: greptime/greptimedb-initializer - # Consult GreptimeDB Enterprise staff - tag: - -monitoring: - # Enable monitoring - enabled: true - -greptimedb-enterprise-dashboard: - # Enable greptimedb-enterprise-dashboard deployment. - # Requires monitoring to be enabled first (monitoring.enabled: true) - enabled: true - image: - # Consult staff for repository and tag - repository: - tag: - -frontend: - replicas: 1 - -meta: - replicas: 1 - backendStorage: - etcd: - endpoints: ["etcd.etcd-cluster.svc.cluster.local:2379"] - -datanode: - replicas: 1 -``` - -When `monitoring` is enabled, GreptimeDB Operator launches an additional GreptimeDB Standalone instance to collect metrics and logs from the GreptimeDB cluster. -To collect log data, GreptimeDB Operator starts a [Vector](https://vector.dev/) sidecar container in each Pod. - -When `greptimedb-enterprise-dashboard` is enabled, an enterprise dashboard is deployed that uses the GreptimeDB Standalone instance configured for cluster monitoring as its data source and provides management features for the GreptimeDB cluster. - -Then install the GreptimeDB cluster with the above `values.yaml` file: - -```bash -helm upgrade --install mycluster \ - greptime/greptimedb-cluster \ - --values /path/to/values.yaml \ - -n default -``` - -Then refer to the [Access GreptimeDB Management Console](#access-greptimedb-management-console) section below for details on accessing it. - -## Monitoring Configuration - -For detailed monitoring configuration options, please refer to the [monitoring configuration](/user-guide/deployments-administration/monitoring/cluster-monitoring-deployment.md#monitoring-configuration) documentation of the open source GreptimeDB. - -## GreptimeDB Management Console Configuration - -### Enable GreptimeDB Management Console - -To enable GreptimeDB Management Console deployment, add the following configuration to `values.yaml`. -Note that monitoring must be enabled first (`monitoring.enabled: true`): - -```yaml -monitoring: - enabled: true - -greptimedb-enterprise-dashboard: - enabled: true -``` - -### Access GreptimeDB Management Console - -You can access the GreptimeDB Management Console by port-forwarding the service to your local machine: - -```bash -kubectl -n ${namespace} port-forward svc/${cluster-name}-greptimedb-enterprise-console 18080:19095 -``` - -Then open `http://localhost:18080` to access the GreptimeDB Enterprise Management Console. - -For detailed information on using the Management Console features and interface, please refer to the [Management Console](/enterprise/console-ui.md) documentation. - - -## Cleanup the PVCs - -Please refer to the [Cleanup the PVCs](/user-guide/deployments-administration/monitoring/cluster-monitoring-deployment.md#cleanup-the-pvcs) section of the open source GreptimeDB documentation. - diff --git a/versioned_docs/version-1.0/user-guide/deployments-administration/deploy-on-kubernetes/deploy-greptimedb-cluster.md b/versioned_docs/version-1.0/user-guide/deployments-administration/deploy-on-kubernetes/deploy-greptimedb-cluster.md index 408424259..e451f3ac5 100644 --- a/versioned_docs/version-1.0/user-guide/deployments-administration/deploy-on-kubernetes/deploy-greptimedb-cluster.md +++ b/versioned_docs/version-1.0/user-guide/deployments-administration/deploy-on-kubernetes/deploy-greptimedb-cluster.md @@ -202,7 +202,10 @@ For example, a minimal GreptimeDB cluster configuration is as follows: ```yaml image: - registry: docker.io + # Image registry: + # Use `docker.io` for OSS GreptimeDB, + # consult staff for Enterprise GreptimeDB + registry: # Image repository: # Use `greptime/greptimedb` for OSS GreptimeDB, # consult staff for Enterprise GreptimeDB @@ -229,6 +232,9 @@ meta: datanode: replicas: 1 + +flownode: + replicas: 1 ``` The configuration above for the GreptimeDB cluster is not recommended for production use. diff --git a/versioned_docs/version-1.0/user-guide/deployments-administration/deploy-on-kubernetes/deploy-kafka.md b/versioned_docs/version-1.0/user-guide/deployments-administration/deploy-on-kubernetes/deploy-kafka.md new file mode 100644 index 000000000..f60a6d855 --- /dev/null +++ b/versioned_docs/version-1.0/user-guide/deployments-administration/deploy-on-kubernetes/deploy-kafka.md @@ -0,0 +1,234 @@ +--- +keywords: [Kubernetes Deployment, Kafka, Helm Chart, Monitoring Integration] +description: A guide to deploying Kafka cluster on Kubernetes using Helm Chart, including installation, verification, and monitoring integration steps. +--- + +# Deploying Kafka Cluster + +In this guide, you will learn how to deploy a Kafka cluster on Kubernetes using a Helm Chart. + +## Prerequisites + +- Kubernetes >= v1.18.0 +- [kubectl](https://kubernetes.io/docs/tasks/tools/install-kubectl/) >= v1.18.0 +- [Helm](https://helm.sh/docs/intro/install/) >= v3.0.0 + +## Configuration Management + +Before installation, you need to create a configuration file for the Kafka cluster. Please adjust the following `kafka-values.yaml` reference configuration according to your Kubernetes environment: + +```yaml +image: + registry: docker.io + repository: greptime/kafka + tag: 3.9.0-debian-12-r1 + +listeners: + client: + containerPort: 9092 + protocol: PLAINTEXT + name: CLIENT + controller: + protocol: PLAINTEXT + +heapOpts: "-Xmx512m -Xms512m -XX:MetaspaceSize=96m -XX:+UseG1GC -XX:MaxGCPauseMillis=20 -XX:InitiatingHeapOccupancyPercent=35 -XX:G1HeapRegionSize=16M -XX:MinMetaspaceFreeRatio=50 -XX:MaxMetaspaceFreeRatio=80 -XX:+ExplicitGCInvokesConcurrent" + +controller: + replicaCount: 3 + resources: + limits: + cpu: '1' + memory: 1Gi + requests: + cpu: 500m + memory: 512Mi + persistence: + enabled: true + storageClass: "" + size: 50Gi + +broker: + replicaCount: 3 + resources: + limits: + cpu: '1' + memory: 1Gi + requests: + cpu: 500m + memory: 512Mi + persistence: + enabled: true + storageClass: "" + size: 50Gi + +extraConfig: | + num.network.threads=3 + num.io.threads=8 + min.insync.replicas=1 + socket.send.buffer.bytes=102400 + socket.receive.buffer.bytes=102400 + socket.request.max.bytes=104857600 + num.recovery.threads.per.data.dir=1 + offsets.topic.replication.factor=1 + transaction.state.log.replication.factor=1 + transaction.state.log.min.isr=1 + allow.everyone.if.no.acl.found=true + auto.create.topics.enable=true + default.replication.factor=1 + max.partition.fetch.bytes=1048576 + max.request.size=1048576 + message.max.bytes=20000000 + log.dirs=/bitnami/kafka/data + log.flush.interval.messages=10000 + log.flush.interval.ms=1000 + log.retention.hours=4 + log.roll.hours=3 + log.retention.bytes=250000000 + log.segment.bytes=1073741824 +``` + +## Installing Kafka Cluster + +Install the Kafka cluster in the kafka namespace: + +```bash +helm upgrade --install kafka \ + --create-namespace \ + oci://registry-1.docker.io/bitnamicharts/kafka \ + --version 31.0.0 \ + -n kafka --values kafka-values.yaml +``` + +
+ Expected Output + +```bash +Release "kafka" does not exist. Installing it now. +Pulled: greptime-registry.cn-hangzhou.cr.aliyuncs.com/charts/kafka:31.0.0 +Digest: sha256:85b135981fd5d951ceef8b51cdcbc6917ebface50d0eb3367eb7ddc4a5db482b +NAME: kafka +LAST DEPLOYED: Tue May 12 00:57:32 2026 +NAMESPACE: kafka +STATUS: deployed +REVISION: 1 +TEST SUITE: None +NOTES: +CHART NAME: kafka +CHART VERSION: 31.0.0 +APP VERSION: 3.9.0 + +** Please be patient while the chart is being deployed ** + +Kafka can be accessed by consumers via port 9092 on the following DNS name from within your cluster: + + kafka.kafka.svc.cluster.local + +Each Kafka broker can be accessed by producers via port 9092 on the following DNS name(s) from within your cluster: + + kafka-controller-0.kafka-controller-headless.kafka.svc.cluster.local:9092 + kafka-broker-0.kafka-broker-headless.kafka.svc.cluster.local:9092 + +To create a pod that you can use as a Kafka client run the following commands: + + kubectl run kafka-client --restart='Never' --image greptime-registry.cn-hangzhou.cr.aliyuncs.com/greptime/kafka:3.9.0-debian-12-r1 --namespace kafka --command -- sleep infinity + kubectl exec --tty -i kafka-client --namespace kafka -- bash + + PRODUCER: + kafka-console-producer.sh \ + --bootstrap-server kafka.kafka.svc.cluster.local:9092 \ + --topic test + + CONSUMER: + kafka-console-consumer.sh \ + --bootstrap-server kafka.kafka.svc.cluster.local:9092 \ + --topic test \ + --from-beginning + +Substituted images detected: +- greptime-registry.cn-hangzhou.cr.aliyuncs.com/greptime/kafka:3.9.0-debian-12-r1 +``` +
+ +## Verifying Kafka Cluster Installation + +Check the status of Kafka components (Broker and Controller): + +```bash +kubectl get pod -n kafka +``` + +
+ Expected Output +```bash +NAME READY STATUS RESTARTS AGE +kafka-broker-0 1/1 Running 0 8m3s +kafka-broker-1 1/1 Running 0 8m2s +kafka-broker-2 1/1 Running 0 8m1s +kafka-controller-0 1/1 Running 0 8m3s +kafka-controller-1 1/1 Running 0 8m2s +kafka-controller-0 1/1 Running 0 8m1s +``` +
+ +# Configuring Kafka Endpoints + +After the Kafka cluster is deployed, GreptimeDB can enable Remote WAL by configuring Kafka endpoints. For more information, refer to [this documentation](/user-guide/deployments-administration/deploy-on-kubernetes/configure-remote-wal.md). + +```yaml +remoteWal: + enabled: true + kafka: + brokerEndpoints: + - "kafka-broker-0.kafka-broker-headless.kafka.svc.cluster.local:9092" + - "kafka-broker-1.kafka-broker-headless.kafka.svc.cluster.local:9092" + - "kafka-broker-2.kafka-broker-headless.kafka.svc.cluster.local:9092" +``` + +# Monitoring + +- Install Prometheus Operator (eg: [kube-prometheus-stack](https://github.com/prometheus-community/helm-charts/tree/main/charts/kube-prometheus-stack))。 +- Install the servicemonitor CRD。 + +To monitor the Kafka cluster, you need to have a monitoring system (such as Prometheus and Grafana) deployed in advance. Then add the following content to `kafka-values.yaml` and re-run the command to update the Kafka configuration: + +```yaml +metrics: + jmx: + enabled: true + image: + registry: greptime-registry.cn-hangzhou.cr.aliyuncs.com + repository: greptime/jmx-exporter + tag: 1.0.1-debian-12-r9 + serviceMonitor: + enabled: true + namespace: "kafka" + interval: "10s" + labels: + release: kube-prometheus-stack +``` + +## Grafana dashboard + +Use [Kubernetes Kafka](https://grafana.com/grafana/dashboards/12483-kubernetes-kafka/) (ID: 12483) to monitor Kafka metrics. + +1. Log in to your Grafana. +2. Navigate to Dashboards -> New -> Import. +3. Enter Dashboard ID: 12483, select a data source and load the dashboard. + +![Kubernetes Kafka](/kubernetes-kafka-monitoring-dashboard.png) + +# Uninstalling Kafka Cluster + +Use the following command to uninstall the Kafka cluster: + +```bash +helm -n kafka uninstall kafka +``` + +## Deleting PVCs + +Deleting PVCs will remove persistent data from the Kafka cluster. Please ensure you have backed up your data before proceeding. + +```bash +kubectl -n kafka delete pvc -l app.kubernetes.io/instance=kafka +``` diff --git a/versioned_docs/version-1.0/user-guide/deployments-administration/deploy-on-kubernetes/deploy-minio.md b/versioned_docs/version-1.0/user-guide/deployments-administration/deploy-on-kubernetes/deploy-minio.md new file mode 100644 index 000000000..70c9b53ea --- /dev/null +++ b/versioned_docs/version-1.0/user-guide/deployments-administration/deploy-on-kubernetes/deploy-minio.md @@ -0,0 +1,251 @@ +--- +keywords: [Kubernetes Deployment, MinIO, Object Storage, Helm Chart, Monitoring Integration, Distributed Storage] +description: A guide to deploying MinIO distributed object storage cluster on Kubernetes using Helm Chart, including installation, verification, bucket creation, and monitoring integration steps. +--- + +# Deploying MinIO Cluster + +In this guide, you will learn how to deploy a MinIO cluster on Kubernetes using a Helm Chart. + +## Prerequisites + +- Kubernetes >= v1.18.0 +- [kubectl](https://kubernetes.io/docs/tasks/tools/install-kubectl/) >= v1.18.0 +- [Helm](https://helm.sh/docs/intro/install/) >= v3.0.0 + +## Configuration Management + +Before installation, you need to create a `minio-values.yaml` configuration file. Please adjust the following configuration according to your Kubernetes environment: + +```yaml +global: + security: + allowInsecureImages: true + +image: + registry: docker.io + repository: greptime/minio + tag: 2025.4.22-debian-12-r1 + +auth: + rootUser: greptimedbadmin + rootPassword: "greptimedbadmin" + +resources: + requests: + cpu: 500m + memory: 500Mi + limits: + cpu: '2' + memory: 2Gi + +extraEnvVars: + - name: MINIO_REGION + value: "ap-southeast-1" + +statefulset: + replicaCount: 4 + +mode: distributed + +persistence: + storageClass: null + size: 100Gi +``` + +## Installing MinIO Cluster + +Install the MinIO cluster in the minio namespace: + +```bash +helm upgrade \ + --install minio oci://registry-1.docker.io/bitnamicharts/minio \ + --create-namespace \ + --version 16.0.10 \ + -n minio --values minio-values.yaml +``` + +
+ Expected Output + +```bash +Release "minio" does not exist. Installing it now. +Pulled: greptime-registry.cn-hangzhou.cr.aliyuncs.com/charts/minio:16.0.10 +Digest: sha256:96e220fd7cf1596879a243453b39c96a95d34f0005fdd452da3d094a7b386eb4 +NAME: minio +LAST DEPLOYED: Tue May 12 17:21:30 2026 +NAMESPACE: minio +STATUS: deployed +REVISION: 1 +TEST SUITE: None +NOTES: +CHART NAME: minio +CHART VERSION: 16.0.10 +APP VERSION: 2025.4.22 + +Did you know there are enterprise versions of the Bitnami catalog? For enhanced secure software supply chain features, unlimited pulls from Docker, LTS support, or application customization, see Bitnami Premium or Tanzu Application Catalog. See https://www.arrow.com/globalecs/na/vendors/bitnami for more information. + +** Please be patient while the chart is being deployed ** + +MinIO® can be accessed via port on the following DNS name from within your cluster: + +minio.minio.svc.cluster.local + +To get your credentials run: + +export ROOT_USER=$(kubectl get secret --namespace minio minio -o jsonpath="{.data.root-user}" | base64 -d) +export ROOT_PASSWORD=$(kubectl get secret --namespace minio minio -o jsonpath="{.data.root-password}" | base64 -d) + +To connect to your MinIO® server using a client: + +- Run a MinIO® Client pod and append the desired command (e.g. 'admin info'): + + kubectl run --namespace minio minio-client \ + --rm --tty -i --restart='Never' \ + --env MINIO_SERVER_ROOT_USER=$ROOT_USER \ + --env MINIO_SERVER_ROOT_PASSWORD=$ROOT_PASSWORD \ + --env MINIO_SERVER_HOST=minio \ + --image docker.io/bitnami/minio-client:2025.4.16-debian-12-r1 -- admin info minio + +To access the MinIO® web UI: + +- Get the MinIO® URL: + + echo "MinIO® web URL: http://127.0.0.1:9001/minio" + kubectl port-forward --namespace minio svc/minio 9001:9001 + +Substituted images detected: +- greptime-registry.cn-hangzhou.cr.aliyuncs.com/greptime/minio:2025.4.22-debian-12-r1 + +``` +
+ +## Verifying MinIO Cluster Installation + +Check the status of MinIO Pods: + +```bash +kubectl get pod -n minio +``` + +
+ Expected Output +```bash +NAME READY STATUS RESTARTS AGE +minio-0 1/1 Running 0 30s +minio-1 1/1 Running 0 30s +minio-2 1/1 Running 0 30s +minio-3 1/1 Running 0 30s +``` +
+ +# Creating Bucket and Access Key + +## Accessing MinIO Console + +1. First, expose the MinIO console service. You can use the kubectl port-forward command: + +```bash +kubectl port-forward -n minio svc/minio 9001:9001 +``` + +2. Open your browser: http://localhost:9001/login + +3. Log in using the credentials set in the configuration file: +- username: `greptimedbadmin` +- password: `greptimedbadmin` + +![MinIO login](/minio-login-page.png) + +## Creating a Bucket + +After logging into the MinIO console, follow these steps to create a Bucket: + +1. Click "Buckets" in the left sidebar +2. Click the "Create Bucket" button +3. Enter a Bucket name, for example:`greptimedb-bucket` +4. Click "Create Bucket" to confirm creation + +![MinIO create bucket step 1](/minio-create-bucket-1.png) + +![MinIO create bucket step 2](/minio-create-bucket-2.png) + +## Generating Access Key + +1. Click "Access Keys" in the left sidebar +2. Click the "Create Access Key" button +3. Optional: Set permission policies +4. Click "Create" to generate the Access Key and Secret Key + +![MinIO create access key step 1](/minio-create-access-key-1.png) + +![MinIO create access key step 2](/minio-create-access-key-2.png) + +:::warning +⚠️ Important: Please save the following information securely. You will need it when deploying GreptimeDB. +- Bucket name:greptimedb-bucket +- Region:ap-southeast-1 +- MinIO Endpoint:`http://minio.minio:9000` +- Access Key:The Access Key +- Secret Key:The Secret Key +::: + +# Configuring GreptimeDB to Use MinIO + +When deploying a GreptimeDB cluster, you can use MinIO as backend storage with the following configuration: + +```yaml +objectStorage: + credentials: + accessKeyId: "" + secretAccessKey: "" + s3: + bucket: "greptimedb-bucket" + region: "ap-southeast-1" + root: "greptimedb-data" + endpoint: "http://minio.minio:9000" +``` + +# Monitoring + +- Install Prometheus Operator (e.g: [kube-prometheus-stack](https://github.com/prometheus-community/helm-charts/tree/main/charts/kube-prometheus-stack))。 +- Install podmonitor CRD。 + +To monitor the MinIO cluster, you need to have a monitoring system (such as Prometheus and Grafana) deployed in advance. Then add the following content to `minio-values.yaml` and re-run the command to update the MinIO configuration: + +```yaml +metrics: + enabled: true + serviceMonitor: + enabled: true + namespace: minio + labels: + release: kube-prometheus-stack + interval: 30s +``` + +## Grafana dashboard + +Use the [MinIO Dashboard](https://grafana.com/grafana/dashboards/13502-minio-dashboard/) (ID: 13502) to monitor MinIO metrics. + +1. Log in to your Grafana. +2. Navigate to Dashboards -> New -> Import. +3. Enter Dashboard ID: 13502, select a data source, and load the dashboard. + +![MinIO Dashboard](/kubernetes-minio-monitoring-dashboard.png) + +# Uninstalling MinIO Cluster + +Use the following command to uninstall the MinIO cluster: + +```bash +helm -n minio uninstall minio +``` + +## Deleting PVCs + +Deleting PVCs will remove persistent data from the MinIO cluster. Please ensure you have backed up your data before proceeding. + +```bash +kubectl -n minio delete pvc -l app.kubernetes.io/instance=minio +``` diff --git a/versioned_docs/version-1.0/user-guide/deployments-administration/deploy-on-kubernetes/overview.md b/versioned_docs/version-1.0/user-guide/deployments-administration/deploy-on-kubernetes/overview.md index befd0261a..99eb447c3 100644 --- a/versioned_docs/version-1.0/user-guide/deployments-administration/deploy-on-kubernetes/overview.md +++ b/versioned_docs/version-1.0/user-guide/deployments-administration/deploy-on-kubernetes/overview.md @@ -38,6 +38,8 @@ including installation and upgrades. After familiarizing yourself with [the architecture and components of GreptimeDB](/user-guide/concepts/architecture.md), you can explore advanced deployment scenarios: +- [Deploy MinIO cluster](deploy-minio.md):Learn how to deploy, configure, and monitor a MinIO cluster. +- [Deploy Kafka cluster](deploy-kafka.md):Learn how to deploy, configure, and monitor a Kafka cluster. - [Deploy GreptimeDB Cluster with Remote WAL](configure-remote-wal.md): Configure Kafka as a remote write-ahead log (WAL) for your GreptimeDB cluster to persistently record every data modification and ensure no loss of memory-cached data. - [Use MySQL/PostgreSQL as Metadata Store](/user-guide/deployments-administration/deploy-on-kubernetes/common-helm-chart-configurations.md#configuring-metasrv-backend-storage): Integrate MySQL/PostgreSQL databases to provide robust metadata storage capabilities for enhanced reliability and performance. - [Deploy Multi-Frontend GreptimeDB Cluster](configure-frontend-groups.md): Set up a GreptimeDB cluster on Kubernetes with a frontend group consisting of multiple frontend instances for improved load distribution and availability. diff --git a/versioned_docs/version-1.0/user-guide/deployments-administration/monitoring/cluster-monitoring-deployment.md b/versioned_docs/version-1.0/user-guide/deployments-administration/monitoring/cluster-monitoring-deployment.md index f9e8f8879..f30eaa0e2 100644 --- a/versioned_docs/version-1.0/user-guide/deployments-administration/monitoring/cluster-monitoring-deployment.md +++ b/versioned_docs/version-1.0/user-guide/deployments-administration/monitoring/cluster-monitoring-deployment.md @@ -15,7 +15,10 @@ Here's a complete example of `values.yaml` for deploying a minimal GreptimeDB cl ```yaml image: - registry: docker.io + # Image registry: + # Use `docker.io` for OSS GreptimeDB, + # consult staff for Enterprise GreptimeDB + registry: # Image repository: # Use `greptime/greptimedb` for OSS GreptimeDB # Consult staff for GreptimeDB Enterprise @@ -51,6 +54,9 @@ meta: datanode: replicas: 1 + +flownode: + replicas: 1 ``` When `monitoring` is enabled, GreptimeDB Operator launches an additional GreptimeDB Standalone instance to collect metrics and logs from the GreptimeDB cluster. diff --git a/versioned_sidebars/version-1.0-sidebars.json b/versioned_sidebars/version-1.0-sidebars.json index 484265ade..13ffc7e5c 100644 --- a/versioned_sidebars/version-1.0-sidebars.json +++ b/versioned_sidebars/version-1.0-sidebars.json @@ -285,7 +285,9 @@ "user-guide/deployments-administration/deploy-on-kubernetes/greptimedb-operator-management", "user-guide/deployments-administration/deploy-on-kubernetes/common-helm-chart-configurations", "user-guide/deployments-administration/deploy-on-kubernetes/configure-frontend-groups", - "user-guide/deployments-administration/deploy-on-kubernetes/configure-remote-wal" + "user-guide/deployments-administration/deploy-on-kubernetes/configure-remote-wal", + "user-guide/deployments-administration/deploy-on-kubernetes/deploy-kafka", + "user-guide/deployments-administration/deploy-on-kubernetes/deploy-minio" ] }, { @@ -455,7 +457,6 @@ "id": "enterprise/deployments-administration/monitoring/overview", "label": "Overview" }, - "enterprise/deployments-administration/monitoring/self-monitor-cluster", "enterprise/deployments-administration/monitoring/check-db-status", "enterprise/deployments-administration/monitoring/key-metrics", "enterprise/deployments-administration/monitoring/key-logs",