From 65bbd9d0703fef3c614edb4726ad1f7ffbb0d368 Mon Sep 17 00:00:00 2001 From: Ran Date: Thu, 9 Apr 2020 10:18:53 +0800 Subject: [PATCH 1/4] tiflash: update scale doc for 4.0 --- reference/tiflash/scale.md | 84 +++++++------------------------------- 1 file changed, 14 insertions(+), 70 deletions(-) diff --git a/reference/tiflash/scale.md b/reference/tiflash/scale.md index a3044c65e400f..a3658341ff592 100644 --- a/reference/tiflash/scale.md +++ b/reference/tiflash/scale.md @@ -10,86 +10,40 @@ This document describes how to scale in and out nodes in the TiFlash cluster. ## Scale out a TiFlash node -The following example shows how to scale out a TiFlash node if you deploy TiFlash on the `192.168.1.1` node. +If you need to add a TiFlash node on the `172.19.0.104` node, take the following steps: -1. Edit the `inventory.ini` file to add the TiFlash node information: +1. Create the `scale-out.yaml` file to add the TiFlash node information: Currently, you can only add IP but not domain name. {{< copyable "" >}} ```ini - [tiflash_servers] - 192.168.1.1 + tiflash_servers: + - host: 172.19.0.104 ``` -2. Edit the `hosts.ini` file to add the node information: +2. Run the scale out command: {{< copyable "" >}} - ```ini - [servers] - 192.168.1.1 - [all:vars] - username = tidb - ntp_server = pool.ntp.org - ``` - -3. Initialize the new node: - - - Configure the SSH mutual trust and sudo rules on the Control Machine: - - {{< copyable "shell-regular" >}} - - ```shell - ansible-playbook -i hosts.ini create_users.yml -l 192.168.1.1 -u root -k - ``` - - - Install the NTP service on the target machine: - - {{< copyable "shell-regular" >}} - - ```shell - ansible-playbook -i hosts.ini deploy_ntp.yml -u tidb -b - ``` - - - Initialize the node on the target machine: - - {{< copyable "shell-regular" >}} - - ```shell - ansible-playbook bootstrap.yml -l 192.168.1.1 - ``` - -4. Deploy the new node: - - {{< copyable "shell-regular" >}} - - ```shell - ansible-playbook deploy.yml -l 192.168.1.1 - ``` - -5. Start the new node: - - {{< copyable "shell-regular" >}} - ```shell - ansible-playbook start.yml -l 192.168.1.1 + tiup cluster scale-out test scale-out.yaml ``` -6. Update the configuration of Prometheus and restart it: +3. View the cluster status: {{< copyable "shell-regular" >}} ```shell - ansible-playbook rolling_update_monitor.yml --tags=prometheus + tiup cluster display test ``` -7. Access the monitoring platform using your browser, and view the status of the cluster and the new node. +4. Access the monitoring platform using your browser, and view the status of the cluster and the new node. ## Scale in a TiFlash node -The following example shows how to scale in a TiFlash node if you stop the TiFlash service on the `192.168.1.1` node. +If you stop the TiFlash service on the `172.19.0.104` node, take the following steps: > **Note:** > @@ -104,25 +58,15 @@ The following example shows how to scale in a TiFlash node if you stop the TiFla {{< copyable "shell-regular" >}} ```shell - ansible-playbook stop.yml -l 192.168.1.1 + tiup cluster scale-in test --node 172.19.0.104:9000 ``` - If the node still has other services and you want to stop TiFlash only, use the following command: - - {{< copyable "shell-regular" >}} - - ```shell - ansible-playbook stop.yml -t tiflash -l 192.168.1.1 - ``` - -4. Edit the `inventory.ini` and `hosts.ini` files to remove the node information. - -5. Update the configuration of Prometheus and restart it: +4. View the cluster status: {{< copyable "shell-regular" >}} ```shell - ansible-playbook rolling_update_monitor.yml --tags=prometheus + tiup cluster display test ``` -6. Access the monitoring platform using your browser, and view the status of the cluster. +5. Access the monitoring platform using your browser, and view the status of the cluster. \ No newline at end of file From 410c6152517d64c7f18e25e29d12de220aaf72a1 Mon Sep 17 00:00:00 2001 From: Ran Date: Thu, 9 Apr 2020 11:37:22 +0800 Subject: [PATCH 2/4] fix code block --- reference/tiflash/scale.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/tiflash/scale.md b/reference/tiflash/scale.md index a3658341ff592..86969ff5ebc0c 100644 --- a/reference/tiflash/scale.md +++ b/reference/tiflash/scale.md @@ -25,7 +25,7 @@ If you need to add a TiFlash node on the `172.19.0.104` node, take the following 2. Run the scale out command: - {{< copyable "" >}} + {{< copyable "shell-regular" >}} ```shell tiup cluster scale-out test scale-out.yaml From 74c53af21453db0e0c7ed1eb1bb005dd8dbac505 Mon Sep 17 00:00:00 2001 From: Ran Date: Thu, 9 Apr 2020 15:40:54 +0800 Subject: [PATCH 3/4] Apply suggestions from code review Co-Authored-By: Keke Yi <40977455+yikeke@users.noreply.github.com> --- reference/tiflash/scale.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/reference/tiflash/scale.md b/reference/tiflash/scale.md index 86969ff5ebc0c..29311f2fde17b 100644 --- a/reference/tiflash/scale.md +++ b/reference/tiflash/scale.md @@ -10,7 +10,7 @@ This document describes how to scale in and out nodes in the TiFlash cluster. ## Scale out a TiFlash node -If you need to add a TiFlash node on the `172.19.0.104` node, take the following steps: +If you need to add a TiFlash node to the `172.19.0.104` machine, take the following steps: 1. Create the `scale-out.yaml` file to add the TiFlash node information: @@ -23,7 +23,7 @@ If you need to add a TiFlash node on the `172.19.0.104` node, take the following - host: 172.19.0.104 ``` -2. Run the scale out command: +2. Run the scale-out command: {{< copyable "shell-regular" >}} @@ -43,7 +43,7 @@ If you need to add a TiFlash node on the `172.19.0.104` node, take the following ## Scale in a TiFlash node -If you stop the TiFlash service on the `172.19.0.104` node, take the following steps: +If you want to stop the TiFlash service on the `172.19.0.104` node, take the following steps: > **Note:** > @@ -69,4 +69,4 @@ If you stop the TiFlash service on the `172.19.0.104` node, take the following s tiup cluster display test ``` -5. Access the monitoring platform using your browser, and view the status of the cluster. \ No newline at end of file +5. Access the monitoring platform using your browser, and view the status of the cluster. From a81b2c1a820b06379f25a15fc54dde85501b5165 Mon Sep 17 00:00:00 2001 From: Keke Yi <40977455+yikeke@users.noreply.github.com> Date: Thu, 9 Apr 2020 15:47:22 +0800 Subject: [PATCH 4/4] Update reference/tiflash/scale.md --- reference/tiflash/scale.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/tiflash/scale.md b/reference/tiflash/scale.md index 2cc3fb07b8280..f1fc3e79bc547 100644 --- a/reference/tiflash/scale.md +++ b/reference/tiflash/scale.md @@ -10,7 +10,7 @@ This document describes how to scale in and out nodes in the TiFlash cluster. ## Scale out a TiFlash node -If you need to add a TiFlash node to the `172.19.0.104` machine, take the following steps: +If you need to add a TiFlash node to the `172.19.0.104` host, take the following steps: 1. Create the `scale-out.yaml` file to add the TiFlash node information: