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, 2020 in Apache Kafka by akhtar
• 38,260 points
16,511 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 helps!

To know more about Kafka, I would recommend you to enroll with Kafka training online today.

Thanks.

answered Feb 10, 2020 by MD
• 95,460 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 10, 2018 in Apache Kafka by Shubham
• 13,490 points
3,581 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
• 11,380 points
1,822 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, 2020 in Apache Kafka by chandra
11,057 views
+1 vote
0 answers

how to delete the topic in kafka

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

May 13, 2020 in Apache Kafka by sreeveena
• 150 points
1,424 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 18, 2020 in Apache Kafka by PAWAN
• 380 points
3,585 views
+2 votes
9 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
38,584 views
+1 vote
14 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, 2020 in Apache Kafka by PAWAN
• 380 points
229,457 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
1,648 views
0 votes
2 answers

How to installed confluent kafka in our system?

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

answered Jun 18, 2020 in Apache Kafka by PAWAN
• 380 points
3,099 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, 2020 in Apache Kafka by MD
• 95,460 points
4,517 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP