canal-adapter 使用kafka模式同步mysql到es,未报错未同步, 使用etl进行全量同步数据正常同步到es, 猜测可能是kafka没有数据, 但是logger适配器有打出dml信息。 有谁遇到过这个情况 版本
canal-server 1.1.3 canal-adapter 1.1.4
配置如下 canal-server
################################################# ######### common argument ############# ################################################# #canal.manager.jdbc.url=jdbc:mysql://127.0.0.1:3306/canal_manager?useUnicode=true&characterEncoding=UTF-8 #canal.manager.jdbc.username=root #canal.manager.jdbc.password=121212 canal.id = 1 canal.ip = canal.port = 11111 canal.metrics.pull.port = 11112 canal.zkServers =
canal.zookeeper.flush.period = 1000 canal.withoutNetty = false
canal.serverMode = kafka
canal.file.data.dir = ${canal.conf.dir} canal.file.flush.period = 1000
canal.instance.memory.buffer.size = 16384
canal.instance.memory.buffer.memunit = 1024
canal.instance.memory.batch.mode = MEMSIZE canal.instance.memory.rawEntry = true
canal.instance.detecting.enable = false #canal.instance.detecting.sql = insert into retl.xdual values(1,now()) on duplicate key update x=now() canal.instance.detecting.sql = select 1 canal.instance.detecting.interval.time = 3 canal.instance.detecting.retry.threshold = 3 canal.instance.detecting.heartbeatHaEnable = false
canal.instance.transaction.size = 1024
canal.instance.fallbackIntervalInSeconds = 60
canal.instance.network.receiveBufferSize = 16384 canal.instance.network.sendBufferSize = 16384 canal.instance.network.soTimeout = 30
canal.instance.filter.druid.ddl = true canal.instance.filter.query.dcl = false canal.instance.filter.query.dml = false canal.instance.filter.query.ddl = false canal.instance.filter.table.error = false canal.instance.filter.rows = false canal.instance.filter.transaction.entry = false
canal.instance.binlog.format = ROW,STATEMENT,MIXED canal.instance.binlog.image = FULL,MINIMAL,NOBLOB
canal.instance.get.ddl.isolation = false
canal.instance.parser.parallel = true
#canal.instance.parser.parallelThreadSize = 16
canal.instance.parser.parallelBufferSize = 256
canal.instance.tsdb.enable = true canal.instance.tsdb.dir = ${canal.file.data.dir:../conf}/${canal.instance.destination:} canal.instance.tsdb.url = jdbc:h2:${canal.instance.tsdb.dir}/h2;CACHE_SIZE=1000;MODE=MYSQL; canal.instance.tsdb.dbUsername = canal canal.instance.tsdb.dbPassword = canal
canal.instance.tsdb.snapshot.interval = 24
canal.instance.tsdb.snapshot.expire = 360
canal.aliyun.accessKey = canal.aliyun.secretKey =
################################################# ######### destinations ############# ################################################# canal.destinations = example
canal.conf.dir = ../conf
canal.auto.scan = true canal.auto.scan.interval = 5
canal.instance.tsdb.spring.xml = classpath:spring/tsdb/h2-tsdb.xml #canal.instance.tsdb.spring.xml = classpath:spring/tsdb/mysql-tsdb.xml
canal.instance.global.mode = spring canal.instance.global.lazy = false #canal.instance.global.manager.address = 127.0.0.1:1099 #canal.instance.global.spring.xml = classpath:spring/memory-instance.xml canal.instance.global.spring.xml = classpath:spring/file-instance.xml #canal.instance.global.spring.xml = classpath:spring/default-instance.xml
################################################## ######### MQ ############# ################################################## canal.mq.servers = kafka:9092 canal.mq.retries = 0 canal.mq.batchSize = 16384 canal.mq.maxRequestSize = 1048576 canal.mq.lingerMs = 100 canal.mq.bufferMemory = 33554432 canal.mq.canalBatchSize = 50 canal.mq.canalGetTimeout = 100 canal.mq.flatMessage = false canal.mq.compressionType = none canal.mq.acks = all
canal.mq.transaction = false #canal.mq.properties. =
canal-adapter application.yml
server: port: 8081 spring: jackson: date-format: yyyy-MM-dd HH:mm:ss time-zone: GMT+8 default-property-inclusion: non_null logging: level: com.alibaba.otter.canal.client.adapter.es: DEBUG canal.conf: mode: kafka # canalServerHost: canal-server:11111 mqServers: kafka:9092 flatMessage: false batchSize: 500 syncBatchSize: 1000 retries: 0 timeout: accessKey: secretKey: srcDataSources: defaultDS: url: jdbc:mysql://mysql:3306/broker?useUnicode=true username: root password: canalAdapters: - instance: example groups: - groupId: g1 outerAdapters: - name: es hosts: elasticsearch:9300 properties: cluster.name: es-cluster - name: logger
原提问者GitHub用户xiao-xiao-xiao
已解决, 产生的原因是es配置文件中的sql项配置有问题,目前不支持 SELECT 'A' AS A FROM example 这种形式. 但这里出现一个问题, 在es同步时, sql解析错误没爆出错误来, 导致不容易找到问题的根源
原回答者GitHub用户xiao-xiao-xiao
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。