Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add example about how to fill the <cluster_version> #12081

Merged
merged 1 commit into from
Nov 22, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions tiflash/create-tiflash-replicas.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,23 +150,29 @@ SELECT TABLE_NAME FROM information_schema.tables where TABLE_SCHEMA = "<db_name>
TiFlash 默认新增副本速度是 30(每分钟大约 30 个 Region 将会新增 TiFlash 副本)。执行以下命令将调整所有 TiFlash 实例的新增副本速度到 60,即原来的 2 倍速度:

```shell
tiup ctl:<cluster-version> pd -u http://<PD_ADDRESS>:2379 store limit all engine tiflash 60 add-peer
tiup ctl:v<CLUSTER_VERSION> pd -u http://<PD_ADDRESS>:2379 store limit all engine tiflash 60 add-peer
```

> 上述命令中,需要将 `<CLUSTER_VERSION>` 替换为该集群版本,`<PD_ADDRESS>:2379` 替换为任一 PD 节点的地址。替换后样例为:
>
> ```shell
> tiup ctl:v6.1.1 pd -u http://192.168.1.4:2379 store limit all engine tiflash 60 add-peer
> ```

执行完毕后,几分钟内,你将观察到 TiFlash 节点的 CPU 及磁盘 IO 资源占用显著提升,TiFlash 将更快地创建副本。同时,TiKV 节点的 CPU 及磁盘 IO 资源占用也将有所上升。

如果此时 TiKV 及 TiFlash 节点的资源仍有富余,且线上业务的延迟没有显著上升,则可以考虑进一步放开调度速度,例如将新增副本的速度增加为原来的 3 倍:

```shell
tiup ctl:<cluster-version> pd -u http://<PD_ADDRESS>:2379 store limit all engine tiflash 90 add-peer
tiup ctl:v<CLUSTER_VERSION> pd -u http://<PD_ADDRESS>:2379 store limit all engine tiflash 90 add-peer
```

3. 在副本同步完毕后,恢复到默认配置,减少在线业务受到的影响。

执行以下 PD Control 命令可恢复默认的新增副本速度:

```shell
tiup ctl:<cluster-version> pd -u http://<PD_ADDRESS>:2379 store limit all engine tiflash 30 add-peer
tiup ctl:v<CLUSTER_VERSION> pd -u http://<PD_ADDRESS>:2379 store limit all engine tiflash 30 add-peer
```

执行以下 SQL 语句可恢复默认的数据快照写入速度:
Expand Down Expand Up @@ -225,7 +231,7 @@ SELECT TABLE_NAME FROM information_schema.tables where TABLE_SCHEMA = "<db_name>
3. 此时 PD 会根据设置的 label 进行调度,将表 `t` 的两个副本分别调度到两个可用区中。可以通过监控或 pd-ctl 来验证这一点:

```shell
> tiup ctl:<version> pd -u<pd-host>:<pd-port> store
> tiup ctl:v<CLUSTER_VERSION> pd -u http://<PD_ADDRESS>:2379 store

...

Expand Down