The tiup-cluster is distributed via tiup in a production environment. After installing the tiup,
the user can use the tiup-cluster by typing command tiup cluster.
- Deploy a cluster for production
tiup-cluster deploy <cluster-name> <version> <topology.yaml> [flags] - Start a TiDB cluster
tiup cluster start <cluster-name> - Stop a TiDB cluster
tiup cluster stop <cluster-name> - Restart a TiDB cluster
tiup cluster restart <cluster-name> - Scale in a TiDB cluster
tiup cluster scale-in <cluster-name> --node <node-id-1> [node-id-2..N] - Scale out a TiDB cluster
tiup cluster scale-out <cluster-name> <incr-topology.yaml> - Destroy a specified cluster
tiup cluster destroy <cluster-name> - Upgrade a specified TiDB cluster
tiup cluster upgrade <cluster-name> <version> - Run shell command on host in the tidb cluster
tiup cluster exec <cluster-name> --command "ls" - Display information of a TiDB cluster
tiup cluster display <cluster-name> - List all clusters
tiup cluster list - Show audit log of cluster operation
tiup cluster audit - Import an exist TiDB cluster from TiDB-Ansible
tiup cluster import - Edit TiDB cluster config
tiup cluster edit-config - Reload a TiDB cluster's config and restart if needed
tiup cluster reload <cluster-name>
Contributions of code, tests, docs, and bug reports are welcome! To get started take a look at our open issues.
If you haven't cluster deploy environment, you can use the docker environment provided by tiup-cluster project.
-
Before initialize the environment, you should install Docker first.
-
After installing docker, you can bootstrap the development environment by following instructions
cd docker sh up.sh --dev docker exec -it tiup-cluster-control bash
-
Prepare a topology.
global: user: tidb tidb_servers: - host: 172.19.0.101 pd_servers: - host: 172.19.0.102 - host: 172.19.0.104 - host: 172.19.0.105 tikv_servers: - host: 172.19.0.103 grafana_servers: - host: 172.19.0.101 monitoring_servers: - host: 172.19.0.102 alertmanager_servers: - host: 172.19.0.103
-
Deploy a cluster
tiup-cluster deploy test1 v3.0.10 topology.yaml -i ~/.ssh/id_rsa
The development doesn't depend on tiup, you can use tiup-cluster directly, which equal tiup cluster in the tiup mode.
You can build tiup-cluster on any platform that supports Go.
Prerequisites:
- Go (minimum version: 1.13; installation instructions)
- make
To build tiup-cluster, run make build.
The components depended by tiup-cluster will be downloaded from the tiup components repository, you can build a local
mirror repository via the script https://github.com/pingcap-incubator/tiup/blob/master/localmirrors.sh.
And set the environment variable via export TIUP_MIRRORS=/path/to/local/mirrors before sh up.sh --dev.
TBD