当没有配置canal.properties中的
canal.user = canal.passwd =
这两项,可以正常链接并读取binlog,但是只要配置了这两项,则报错 17:55:49.476 [Thread-2] ERROR com.alibaba.otter.canal.client.impl.running.ClientRunningMonitor - There is an error when execute initRunning method, with destination [myexample]. com.alibaba.otter.canal.protocol.exception.CanalClientException: java.io.IOException: end of stream when reading header at com.alibaba.otter.canal.client.impl.SimpleCanalConnector.doConnect(SimpleCanalConnector.java:190) at com.alibaba.otter.canal.client.impl.SimpleCanalConnector.access$000(SimpleCanalConnector.java:51) at com.alibaba.otter.canal.client.impl.SimpleCanalConnector$1.processActiveEnter(SimpleCanalConnector.java:449) at com.alibaba.otter.canal.client.impl.running.ClientRunningMonitor.processActiveEnter(ClientRunningMonitor.java:211) at com.alibaba.otter.canal.client.impl.running.ClientRunningMonitor.initRunning(ClientRunningMonitor.java:122) at com.alibaba.otter.canal.client.impl.running.ClientRunningMonitor.start(ClientRunningMonitor.java:92) at com.alibaba.otter.canal.client.impl.SimpleCanalConnector.connect(SimpleCanalConnector.java:107) at com.alibaba.otter.canal.client.impl.ClusterCanalConnector.connect(ClusterCanalConnector.java:64) at com.dc.canal.util.AbstractCanalClientTest.process(AbstractCanalClientTest.java:55) at java.lang.Thread.run(Thread.java:748) Caused by: java.io.IOException: end of stream when reading header at com.alibaba.otter.canal.client.impl.SimpleCanalConnector.read(SimpleCanalConnector.java:431) at com.alibaba.otter.canal.client.impl.SimpleCanalConnector.readNextPacket(SimpleCanalConnector.java:419) at com.alibaba.otter.canal.client.impl.SimpleCanalConnector.readNextPacket(SimpleCanalConnector.java:403) at com.alibaba.otter.canal.client.impl.SimpleCanalConnector.doConnect(SimpleCanalConnector.java:176) ... 9 common frames omitted
这个错误看起来并不是auth产生的,如果代码中用户名密码填写错误会报其他的auth错误。 通过ClusterCanalClientTest或者SimpleCanalClientExample都会得到一样的结构。 求解。。。
原提问者GitHub用户ANUBIS9000
发现原因是写的连接例子那个maven项目,里面配置的依赖canal是老版本的,运行源码,使用源码里带的例子就是正常的了。
原回答者GitHub用户ANUBIS9000
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。