环境信息
canal 1.1.5 mysql 8.0.23
问题描述
通过canal deployer 读取MySQL binlog 使用canal adapter 同步到elasticsearch(7.12)中 之前一直好好的,今天突然adapter出现故障.
实际执行情况
重启adapter服务之后恢复正常。::
报错如下:
2021-12-31 20:23:55.573 [pool-2-thread-1] ERROR c.a.o.canal.client.adapter.es.core.service.ESSyncService - sync error, es index: tbl_member_promo_transaction, DML : Dml{destination='mysql-2-es', database='ym', table='tbl_member_promo_transaction', type='INSERT', es=1640957035000, ts=1640957035572, sql='', data=[{id=68020387923807053, bill_no=7593482959694152325, uid=158155819286111441, platform_id=362857114342923387, username=thienanpr, cash_type=173, amount=60.0, before_amount=138.0200, after_amount=78.0200, created_at=1640957035391, remark=4260000_34194}], old=null}2021-12-31 20:23:55.574 [pool-2-thread-1] ERROR c.a.otter.canal.adapter.launcher.loader.AdapterProcessor - java.lang.NullPointerExceptionjava.lang.RuntimeException: java.lang.NullPointerException at com.alibaba.otter.canal.client.adapter.es.core.service.ESSyncService.sync(ESSyncService.java:116) ~[na:na] at com.alibaba.otter.canal.client.adapter.es.core.service.ESSyncService.sync(ESSyncService.java:64) ~[na:na] at com.alibaba.otter.canal.client.adapter.es.core.ESAdapter.sync(ESAdapter.java:115) ~[na:na] at com.alibaba.otter.canal.client.adapter.es.core.ESAdapter.sync(ESAdapter.java:94) ~[na:na] at com.alibaba.otter.canal.adapter.launcher.loader.AdapterProcessor.batchSync(AdapterProcessor.java:139) ~[client-adapter.launcher-1.1.5.jar:na] at com.alibaba.otter.canal.adapter.launcher.loader.AdapterProcessor.lambda$null$1(AdapterProcessor.java:97) ~[client-adapter.launcher-1.1.5.jar:na] at java.util.concurrent.CopyOnWriteArrayList.forEach(CopyOnWriteArrayList.java:891) ~[na:1.8.0_241] at com.alibaba.otter.canal.adapter.launcher.loader.AdapterProcessor.lambda$null$2(AdapterProcessor.java:94) ~[client-adapter.launcher-1.1.5.jar:na] at java.util.concurrent.FutureTask.run(FutureTask.java:266) ~[na:1.8.0_241] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) ~[na:1.8.0_241] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) ~[na:1.8.0_241] at java.lang.Thread.run(Thread.java:748) ~[na:1.8.0_241] Caused by: java.lang.NullPointerException: null 2021-12-31 20:23:55.574 [Thread-4] ERROR c.a.otter.canal.adapter.launcher.loader.AdapterProcessor - Outer adapter sync failed! Error sync but ACK!
原提问者GitHub用户mianhuatangtwo
两个解决方案:
1、 用repair issue #3401 #3923 里面的代码打个包 替换你自己的版本
2、 可以给你的每个adapter都配置上key,application.yml和具体的adapter-config.yml 对应上
原回答者GitHub用户agapple
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。