mirror of
https://github.com/alibaba/canal.git
synced 2026-11-04 00:30:15 +08:00
Updated Sync RDB (markdown)
32
Sync-RDB.md
32
Sync-RDB.md
@@ -68,7 +68,37 @@ dbMapping:
|
||||
```
|
||||
导入的类型以目标表的元类型为准, 将自动进行类型转换
|
||||
|
||||
## 3 RDB启动
|
||||
## 3 Mysql 库间镜像schema DDL DML同步
|
||||
|
||||
修改 application.yml:
|
||||
```
|
||||
canalAdapters:
|
||||
- instance: example # canal instance Name or mq topic name
|
||||
groups:
|
||||
- groupId: g1
|
||||
outerAdapters:
|
||||
- name: rdb
|
||||
key: mysql1
|
||||
properties:
|
||||
jdbc.driverClassName: com.mysql.jdbc.Driver
|
||||
jdbc.url: jdbc:mysql://192.168.0.36/mytest?useUnicode=true
|
||||
jdbc.username: root
|
||||
jdbc.password: 121212
|
||||
```
|
||||
|
||||
修改 conf/rdb/mytest_user.yml文件:
|
||||
```
|
||||
dataSourceKey: defaultDS
|
||||
destination: example
|
||||
outerAdapterKey: mysql1
|
||||
concurrent: true
|
||||
dbMapping:
|
||||
mirrorDb: true
|
||||
database: mytest
|
||||
```
|
||||
其中dbMapping.database的值代表源库和目标库的schema名称,即两库的schema要一模一样
|
||||
|
||||
## 4 RDB启动
|
||||
|
||||
* 将目标库的jdbc jar包放入lib文件夹, 这里放入ojdbc6.jar (如果是其他数据库则放入对应的驱动)
|
||||
* 启动canal-adapter启动器
|
||||
|
||||
Reference in New Issue
Block a user