From fe5a59327593800e3007b77bcdab2240277ed183 Mon Sep 17 00:00:00 2001 From: yikeke Date: Fri, 5 Jun 2020 09:33:02 +0800 Subject: [PATCH] translate https://github.com/pingcap/docs-cn/pull/3341/ --- tiflash/maintain-tiflash.md | 73 +------------------------------------ 1 file changed, 1 insertion(+), 72 deletions(-) diff --git a/tiflash/maintain-tiflash.md b/tiflash/maintain-tiflash.md index 56dbc77524497..97d899cdf3682 100644 --- a/tiflash/maintain-tiflash.md +++ b/tiflash/maintain-tiflash.md @@ -7,7 +7,7 @@ aliases: ['/docs/dev/reference/tiflash/maintain/'] # Maintain a TiFlash Cluster -This document describes how to perform common operations when you maintain a TiFlash cluster, including checking the TiFlash version, and taking TiFlash nodes down. This document also introduces critical logs and a system table of TiFlash. +This document describes how to perform common operations when you maintain a TiFlash cluster, including checking the TiFlash version. This document also introduces critical logs and a system table of TiFlash. ## Check the TiFlash version @@ -31,77 +31,6 @@ There are two ways to check the TiFlash version: : TiFlash version: TiFlash 0.2.0 master-375035282451103999f3863c691e2fc2 ``` -## Take a TiFlash node down - -Taking a TiFlash node down differs from [Scaling in a TiFlash node](/scale-tidb-using-tiup.md#scale-in-a-tiflash-node) in that the former doesn't remove the node in TiDB Ansible; instead, it just safely shuts down the TiFlash process. - -Follow the steps below to take a TiFlash node down: - -> **Note:** -> -> After you take the TiFlash node down, if the number of the remaining nodes in the TiFlash cluster is greater than or equal to the maximum replicas of all data tables, you can go directly to step 3. - -1. If the number of replicas of tables is greater than or equal to that of the remaining TiFlash nodes in the cluster, execute the following command on these tables in the TiDB client: - - {{< copyable "sql" >}} - - ```sql - alter table . set tiflash replica 0; - ``` - -2. To ensure that the TiFlash replicas of these tables are removed, see [Check the Replication Progress](/tiflash/use-tiflash.md#check-the-replication-progress). If you cannot view the replication progress of the related tables, it means that the replicas are removed. - -3. Input the `store` command into [pd-ctl](/pd-control.md) (the binary file is in `resources/bin` of the tidb-ansible directory) to view the `store id` of the TiFlash node. - -4. Input `store delete ` into `pd-ctl`. Here `` refers to the `store id` in step 3. - -5. When the corresponding `store` of the node disappears, or when `state_name` is changed to `Tombstone`, stop the TiFlash process. - -> **Note:** -> -> If you don't cancel all tables replicated to TiFlash before all TiFlash nodes stop running, you need to manually delete the replication rules in PD. Or you cannot successfully take the TiFlash node down. - -To manually delete the replication rules in PD, take the following steps: - -1. Query all the data replication rules related to TiFlash in the current PD instance: - - {{< copyable "shell-regular" >}} - - ```shell - curl http://:/pd/api/v1/config/rules/group/tiflash - ``` - - ``` - [ - { - "group_id": "tiflash", - "id": "table-45-r", - "override": true, - "start_key": "7480000000000000FF2D5F720000000000FA", - "end_key": "7480000000000000FF2E00000000000000F8", - "role": "learner", - "count": 1, - "label_constraints": [ - { - "key": "engine", - "op": "in", - "values": [ - "tiflash" - ] - } - ] - } - ] - ``` - -2. Delete all the data replication rules related to TiFlash. The following example command deletes the rule whose `id` is `table-45-r`: - - {{< copyable "shell-regular" >}} - - ```shell - curl -v -X DELETE http://:/pd/api/v1/config/rule/tiflash/table-45-r - ``` - ## TiFlash critical logs | Log Information | Log Description |