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
• 4,340 points
48 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
• 8,510 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,380 points
600 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,870 points
382 views
0 votes
0 answers

How to check pending messages in KAFKA topic?

Let say we have first_topic which has kafka_server_brokertopicmetrics_messagesin_total{instance="localhost:1120",job="kafka",topic="first_topic"}  ...READ MORE

May 2, 2019 in Apache Kafka by anonymous
1,534 views
0 votes
1 answer

Is there any change in consumer offsets if a new partition(s) is added to a Kafka topic?

Yes, it stays the same. An offset is ...READ MORE

answered Jul 9, 2018 in Apache Kafka by nitinrawat895
• 10,870 points
520 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
11,249 views
+1 vote
12 answers

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

As of kafka 2.3.0 version, there is ...READ MORE

answered Sep 8, 2019 in Apache Kafka by Brajkishore
• 240 points
72,899 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
220 views
0 votes
1 answer

How can I create a topic in apache kafka?

Hi@akhtar, To create kafka topic you can use ...READ MORE

answered Feb 6 in Apache Kafka by MD
• 8,510 points
50 views
0 votes
1 answer

How can I create multiple consumers in apache kafka?

Hi@akhtar, If you already created multiple producers then ...READ MORE

answered Feb 6 in Apache Kafka by MD
• 8,510 points
92 views