这个问题要怎么解决? 我滚动重启了broker和zookeeper,依然还是有提示。
[36mkafka_manager_1 |[0m 2020-09-08 00:42:58,625 - [WARN] o.a.k.c.NetworkClient - [Consumer clientId=consumer-KMOffsetCache-77c7dce59bc5-1, groupId=KMOffsetCache-77c7dce59bc5] 33 partitions have leader brokers without a matching listener, including [__consumer_offsets-10, __consumer_offsets-20, __consumer_offsets-40, __consumer_offsets-11, __consumer_offsets-31, __consumer_offsets-13, __consumer_offsets-22, __consumer_offsets-32, __consumer_offsets-8, __consumer_offsets-43]
[36mkafka_manager_1 |[0m 2020-09-08 00:42:58,736 - [WARN] o.a.k.c.NetworkClient - [Consumer clientId=consumer-KMOffsetCache-77c7dce59bc5-1, groupId=KMOffsetCache-77c7dce59bc5] 33 partitions have leader brokers without a matching listener, including [__consumer_offsets-10, __consumer_offsets-20, __consumer_offsets-40, __consumer_offsets-11, __consumer_offsets-31, __consumer_offsets-13, __consumer_offsets-22, __consumer_offsets-32, __consumer_offsets-8, __consumer_offsets-43]
[36mkafka_manager_1 |[0m 2020-09-08 00:42:59,238 - [WARN] o.a.k.c.NetworkClient - [Consumer clientId=consumer-KMOffsetCache-77c7dce59bc5-1, groupId=KMOffsetCache-77c7dce59bc5] 33 partitions have leader brokers without a matching listener, including [__consumer_offsets-10, __consumer_offsets-20, __consumer_offsets-40, __consumer_offsets-11, __consumer_offsets-31, __consumer_offsets-13, __consumer_offsets-22, __consumer_offsets-32, __consumer_offsets-8, __consumer_offsets-43]
kafka_manager? 你看报的是
KMOffsetCache
缓存警告,你重启下kafka-manager或者清空一下应该就好了。我重启过manager,过了几分钟又会开始这种提示,直到我重启kafka和zk集群,然后出现KMOffsetCache,再重启才恢复。
之前 logstash也会有这种提示(partitions have leader brokers without a matching listener),一旦重启 logstash就恢复了,但是会丢一部分数据,为什么重启之后logstash不是从最后一次成功的offset位置开始新的消费?消费者接收到消息时是不是需要实现持久化? 我三个broker,如果想加什么配置需要滚动重启broker,每次重启一个broker对于消费者来说会有什么影响吗?
因为你这个
警告
是跟你当前的客户端(manager/logstash)之间产生的,你看看你做了什么操作,导致客户端存储的offset和服务器的不匹配。但是,无关紧要,只是个警告,这个清理下客户端的数据即可,让客户端和kafka保持一致,不然客户端发送一个offset给kafka,kafka不认,就会报这个
警告
。不要老重启broker,基本都不是它的问题,一旦搭建好集群,我们都很多年不会动它。好的 谢谢
你的答案