From 3f4884119470759b18651c2a5c1ac9fd2f4c1c0e Mon Sep 17 00:00:00 2001 From: lidezhu <47731263+lidezhu@users.noreply.github.com> Date: Mon, 20 Apr 2020 19:07:16 +0800 Subject: [PATCH] tiflash: add more explanation on how to clear syncing rules about tiflash in pd (#2838) * Add more explanation about how to clear syncing rules in tiflash * Fix comment * Update reference/tiflash/maintain.md Co-Authored-By: Keke Yi <40977455+yikeke@users.noreply.github.com> * Update reference/tiflash/maintain.md Co-Authored-By: Keke Yi <40977455+yikeke@users.noreply.github.com> * Update reference/tiflash/maintain.md Co-Authored-By: Keke Yi <40977455+yikeke@users.noreply.github.com> * remove weird codes Co-authored-by: Keke Yi <40977455+yikeke@users.noreply.github.com> Co-authored-by: Tong Zhigao --- reference/tiflash/maintain.md | 43 +++++++++++++++++++++++++++++++++-- 1 file changed, 41 insertions(+), 2 deletions(-) diff --git a/reference/tiflash/maintain.md b/reference/tiflash/maintain.md index 4a4109e6f4ae..38561c84a806 100644 --- a/reference/tiflash/maintain.md +++ b/reference/tiflash/maintain.md @@ -58,8 +58,47 @@ category: reference > **注意:** > > 如果在集群中所有的 TiFlash 节点停止运行之前,没有取消所有同步到 TiFlash 的表,则需要手动在 PD 中清除同步规则,否则无法成功完成 TiFlash 节点的下线。 -> -> 手动在 PD 中清除同步规则的方法是:发送 DELETE 请求 `http://:/pd/api/v1/config/rule/tiflash/`,rule_id 是需要清除的 rule 的 id。 + +手动在 PD 中清除同步规则的步骤如下: + +1. 查询当前 PD 实例中所有与 TiFlash 相关的的数据同步规则。 + + {{< 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. 删除所有与 TiFlash 相关的数据同步规则。以 `id` 为 `table-45-r` 的规则为例,通过以下命令可以删除该规则。 + + {{< copyable "shell-regular" >}} + + ```shell + curl -v -X DELETE http://:/pd/api/v1/config/rule/tiflash/table-45-r + ``` ## TiFlash 故障处理