Skip to content

Commit

Permalink
ticdc: add example of how to show bdr role (#16393)
Browse files Browse the repository at this point in the history
  • Loading branch information
asddongmen committed Jan 29, 2024
1 parent 3a808d9 commit 024b809
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
16 changes: 15 additions & 1 deletion ticdc/ticdc-bidirectional-replication.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,21 @@ TiCDC 复制功能只会将指定时间点之后的增量变更复制到下游

### 可复制的 DDL 的同步场景

1. 选择一个 TiDB 集群,执行 `ADMIN SET BDR ROLE PRIMARY` 将其设置为主集群。
1. 选择一个 TiDB 集群,执行 `ADMIN SET BDR ROLE PRIMARY` 将其设置为主集群。如下所示:

```sql
ADMIN SET BDR ROLE PRIMARY;
Query OK, 0 rows affected
Time: 0.003s

ADMIN SHOW BDR ROLE;
+----------+
| BDR_ROLE |
+----------+
| primary |
+----------+
```

2. 在其他 TiDB 集群上,执行 `ADMIN SET BDR ROLE SECONDARY` 将其设置为从集群。
3. 在主集群上执行**可复制的 DDL**,执行成功的 DDL 会被 TiCDC 同步到从集群中。

Expand Down
5 changes: 5 additions & 0 deletions ticdc/ticdc-changefeed-config.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,11 @@ case-sensitive = false
# 默认值和 TiDB 的默认 SQL 模式一致
# sql-mode = "ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"

# 默认值为 false,表示不处于 BDR 模式。
# 如果要使用 TiCDC 搭建 BDR 集群,需要将该参数设置为 true,同时要将 TiDB 集群设置为 BDR 模式。
# 详情请参考:https://docs.pingcap.com/zh/tidb/stable/ticdc-bidirectional-replication#ticdc-双向复制
# bdr-mode = false

[mounter]
# mounter 解码 KV 数据的线程数,默认值为 16
# worker-num = 16
Expand Down

0 comments on commit 024b809

Please sign in to comment.