Skip to content
On this page


What's gtctl

gtctl, g-t-control, is a command-line tool for managing the GreptimeDB clusters. gtctl is the all-in-one binary that integrates with multiple operations of GreptimeDB clusters.

Get Started with gtctl on Kubernetes

1. Create a test Kubernetes cluster

You can use kind to create your own test Kubernetes cluster:

kind create cluster

2. Install gtctl

Currently, gtctl supports Linux and Darwin on x86_64 and ARM64.

curl -L | sh

3. Create your own GreptimeDB cluster

gtctl cluster create mydb -n default

After the installation is completed, gtctl creates the followings:

  • etcd cluster
  • frontend instances (default replicas is 1)
  • datanode instances(default replicas is 3)
  • metasrv service(default replicas is 1)

You can use kubectl port-forward command to forward frontend requests:

kubectl port-forward svc/mydb-frontend 4002:4002 > connections.out &

Use your mysql client to connect your cluster:

mysql -h -P 4002

4. Delete your own GreptimeDB cluster

gtctl cluster delete mydb --tear-down-etcd