From b2a68124b21d031f50cd2fbd23798e95a95d1caa Mon Sep 17 00:00:00 2001 From: yikeke Date: Tue, 28 Jul 2020 15:29:45 +0800 Subject: [PATCH 1/3] Add Environment checks for target machines --- tiup/tiup-cluster.md | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/tiup/tiup-cluster.md b/tiup/tiup-cluster.md index fddf0d5f8fdca..75e8419f435e8 100644 --- a/tiup/tiup-cluster.md +++ b/tiup/tiup-cluster.md @@ -567,3 +567,41 @@ For example, if you previously view the store by running `pd-ctl -u http://127.0 ```bash tiup ctl pd -u http://127.0.0.1:2379 store ``` + +## Environment checks for target machines + +You can use the `check` command to perform a series of checks on the environment of the target machine and output the check results. By executing the `check` command, you can find common unreasonable configurations or unsupported situations. The command flag list is as follows: + +```bash +Usage: + tiup cluster check [flags] +Flags: + --apply Try to fix failed checks + --cluster Check existing cluster, the input is a cluster name. + --enable-cpu Enable CPU thread count check + --enable-disk Enable disk IO (fio) check + --enable-mem Enable memory size check + -h, --help help for check + -i, --identity_file string The path of the SSH identity file. If specified, public key authentication will be used. + -p, --password Use password of target hosts. If specified, password authentication will be used. + --user string The user name to login via SSH. The user must has root (or sudo) privilege. +``` + +By default, this command is used to check the environment before deployment. By specifying the `--cluster` flag to switch the mode, you can also check the target machines of an existing cluster, for example: + +```bash +# check deployed servers before deployment +tiup cluster check topology.yml --user tidb -p +# check deployed servers of an existing cluster +tiup cluster check --cluster +``` + +The CPU thread count check, memory size check, and disk performance check are disabled by default. For the production environment, it is recommended that you enable the three checks and make sure they pass to obtain the best performance. + +- CPU: If the number of threads is greater than or equal to 16, the check is passed. +- Memory: If the total size of physical memory is greater than or equal to 32 GB, the check is passed. +- Disk: Execute `fio` test on the partitions of `data_dir` and record the results. + +When running the checks, if the `--apply` flag is specified, the program automatically tries to repair the failed items. Automatic repair is limited to some items that can be adjusted by modifying the configuration or system parameters. Other unrepaired items need to be handled manually according to the actual situation. + +Environment checks is not a necessary process for deploying a cluster. For the production environment, it is recommended to perform environment checks and pass all check items before deployment. If not all the check items are passed, the cluster might be deployed and run normally, but the best performance might not be obtained. From 156eee37e0e8a9cef117223893171b8a41cbed16 Mon Sep 17 00:00:00 2001 From: ireneontheway <48651140+ireneontheway@users.noreply.github.com> Date: Tue, 28 Jul 2020 18:45:55 +0800 Subject: [PATCH 2/3] Update tiup/tiup-cluster.md Co-authored-by: Keke Yi <40977455+yikeke@users.noreply.github.com> --- tiup/tiup-cluster.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tiup/tiup-cluster.md b/tiup/tiup-cluster.md index 75e8419f435e8..21a0dace94413 100644 --- a/tiup/tiup-cluster.md +++ b/tiup/tiup-cluster.md @@ -602,6 +602,6 @@ The CPU thread count check, memory size check, and disk performance check are di - Memory: If the total size of physical memory is greater than or equal to 32 GB, the check is passed. - Disk: Execute `fio` test on the partitions of `data_dir` and record the results. -When running the checks, if the `--apply` flag is specified, the program automatically tries to repair the failed items. Automatic repair is limited to some items that can be adjusted by modifying the configuration or system parameters. Other unrepaired items need to be handled manually according to the actual situation. +When running the checks, if the `--apply` flag is specified, the program automatically repairs the failed items. Automatic repair is limited to some items that can be adjusted by modifying the configuration or system parameters. Other unrepaired items need to be handled manually according to the actual situation. Environment checks is not a necessary process for deploying a cluster. For the production environment, it is recommended to perform environment checks and pass all check items before deployment. If not all the check items are passed, the cluster might be deployed and run normally, but the best performance might not be obtained. From 307d121c381cd3aba0c7dcef40cbe9875c287a15 Mon Sep 17 00:00:00 2001 From: ireneontheway <48651140+ireneontheway@users.noreply.github.com> Date: Tue, 28 Jul 2020 18:46:21 +0800 Subject: [PATCH 3/3] Update tiup/tiup-cluster.md Co-authored-by: Keke Yi <40977455+yikeke@users.noreply.github.com> --- tiup/tiup-cluster.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tiup/tiup-cluster.md b/tiup/tiup-cluster.md index 21a0dace94413..3551658085e85 100644 --- a/tiup/tiup-cluster.md +++ b/tiup/tiup-cluster.md @@ -604,4 +604,4 @@ The CPU thread count check, memory size check, and disk performance check are di When running the checks, if the `--apply` flag is specified, the program automatically repairs the failed items. Automatic repair is limited to some items that can be adjusted by modifying the configuration or system parameters. Other unrepaired items need to be handled manually according to the actual situation. -Environment checks is not a necessary process for deploying a cluster. For the production environment, it is recommended to perform environment checks and pass all check items before deployment. If not all the check items are passed, the cluster might be deployed and run normally, but the best performance might not be obtained. +Environment checks are not necessary for deploying a cluster. For the production environment, it is recommended to perform environment checks and pass all check items before deployment. If not all the check items are passed, the cluster might be deployed and run normally, but the best performance might not be obtained.