升级后kafka报超时问题
2021-08-17 14:50:40.657 [MQ-Parallel-Sender-5] DEBUG org.apache.kafka.clients.producer.KafkaProducer - [Producer clientId=producer-2] Exception occurred during message send: org.apache.kafka.common.errors.TimeoutException: Failed to update metadata after 60000 ms. 2021-08-17 14:50:40.665 [pool-12-thread-1] ERROR c.a.o.canal.connector.kafka.producer.CanalKafkaProducer - java.util.concurrent.ExecutionException: org.apache.kafka.common.errors.TimeoutException: Failed to update metadata after 60000 ms. java.lang.RuntimeException: java.util.concurrent.ExecutionException: org.apache.kafka.common.errors.TimeoutException: Failed to update metadata after 60000 ms. at com.alibaba.otter.canal.connector.kafka.producer.CanalKafkaProducer.send(CanalKafkaProducer.java:184) ~[na:na] at com.alibaba.otter.canal.server.CanalMQStarter.worker(CanalMQStarter.java:181) [canal.server-1.1.5.jar:na] at com.alibaba.otter.canal.server.CanalMQStarter.access$100(CanalMQStarter.java:25) [canal.server-1.1.5.jar:na] at com.alibaba.otter.canal.server.CanalMQStarter$CanalMQRunnable.run(CanalMQStarter.java:223) [canal.server-1.1.5.jar:na] 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] Caused by: java.util.concurrent.ExecutionException: org.apache.kafka.common.errors.TimeoutException: Failed to update metadata after 60000 ms. at org.apache.kafka.clients.producer.KafkaProducer$FutureFailure.(KafkaProducer.java:1150) ~[na:na] at org.apache.kafka.clients.producer.KafkaProducer.doSend(KafkaProducer.java:846) ~[na:na] at org.apache.kafka.clients.producer.KafkaProducer.send(KafkaProducer.java:784) ~[na:na] at org.apache.kafka.clients.producer.KafkaProducer.send(KafkaProducer.java:671) ~[na:na] at com.alibaba.otter.canal.connector.kafka.producer.CanalKafkaProducer.produce(CanalKafkaProducer.java:268) ~[na:na] at com.alibaba.otter.canal.connector.kafka.producer.CanalKafkaProducer.send(CanalKafkaProducer.java:261) ~[na:na] at com.alibaba.otter.canal.connector.kafka.producer.CanalKafkaProducer.lambda$send$0(CanalKafkaProducer.java:156) ~[na:na] at java.util.concurrent.FutureTask.run(FutureTask.java:266) ~[na:1.8.0_181] ... 3 common frames omitted Caused by: org.apache.kafka.common.errors.TimeoutException: Failed to update metadata after 60000 ms.
canal使用web方式部署。
v1.1.4 MQ 配置如下:
################################################## ######### MQ ############# ################################################## #这里因为我们选择的是kafka,所以填kafka集群地址,多个地址用逗号隔开 canal.mq.servers = 10.234.6.220: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 = 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 ############# ################################################## canal.mq.kafka.kerberos.enable = false canal.mq.kafka.kerberos.krb5FilePath = "../conf/kerberos/krb5.conf" canal.mq.kafka.kerberos.jaasFilePath = "../conf/kerberos/jaas.conf"
v1.1.5 MQ 配置如下:
################################################## ######### MQ Properties ############# ##################################################
canal.aliyun.accessKey = canal.aliyun.secretKey = canal.aliyun.uid=
canal.mq.flatMessage = true canal.mq.canalBatchSize = 50 canal.mq.canalGetTimeout = 100 #canal.mq.properties. = canal.mq.producerGroup = test
canal.mq.accessChannel = local
canal.mq.database.hash = true canal.mq.send.thread.size = 30 canal.mq.build.thread.size = 8
################################################## ######### Kafka ############# ##################################################
kafka.bootstrap.servers = 10.234.6.220:9092
kafka.acks = all kafka.compression.type = none kafka.batch.size = 16384
kafka.linger.ms = 100
kafka.max.request.size = 1048576
kafka.buffer.memory = 33554432
kafka.max.in.flight.requests.per.connection = 1
kafka.retries = 0
kafka.kerberos.enable = false kafka.kerberos.krb5.file = "../conf/kerberos/krb5.conf" kafka.kerberos.jaas.file = "../conf/kerberos/jaas.conf"
麻烦帮看看是什么原因导致了kafka的超时呢?
我尝试删除了主题,超时问题就可以解决了,但是我生产环境主题很多,不大可能这么做?希望能找到问题的原因所在,谢谢。
原提问者GitHub用户bjddd192
进一步查看,原来是动态主题的名称发生了变化: 1.4 是 db_wms1.bl_ch_check 1.5 是 db_wms1_bl_ch_check 但是规则并没有调整,都是: canal.mq.dynamicTopic=.\..
原回答者GitHub用户bjddd192
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。