[英]Kafka 10 kafka-consumer-groups.sh vs. Kafka 8 kafka-run-class.sh of ConsumerOffsetChecker
I need to name my consumers in Kafka 10 the same as I did in Kafka 8, since I have scripts that sniff out and use this info further. 我需要在Kafka 10中为我的消费者命名,就像在Kafka 8中一样,因为我有脚本可以嗅出来并进一步使用这些信息。
Apparently the default naming of the consumer.id has changed (and it also now shows the client.id separately). 显然,consumer.id的默认命名已经改变(现在它也分别显示了client.id)。 I didn't see this mentioned or compared in the docs.
我没有在文档中看到这提到或比较过。
In Kafka 10 terms, what is the equivalent I need to do to have it generate the same '<group> <host> ...' consumer and/or client id format as in Kafka 8 (instead of the 'consumer-#-<guid>' format seen below)? 在Kafka 10术语中,我需要做的是等同于生成与Kafka 8中相同的'<group> <host> ...'消费者和/或客户端ID格式(而不是'消费者 - # - <guid>'格式如下所示)?
Kafka 8: 卡夫卡8:
/usr/local/kafka-0.8/bin/kafka-run-class.sh kafka.tools.ConsumerOffsetChecker --zkconnect localhost:2181 --group optimizer-group --topic optimizer-default-topic
Group Topic Pid Offset logSize Lag Owner
optimizer-group optimizer-default-topic 0 17059718 17059725 7 my-group_myhost.com-1497048808577-1575fa11-0
...
Kafka 10: 卡夫卡10:
/usr/local/kafka/bin/kafka-consumer-groups.sh --bootstrap-server localhost:9092 --group optimizer-group --describe
TOPIC PARTITION CURRENT-OFFSET LOG-END-OFFSET LAG CONSUMER-ID HOST CLIENT-ID
eddude-error-topic 0 0 0 0 consumer-2-e839517b-a150-498d-9054-31ec7a655936 /10.xxx.xx.xxx consumer-2
...
Default consumer id naming convention in 0.8 is hostname-timestamp-[most significant 8 bits of UUID] although you could set consumer.id
to override it. 0.8中的默认使用者ID命名约定是hostname-timestamp- [UUID的最高8位],尽管您可以设置
consumer.id
来覆盖它。
However, default consumer id in 0.10 changes to [client.id]-[UUID] and it seems there is no way to specify it directly. 但是,0.10中的默认使用者ID更改为[client.id] - [UUID],似乎无法直接指定它。 The only way is to set
client.id
to indirectly set the consumer id. 唯一的方法是将
client.id
设置为间接设置使用者ID。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.