How to check who is active controller(broker id) from kafka connect log file

2.1k Views Asked by At

Need to check what is the active controller from any of the log file(Control center or Kafka connect log file etc..). Actually we have multiple brokers out of that one is Active controller(for ex. Broker 01) and now it changed to Broker 02 (able to see from control center ui).

So we just want to when exactly it got changed (exact time) from Broker 01 to Broker 02. Please help me out where we can find this from log files or any other source when exactly it got changed.

1

There are 1 best solutions below

6
On

Have you restarted your broker01 instance? Controller is moving around and its normal behavior when the the current controller getting down another active broker is chosen to be the controller , in order to avoid two time of controller movement, the recommended way for rolling restart of kafka cluster is restarting the controller as the last broker getting restart in the cluster

By command cli you could check active controller from zookeeper command shell

./bin/zookeeper-shell.sh [ZK_IP] get /controller

You can check the broker's controller.log usually when the broker starts writing to controller.log its the time it is chosen as a controller , other brokers would not write to controller.log file at that time –

It could be your controller.log contains data from the previous time it was the controller , in your other cluster controller.log there should be DEBUG message if enabled states "broker x has been elected as the controller"