CCDAK Apache Kafka Practice Test

Access More Questions
Which command shows partitions without a leader for a topic?
Correct Answer:
bin/kafka-topics.sh --zookeeper localhost:2181 --describe --unavailable-partitions
Explanation:
You’re being tested on how to identify partitions that currently have no leader. In Kafka, every partition normally has a leader broker that handles all reads and writes for that partition. If that leader broker goes down or is in the middle of a leader election, the partition temporarily has no leader and is considered unavailable. The kafka-topics.sh tool can surface this state when you describe a topic and request the partitions that are unavailable. The flag to include those partitions is --unavailable-partitions. To get this information, you connect to the cluster state (in this setup via Zookeeper) and run the command with --zookeeper, along with --describe and --unavailable-partitions. This combination will list partitions that currently lack a leader. Using bootstrap-server mode can behave differently for this particular flag in some environments, so the Zookeeper-based approach gives the reliable output for showing partitions without a leader.

Access more questions from this quiz

Continue to CCDAK Apache Kafka Practice Test for more practice questions and the full quiz experience.

Access More Questions