首页 > 解决方案 > 带有引导服务器的 kafka 主题描述显示不同的主题配置

问题描述

[root@AdtechQAxxxx ~]# /opt/kafka-2.3.0/bin/kafka-topics.sh  --zookeeper 192.169.xx.xx:2181 --describe --topic dl_query
Topic:dl_query  PartitionCount:10       ReplicationFactor:2     Configs:
        Topic: dl_query Partition: 0    Leader: 3       Replicas: 3,1   Isr: 3,1
        Topic: dl_query Partition: 1    Leader: 1       Replicas: 1,2   Isr: 1,2
        Topic: dl_query Partition: 2    Leader: 2       Replicas: 2,3   Isr: 2,3
        Topic: dl_query Partition: 3    Leader: 3       Replicas: 3,2   Isr: 3,2
        Topic: dl_query Partition: 4    Leader: 1       Replicas: 1,3   Isr: 1,3
        Topic: dl_query Partition: 5    Leader: 2       Replicas: 2,1   Isr: 2,1
        Topic: dl_query Partition: 6    Leader: 3       Replicas: 3,1   Isr: 3,1
        Topic: dl_query Partition: 7    Leader: 1       Replicas: 1,2   Isr: 1,2
        Topic: dl_query Partition: 8    Leader: 2       Replicas: 2,3   Isr: 2,3
        Topic: dl_query Partition: 9    Leader: 3       Replicas: 3,2   Isr: 3,2
[root@AdtechQAxxxx ~]# /opt/kafka-2.3.0/bin/kafka-topics.sh  --bootstrap-server 192.169.xx.xx:9092 --describe --topic dl_query
Topic:dl_query  PartitionCount:10       ReplicationFactor:2     **Configs:compression.type=gzip,segment.bytes=1073741824,max.message.bytes=100001200**
        Topic: dl_query Partition: 0    Leader: 3       Replicas: 3,1   Isr: 3,1
        Topic: dl_query Partition: 1    Leader: 1       Replicas: 1,2   Isr: 1,2
        Topic: dl_query Partition: 2    Leader: 2       Replicas: 2,3   Isr: 2,3
        Topic: dl_query Partition: 3    Leader: 3       Replicas: 3,2   Isr: 3,2
        Topic: dl_query Partition: 4    Leader: 1       Replicas: 1,3   Isr: 1,3
        Topic: dl_query Partition: 5    Leader: 2       Replicas: 2,1   Isr: 2,1
        Topic: dl_query Partition: 6    Leader: 3       Replicas: 3,1   Isr: 3,1
        Topic: dl_query Partition: 7    Leader: 1       Replicas: 1,2   Isr: 1,2
        Topic: dl_query Partition: 8    Leader: 2       Replicas: 2,3   Isr: 2,3
        Topic: dl_query Partition: 9    Leader: 3       Replicas: 3,2   Isr: 3,2

标签: apache-kafka

解决方案


Kafka-topics 命令最近更新为使用 AdminClo 类,该类需要引导服务器而不是 Zookeeper,最终目标是完全删除对 Zookeeper 的依赖 (KIP-500)。

至于为什么你会看到不同的主题配置,这些数据现在实际上存储在 Zookeeper 中,所以我不确定你为什么会看到这种差异。AdminClient 可能会返回实际的代理默认配置以及主题配置。否则,也许创建一个 JIRA 或尝试升级 Kafka?


推荐阅读