java - __consumer_offsets 主题在使用 zookeeper 和 bootstrap-server 描述时显示不同的配置
问题描述
Kafka 版本 - 2.4.0 我正在使用kafka-topics.sh脚本来描述具有以下 2 个选项的__consumer_offsets主题
- --引导服务器
- --zookeeper(已弃用)
他们都显示了不同的复制因子和主题的配置..
任何人都可以在这里帮助理解为什么会出现这种行为。非常感谢您的帮助。
使用 --bootstrap-server 时
./kafka-topics.sh --bootstrap-server kafka-broker:9092 --describe --topic __consumer_offsets
Topic: __consumer_offsets PartitionCount: 50 ReplicationFactor: 3 Configs: compression.type=producer,min.insync.replicas=1,cleanup.policy=compact,segment.bytes=104857600,retention.ms=60000,message.format.version=0.10.2-IV0,file.delete.delay.ms=30000,unclean.leader.election.enable=true,retention.bytes=132070253,delete.retention.ms=30000,segment.ms=3600000
使用 --zookeeper 时
./kafka-topics.sh --zookeeper zookeeper-host:2181/asrkafka --describe --topic __consumer_offsets
Topic: __consumer_offsets PartitionCount: 50 ReplicationFactor: 3 Configs: compression.type=producer,cleanup.policy=compact,segment.bytes=104857600
解决方案
非 Zookeeper 选项使用 AdminClient API,该 API 提取存储在代理设置中的附加主题元数据,而不仅仅是在 Zookeeper 中。
推荐阅读
- python - 如果我们用一个特征训练模型,则查找数据帧高的特征给出最小的错误
- css - “网格模板列:适合内容(50%)1fr;” 没有按预期工作
- javascript - 在javascript,nodejs中解码base64数据
- c - 使用 C 预处理器给出数组值
- string - 如何检查字符串是否包含空格?
- python - 字典字典融化了数据框,在同一张图上绘制多个条形图
- python - 如何在 PyCharm 的调试器中更改控制台中的启动脚本?
- azure-logic-apps - 逻辑应用:HTTP 触发和响应超时
- java - 如何从第二个元素开始一个数组列表,但最后仍然得到第一个
- sql - 左连接后的聚合和计数