Back to Port Numbers

2181 ZooKeeper TCP

Reference for TCP port 2181, commonly associated with ZooKeeper.

What it's for

Port 2181 is the default client port for Apache ZooKeeper, a coordination service historically used by distributed systems (older Kafka clusters, Hadoop, HBase, and others) to manage cluster metadata, leader election, and configuration in a consistent, fault-tolerant way. It solves the "how do distributed nodes agree on shared state" problem that's genuinely difficult to get right from scratch.

Protocol basics

ZooKeeper clients connect over TCP to interact with its hierarchical namespace of "znodes" (conceptually similar to a filesystem), which can store small amounts of data and support watches that notify clients when something changes — the primitive building blocks used to implement leader election, distributed locks, and configuration management on top. Modern Kafka (using KRaft mode) has removed its ZooKeeper dependency entirely, and the broader distributed-systems ecosystem has increasingly moved toward alternatives like etcd or built-in consensus protocols, though ZooKeeper remains present in many existing production deployments.