分类: Cache

kafka Failed to send messages after 10 tries 问题解决

Tomcat工程报错如下:

2017-12-25 13:28:44,594 [dataQueueConsumer-3:ERROR] com.plocc.dc.consumer.FormatConsumer - kafka.common.FailedToSendMessageException: Failed to send messages aft
er 10 tries.
2017-12-25 13:28:44,489 [dataQueueConsumer-3:ERROR] kafka.producer.async.DefaultEventHandler - Failed to collate messages by topic, partition due to: Failed to f
etch topic metadata for topic: wifi.wifiuseri

从wifi车场推送回来的数据,无法写入kafka订阅里面,解决步骤:
1、先确认kafka几台机器的内网使用主机名能否正常通信,
ping z1 看主机名能否ping通;

2、检查kakfa能否正常列出主题

/usr/local/app/msg_server/kafka/0.8.2.1/bin/kafka-topics.sh --list --zookeeper k1:2181,k2:2181

3、查看/usr/local/app/msg_server/kafka/0.8.2.1/config/consumer.properties 文件
将zookeeper.connect=127.0.0.1:2181修改为zookeeper.connect=z1:2181
这里的z1主机名对应本机内网IP,依次将其他2个节点也修改,最后重启下kafka,同时web应用服务器的host里面也应该要有z1的解析,确认以上3点以后即可解决。

相关文章

发表新评论