Skip to content

Commit

Permalink
reference: update tutorials about dm wildcard support (#2383)
Browse files Browse the repository at this point in the history
  • Loading branch information
lichunzhu authored Mar 18, 2020
1 parent 7148ad0 commit 6066c73
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion reference/tools/data-migration/features/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,13 @@ category: reference

本文将详细介绍 DM 提供的数据同步功能,以及相关的配置选项。

Table Routing、Black & White Lists、Binlog Event Filter 在匹配库表名时,有以下版本差异:

+ 对于 v1.0.4 版及后续版本,以上功能均支持[通配符匹配](https://en.wikipedia.org/wiki/Glob_(programming)#Syntax)
+ 对于 v1.0.4 以前的版本,Table Routing 和 Binlog Event Filter 支持通配符,但不支持 `[...]``[!...]` 表达式。Black & White Lists 仅支持正则表达式。

在简单任务场景下推荐使用通配符匹配。

## Table routing

Table routing 提供将上游 MySQL/MariaDB 实例的某些表同步到下游指定表的功能。
Expand Down Expand Up @@ -113,7 +120,14 @@ routes:
```yaml
black-white-list:
rule-1:
do-dbs: ["~^test.*"] # 以 ~ 字符开头,表示规则是正则表达式
do-dbs: ["test*"] # 非 ~ 字符开头,表示规则是通配符;v1.0.4 及后续版本支持通配符规则。
​ do-tables:
- db-name: "test[123]" # 匹配 test1、test2、test3。
tbl-name: "t[1-5]" # 匹配 t1、t2、t3、t4、t5。
- db-name: "test"
tbl-name: "t"
rule-2:
do-dbs: ["~^test.*"] # 以 ~ 字符开头,表示规则是正则表达式。
​ ignore-dbs: ["mysql"]
do-tables:
- db-name: "~^test.*"
Expand Down

0 comments on commit 6066c73

Please sign in to comment.