[alibaba/canal]canal 1.15 增量同步mysql同一个库下的多个表,最后只有一张表增量同步成功。

2025-11-13 87 views
9

conf/application.yml: server: port: 8081 spring: jackson: date-format: yyyy-MM-dd HH:mm:ss time-zone: GMT+8 default-property-inclusion: non_null

canal.conf: mode: tcp # kafka rocketMQ canalServerHost: 127.0.0.1:11111 batchSize: 500 syncBatchSize: 1000 retries: 0 timeout: accessKey: secretKey: srcDataSources: defaultDS: url: jdbc:mysql://xxxx:3306/test?useUnicode=true&characterEncoding=utf-8&connectionCollation=utf8mb4_general_ci username: canal password: xxxx 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://xxxx:3306/test?useUnicode=true&characterEncoding=utf-8&connectionCollation=utf8mb4_general_ci jdbc.username: canal jdbc.password: xxxxx

mysql_test-1.yaml: ataSourceKey: defaultDS destination: example groupId: g1 outerAdapterKey: mysql1 concurrent: true dbMapping: database: test table: test1 targetTable: mljit.test1 targetPk: id: id mapAll: true commitBatch: 3000 # 批量提交的大小

mysql_test-2.yaml: ataSourceKey: defaultDS destination: example groupId: g1 outerAdapterKey: mysql1 concurrent: true dbMapping: database: test table: test2 targetTable: mljit.test2 targetPk: id: id mapAll: true commitBatch: 3000 # 批量提交的大小

回答

7

logs:

只打印出了 test1.的 dml log,验证发现也只有test 同步成功了

1

可以教教我,怎么配置多表增量同步吗

5

配置了3个张表,最后错误和你一样,居然只能同步一个表了,1.1.5版本

4

刚开始,3个表都可以同步,慢慢只能同步一个表了,