0
0
Kafkadevops~5 mins

Kafka Manager/UI tools - Commands & Configuration

Choose your learning style9 modes available
Introduction
Kafka Manager and UI tools help you see and control your Kafka clusters easily. They solve the problem of managing Kafka topics, brokers, and consumers without using complex commands.
When you want to quickly check the health of your Kafka cluster without using command line tools
When you need to create, delete, or modify Kafka topics with a simple interface
When you want to monitor consumer groups and their lag visually
When you want to troubleshoot Kafka issues by viewing logs and metrics in one place
When you want to share Kafka cluster status with your team without giving them command line access
Config File - application.conf
application.conf
kafka-manager {
  kafka-manager.zkhosts="localhost:2181"
  kafka-manager.kafka-manager-auth.enabled=false
  kafka-manager.http.port=9000
  kafka-manager.loglevel="INFO"
}

play {
  http.port=9000
  application.secret="changemechangemechangemechangeme"
}

This configuration file sets up Kafka Manager to connect to your ZooKeeper at localhost:2181. It disables authentication for simplicity, sets the HTTP port to 9000, and configures logging level to INFO. The play framework settings define the web server port and a secret key for session management.

Commands
This command runs Kafka Manager in a Docker container, connecting it to ZooKeeper at localhost:2181 and exposing the web UI on port 9000.
Terminal
docker run -d --name kafka-manager -p 9000:9000 -e ZK_HOSTS=localhost:2181 hlebalbau/kafka-manager
Expected OutputExpected
Unable to find image 'hlebalbau/kafka-manager:latest' locally latest: Pulling from hlebalbau/kafka-manager Digest: sha256:... Status: Downloaded newer image for hlebalbau/kafka-manager:latest c1a2b3d4e5f6g7h8i9j0k1l2m3n4o5p6q7r8s9t0u1v2w3x4y5z6a7b8c9d0e1f2
-d - Run container in background
-p 9000:9000 - Map container port 9000 to host port 9000
-e ZK_HOSTS=localhost:2181 - Set ZooKeeper connection string
This command checks if Kafka Manager is running and reachable by requesting the clusters page, which lists Kafka clusters managed by the UI.
Terminal
curl http://localhost:9000/clusters
Expected OutputExpected
<!DOCTYPE html> <html> <head><title>Kafka Manager</title></head> <body> <h1>Kafka Clusters</h1> <!-- Cluster list content here --> </body> </html>
This command shows the last 20 lines of Kafka Manager logs to verify it started correctly and connected to ZooKeeper.
Terminal
docker logs kafka-manager --tail 20
Expected OutputExpected
[INFO] Starting Kafka Manager... [INFO] Connected to ZooKeeper at localhost:2181 [INFO] Kafka Manager started on port 9000
--tail 20 - Show last 20 lines of logs
Key Concept

If you remember nothing else from Kafka Manager, remember: it gives you a simple web interface to manage and monitor Kafka clusters without complex commands.

Common Mistakes
Not exposing the container port 9000 to the host
You won't be able to access the Kafka Manager web UI from your browser
Always use -p 9000:9000 when running the container to map ports
Setting the wrong ZooKeeper address in ZK_HOSTS
Kafka Manager cannot connect to your Kafka cluster and will show errors or no data
Verify your ZooKeeper address and set it correctly in the environment variable
Not checking logs after starting Kafka Manager
You might miss errors that prevent the UI from working properly
Use docker logs to check for startup errors and fix them early
Summary
Run Kafka Manager in a Docker container connected to your ZooKeeper.
Access the Kafka Manager UI on port 9000 to manage Kafka clusters visually.
Check logs to ensure Kafka Manager started and connected successfully.