kafka增加kerberos之后GetOffsetShell命令还怎么用?

发表于: 2021-09-24   最后更新时间: 2021-09-24 14:48:34   1,419 游览

kafka添加kerberos之后,还怎么查询偏移量呢?

无kerberos命令是这样的,有kerberos该怎么查呢?

/home/kafka/bin/kafka-run-class.sh kafka.tools.GetOffsetShell --broker-list myc1:6667 --topic acsp1 --time -1

发表于 2021-09-24
添加评论

这样:

export KAFKA_OPTS="-Djava.security.krb5.conf=/etc/krb5.conf -Djava.security.auth.login.config=/etc/kafka/kafka_client_jaas.conf"

/home/kafka/bin/kafka-run-class.sh kafka.tools.GetOffsetShell --broker-list myc1:6667 --topic acsp1 --time -1

-> 半兽人 3年前

生产、消费都可以,查offset不行。

$ export KAFKA_OPTS="-Djava.security.krb5.conf=/etc/krb5.conf -Djava.security.auth.login.config=/home/kafka/config/jaas.conf"
$ /home/kafka/bin/kafka-run-class.sh kafka.tools.GetOffsetShell --broker-list myc4:6667 --topic acsp1 --time -1

[2021-09-24 14:59:40,877] WARN Fetching topic metadata with correlation id 0 for topics [Set(acsp1)] from broker [BrokerEndPoint(0,myc4,6667)] failed (kafka.client.ClientUtils$)
java.io.EOFException
        at org.apache.kafka.common.network.NetworkReceive.readFromReadableChannel(NetworkReceive.java:83)
        at kafka.network.BlockingChannel.readCompletely(BlockingChannel.scala:129)
        at kafka.network.BlockingChannel.receive(BlockingChannel.scala:120)
        at kafka.producer.SyncProducer.liftedTree1$1(SyncProducer.scala:82)
        at kafka.producer.SyncProducer.kafka$producer$SyncProducer$$doSend(SyncProducer.scala:79)
        at kafka.producer.SyncProducer.send(SyncProducer.scala:124)
        at kafka.client.ClientUtils$.fetchTopicMetadata(ClientUtils.scala:59)
        at kafka.client.ClientUtils$.fetchTopicMetadata(ClientUtils.scala:94)
        at kafka.tools.GetOffsetShell$.main(GetOffsetShell.scala:79)
        at kafka.tools.GetOffsetShell.main(GetOffsetShell.scala)
Exception in thread "main" kafka.common.KafkaException: fetching topic metadata for topics [Set(acsp1)] from broker [ArrayBuffer(BrokerEndPoint(0,myc4,6667))] failed
        at kafka.client.ClientUtils$.fetchTopicMetadata(ClientUtils.scala:73)
        at kafka.client.ClientUtils$.fetchTopicMetadata(ClientUtils.scala:94)
        at kafka.tools.GetOffsetShell$.main(GetOffsetShell.scala:79)
        at kafka.tools.GetOffsetShell.main(GetOffsetShell.scala)
Caused by: java.io.EOFException
        at org.apache.kafka.common.network.NetworkReceive.readFromReadableChannel(NetworkReceive.java:83)
        at kafka.network.BlockingChannel.readCompletely(BlockingChannel.scala:129)
        at kafka.network.BlockingChannel.receive(BlockingChannel.scala:120)
        at kafka.producer.SyncProducer.liftedTree1$1(SyncProducer.scala:82)
        at kafka.producer.SyncProducer.kafka$producer$SyncProducer$$doSend(SyncProducer.scala:79)
        at kafka.producer.SyncProducer.send(SyncProducer.scala:124)
        at kafka.client.ClientUtils$.fetchTopicMetadata(ClientUtils.scala:59)
        ... 3 more
半兽人 -> 3年前

这个错误不是证书的错误额,已经进去了。

你的答案

查看kafka相关的其他问题或提一个您自己的问题