使用docker-compose 管理cannal-server canal-admin canal-adapter 由于机器的问题在启动过程中会爆错
2019-10-08 17:56:22.657 [main] INFO com.alibaba.otter.canal.deployer.CanalLauncher - ## set default uncaught exception handler 2019-10-08 17:56:22.884 [main] INFO com.alibaba.otter.canal.deployer.CanalLauncher - ## load canal configurations 2019-10-08 17:56:24.543 [main] ERROR com.alibaba.otter.canal.deployer.CanalLauncher - ## Something goes wrong when starting up the canal Server: com.alibaba.otter.canal.common.CanalException: load manager config failed. Caused by: java.lang.RuntimeException: requestGet remote error, request : http://canal-admin:8089/api/v1/config/server_polling?ip=172.25.0.6&port=11110&md5=®ister=1&cluster=at com.alibaba.otter.canal.instance.manager.plain.HttpHelper.get(HttpHelper.java:109) ~[canal.instance.manager-1.1.4.jar:na]
该问题是因为 canal-admin未完全启动导致的
重启 cannal-server后该问题解决
docker-compose restart cannal-server
cannal-server日志(canal.log)中出现错误日志
2019-10-08 18:05:15.679 [canal-instance-scan-0] ERROR c.a.o.c.deployer.monitor.ManagerInstanceConfigMonitor - scan failed java.lang.NullPointerException: null at com.google.common.base.Preconditions.checkNotNull(Preconditions.java:210) ~[guava-18.0.jar:na] at com.google.common.collect.Lists.newArrayList(Lists.java:110) ~[guava-18.0.jar:na] at com.alibaba.otter.canal.deployer.monitor.ManagerInstanceConfigMonitor.scan(ManagerInstanceConfigMonitor.java:85) ~[canal.deployer-1.1.4.jar:na] at com.alibaba.otter.canal.deployer.monitor.ManagerInstanceConfigMonitor.access$000(ManagerInstanceConfigMonitor.java:29) ~[canal.deployer-1.1.4.jar:na] at com.alibaba.otter.canal.deployer.monitor.ManagerInstanceConfigMonitor$2.run(ManagerInstanceConfigMonitor.java:53) ~[canal.deployer-1.1.4.jar:na] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [na:1.8.0_181] at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308) [na:1.8.0_181] at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180) [na:1.8.0_181] at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294) [na:1.8.0_181] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [na:1.8.0_181] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [na:1.8.0_181] at java.lang.Thread.run(Thread.java:748) [na:1.8.0_181]
然后请求了下第一次错误的curl
curl -X GET http://127.0.0.1:8089/api/v1/config/server_polling?ip=172.23.0.6&port=11110&md5=®ister=1
返回结果
{"code":50000,"message":"Missing request header 'user' for method parameter of type String","data":null}
看返回结果可能是解析返回结果中的data出现问题。但查看配置canal.user 有配置,以下是我的配置
canal-server canal.properties
################################################# ######### common argument ############# #################################################
canal.ip = canal-server
canal.register.ip = canal.port = 11111 canal.metrics.pull.port = 11112
canal.user = admin canal.passwd = 6BB4837EB74329105EE4568DDA7DC67ED2CA2AD9
canal.admin.manager = canal-admin:8089 canal.admin.port = 11110 canal.admin.user = admin canal.admin.passwd = 4ACFE3202A5FF5CF467898FC58AAB1D615029441
canal.admin.register.auto = true canal.admin.register.cluster =
canal.zkServers =
canal.zookeeper.flush.period = 1000 canal.withoutNetty = false
canal.serverMode = tcp
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 = ${canal.admin.manager} #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 = 127.0.0.1:6667 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 = true canal.mq.compressionType = none canal.mq.acks = all #canal.mq.properties. = canal.mq.producerGroup = test
canal.mq.accessChannel = local
#canal.mq.namespace =
################################################## ######### Kafka Kerberos Info ############# ##################################################
有老铁有遇到这个问题的吗?
原提问者GitHub用户xiao-xiao-xiao
你手工模拟的curl请求,缺少user/passwd信息,这个是header提交
你可以本地运行PlainCanalConfigClientIntegration,验证一下具体报错的原因,可能是账号密码不匹配导致
原回答者GitHub用户agapple
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。