Skip to content

Commit

Permalink
tiflash: add more explanation on how to clear syncing rules about tif…
Browse files Browse the repository at this point in the history
…lash in pd (pingcap#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 <solotzg@163.com>
  • Loading branch information
3 people authored and rleungx committed May 22, 2020
1 parent 5fb2a64 commit 76027b7
Showing 1 changed file with 41 additions and 2 deletions.
43 changes: 41 additions & 2 deletions reference/tiflash/maintain.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,47 @@ category: reference
> **注意:**
>
> 如果在集群中所有的 TiFlash 节点停止运行之前,没有取消所有同步到 TiFlash 的表,则需要手动在 PD 中清除同步规则,否则无法成功完成 TiFlash 节点的下线。
>
> 手动在 PD 中清除同步规则的方法是:发送 DELETE 请求 `http://<pd_ip>:<pd_port>/pd/api/v1/config/rule/tiflash/<rule_id>`,rule_id 是需要清除的 rule 的 id。

手动在 PD 中清除同步规则的步骤如下:

1. 查询当前 PD 实例中所有与 TiFlash 相关的的数据同步规则。

{{< copyable "shell-regular" >}}

```shell
curl http://<pd_ip>:<pd_port>/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_ip>:<pd_port>/pd/api/v1/config/rule/tiflash/table-45-r
```

## TiFlash 故障处理

Expand Down

0 comments on commit 76027b7

Please sign in to comment.