How can I see which partitions in the apache Kafka broker?

955 Views Asked by At

Is it possible in Apache kafka through the kafkacat command to see which partition is located in broker? for example: broker 0 partition 1,2

broker 1 partition 0,1,2

Many thanks

I use the .\bin\win\kafkacat -L -b hostname:port command it shows BROKERS and a partitions, but does not show a relationship between them.

1

There are 1 best solutions below

2
OneCricketeer On

You can use built-in kafka-topics --describe command. This will show replica placement and leader partition by broker IDs

But that same information is in latest release of kcat -L output

 1 topics:
  topic "foo" with 3 partitions:
    partition 0, leader 1001, replicas: 1001, isrs: 1001
    partition 1, leader 1001, replicas: 1001, isrs: 1001
    partition 2, leader 1001, replicas: 1001, isrs: 1001

1001 maps to broker.id in server.properties... If you want a reverse lookup to a host/IP, then you need to do extra work.