DEV Community

Cover image for Identify the Active Controller In Kafka
Jinna Balu
Jinna Balu

Posted on

3 2

Identify the Active Controller In Kafka

What is Controller?

The Controller is one of the kafka broker's, usually behaves as a normal broker and having a controlling capability of managing partition state and replicas and reassignment of the partition.

How to get the current active controller?

Zookeeper is the storage of the kafka cluster, who elects the controller node either in the beginning of the cluster setup or when the controller node crashes. Here is the command to get the controller

  • Shell command when installed on the host
zookeeper-shell 192.168.1.1:22181 get /controller
Enter fullscreen mode Exit fullscreen mode
  • 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
Enter fullscreen mode Exit fullscreen mode

Note: 192.168.1.1 is the zookeeper IP

Image of Timescale

🚀 pgai Vectorizer: SQLAlchemy and LiteLLM Make Vector Search Simple

We built pgai Vectorizer to simplify embedding management for AI applications—without needing a separate database or complex infrastructure. Since launch, developers have created over 3,000 vectorizers on Timescale Cloud, with many more self-hosted.

Read more

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more