Vijay Kumar
Vijay Kumar

Reputation: 2717

Error: partition 0 does not have a leader. Skip getting offsets

I am trying to determine the current offset on a topic, I run the

bin/kafka-run-class.sh kafka.tools.GetOffsetShell

Command and I get the following error, What may be going on, and how do I fix this?

Picked up _JAVA_OPTIONS: -Xmx4g
Error: partition 2 does not have a leader. Skip getting offsets
Error: partition 4 does not have a leader. Skip getting offsets
Error: partition 1 does not have a leader. Skip getting offsets
Error: partition 3 does not have a leader. Skip getting offsets
Error: partition 0 does not have a leader. Skip getting offsets

Upvotes: 1

Views: 2350

Answers (1)

Giorgos Myrianthous
Giorgos Myrianthous

Reputation: 39920

Most probably your Kafka brokers are down.

You can run

kafka-topics --zookeeper host:2181 --describe --topic topic_name

and see whether the Leader is equal to -1. If this is the case then you need to start Kafka brokers.

bin/kafka-server-start.sh config/server.properties

Upvotes: 1

Related Questions