How to know leader information in kafka?

0 votes

Hi,

I created three broker for a topic in kafka. Now I want to know which broker acts as a leader?

How can I find that?

Thank You

Feb 10 in Apache Kafka by akhtar
• 28,740 points
1,892 views

1 answer to this question.

0 votes

Hi@akhtar,

To know leader information you can use the below command.

$ ./bin/kafka-topics.sh --zookeeper localhost:2181 --describe --topic Mytopic

Topic:Mytopic   PartitionCount:3        ReplicationFactor:3     Configs:
        Topic: Mytopic  Partition: 0    Leader: 1       Replicas: 1,2,0 Isr: 1,2,0
        Topic: Mytopic  Partition: 1    Leader: 2       Replicas: 2,0,1 Isr: 2,0,1
        Topic: Mytopic  Partition: 2    Leader: 0       Replicas: 0,1,2 Isr: 0,1,2

Hope this will help you.
Thank You

answered Feb 10 by MD
• 66,660 points

Related Questions In Apache Kafka

0 votes
1 answer

How to commit message offsets in Kafka for reliable data pipeline?

You can use auto.commit.enable to allow Kafka ...READ MORE

answered Jul 9, 2018 in Apache Kafka by Shubham
• 13,450 points
1,164 views
0 votes
1 answer

How to delete a topic in Kafka 0.8.1.1?

Deleting topic isn't always working in 0.8.1.1 Deletion ...READ MORE

answered Sep 4, 2018 in Apache Kafka by nitinrawat895
• 10,950 points
607 views
0 votes
1 answer

How to check pending messages in KAFKA topic?

kafka-run-class.bat kafka.tools.ConsumerOffsetChecker --broker-info --group test-consumer-group --topic test ...READ MORE

answered May 29 in Apache Kafka by chandra
3,412 views
0 votes
0 answers

how to delete the topic in kafka

How to stop Kafka server from crashing ...READ MORE

May 13 in Apache Kafka by sreeveena
• 140 points
136 views
0 votes
2 answers

How can I create multiple consumers in apache kafka?

First of all, Consumer is not thread ...READ MORE

answered Jun 17 in Apache Kafka by Pawan
• 380 points
1,244 views
+1 vote
10 answers

Writing the Kafka consumer output to a file

System.out.println(String.valueOf(output.offset()) + ": " + new String(bytes, ...READ MORE

answered Dec 7, 2018 in Apache Kafka by Harsh
16,813 views
+1 vote
13 answers

How can I delete all the messages from a Kafka topic?

To delete all the messages from a Kafka topic.  There are many approach ...READ MORE

answered Jun 19 in Apache Kafka by Pawan
• 380 points
121,105 views
+1 vote
0 answers

Want to delete consumed topic programatically

directly delete kafka log folder and zeekeeper ...READ MORE

Jun 4, 2019 in Apache Kafka by sarvesh
334 views
0 votes
2 answers

How to installed confluent kafka in our system?

Easy Approach is work with Docker. ConfluentInc ...READ MORE

answered Jun 17 in Apache Kafka by Pawan
• 380 points
319 views
0 votes
1 answer

How to read batch messages in confluent-kafka-python?

Hi@akhtar, You have to read the messages normally ...READ MORE

answered Apr 3 in Apache Kafka by MD
• 66,660 points
1,021 views