--- title: pd-ctl description: Use PD Control to obtain the state information of a cluster and tune a cluster. menu: "7.1": parent: CLI-7.1 weight: 2 identifier: pd-ctl-7.1 --- As a command-line tool of PD, pd-ctl (PD Control) obtains the state information of the cluster and tunes the cluster. ## Install PD Control {{< info >}} It is recommended that the version of the Control tool you use is consistent with the version of the cluster. {{< /info >}} ### Use TiUP command To use PD Control, execute the `tiup ctl: pd -u http://: [-i]` command. ### Download installation package Download the following installation package where PD Control binary locates. | Package download link | OS | Architecture | SHA256 checksum | |:---------------------------------------------------------------- |:----- |:------------ |:---------------------------------------------------------------- | | `https://download.pingcap.org/tidb-{version}-linux-amd64.tar.gz` | Linux | amd64 | `https://download.pingcap.org/tidb-{version}-linux-amd64.sha256` | {{< info >}} `{version}` indicates the version number of TiKV. For example, if `{version}` is `v5.0.0`, the package download link is `https://download.pingcap.org/tidb-v5.0.0-linux-amd64.tar.gz`. {{< /info >}} ### Compile from source code 1. [Go](https://golang.org/) Version 1.13 or later because the Go modules are used. 2. In the root directory of the [PD project](https://github.com/pingcap/pd), use the `make` or `make pd-ctl` command to compile and generate `bin/pd-ctl`. ## Usage Single-command mode: ```bash ./pd-ctl store -u http://127.0.0.1:2379 ``` Interactive mode: ```bash ./pd-ctl -i -u http://127.0.0.1:2379 ``` Use environment variables: ```bash export PD_ADDR=http://127.0.0.1:2379 ./pd-ctl ``` Use TLS to encrypt: ```bash ./pd-ctl -u https://127.0.0.1:2379 --cacert="path/to/ca" --cert="path/to/cert" --key="path/to/key" ``` ## Command line flags ### `--cacert` + Specifies the path to the certificate file of the trusted CA in PEM format + Default: "" ### `--cert` + Specifies the path to the certificate of SSL in PEM format + Default: "" ### `--detach` / `-d` + Uses the single command line mode (not entering readline) + Default: true ### `--help` / `-h` + Outputs the help information + Default: false ### `--interact` / `-i` + Uses the interactive mode (entering readline) + Default: false ### `--key` + Specifies the path to the certificate key file of SSL in PEM format, which is the private key of the certificate specified by `--cert` + Default: "" ### `--pd` / `-u` + Specifies the PD address + Default address: `http://127.0.0.1:2379` + Environment variable: `PD_ADDR` ### `--version` / `-V` + Prints the version information and exit + Default: false ## Command ### `cluster` Use this command to view the basic information of the cluster. Usage: ```bash >> cluster // To show the cluster information { "id": 6493707687106161130, "max_peer_count": 3 } ``` ### `config [show | set