Identify the Active Controller In Kafka

Kafka Active Controller

What is a Controller?

How to get the currently active controller?

  • Shell command when installed on the host
zookeeper-shell 192.168.1.1:22181 get /controller
  • When we are dealing with the docker container we can execute the above command in interactive mode as follows
# Connect to Zookeeper
docker run --net=host --rm confluentinc/cp-kafka:4.0.0 zookeeper-shell 192.168.1.1:22181
# Get the Controller
docker run --net=host --rm confluentinc/cp-kafka:4.0.0 zookeeper-shell 192.168.1.1:22181 get /controller

Note: 192.168.1.1 is the zookeeper IP

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store