Port 2181 is the Apache ZooKeeper client connection port. Kafka brokers, Hadoop, HBase, and many distributed systems use ZooKeeper on port 2181 for distributed coordination – leader election, configuration management, and distributed locking. ZooKeeper 3.5+ introduced a built-in AdminServer on port 8080.
Port Number
2181
Protocol
TCP
Service
ZooKeeper Client Port
Range
IANA Registered (1024–49151)
Basic health check – should return 'imok'
echo ruok | nc host 2181Show ZooKeeper node stats (connections, latency, mode)
echo stat | nc host 2181List root znodes – shows what systems are using this ZooKeeper
zkCli.sh -server host:2181 ls /zkCli.sh -server localhost:2181
echo ruok | nc localhost:2181
kafka-topics.sh --zookeeper localhost:2181 --listZooKeeper was created at Yahoo Research and became an Apache top-level project in 2010. It was essential for Kafka, HBase, and Hadoop coordination. Kafka's KRaft mode (2022) began the deprecation of ZooKeeper for Kafka, with full removal targeted for Kafka 4.0.
Is ZooKeeper still needed for Kafka?
Kafka 3.3+ supports KRaft (Kafka Raft) mode which eliminates ZooKeeper. KRaft is production-ready since Kafka 3.5. New clusters should use KRaft. Existing clusters can migrate via kafka-metadata.sh. ZooKeeper mode will be removed in Kafka 4.0.