TCPRegistered PortFirewall: Usually Closed
2181

Apache ZooKeeper

What is Port 2181?

Port 2181 is the default client port for Apache ZooKeeper, a centralized service for distributed coordination. ZooKeeper provides a hierarchical key-value store used for maintaining configuration information, naming, distributed synchronization, and group services. Originally developed at Yahoo! for Hadoop, ZooKeeper has become a critical component of many distributed systems including Apache Kafka (for broker coordination and consumer group management), Apache HBase, Apache Solr, and many others. ZooKeeper uses a leader-follower architecture where one node is elected leader, and all write operations go through it. It guarantees sequential consistency and uses an atomic broadcast protocol (Zab) for data replication. While newer systems like etcd have emerged, ZooKeeper remains deeply embedded in the Hadoop and Kafka ecosystems.

Common Uses

  • Apache Kafka broker coordination and metadata
  • Distributed configuration management
  • Service discovery and leader election
  • Distributed lock management

Technical Details

Port Number2181
ProtocolTCP
CategoryRegistered
Service NameApache ZooKeeper
Default FirewallUsually Closed
Port Test Commands

Copy-paste commands to check port 2181 (Apache ZooKeeper) from your terminal

Test connectivity

Netcat (nc)Check if TCP port is reachable
nc -zv example.com 2181
curl (HTTP)Test HTTP response on this port
curl -v --max-time 5 http://example.com:2181/
TelnetBasic TCP port connectivity check
telnet example.com 2181
nmapScan port 2181 with service detection
nmap -p 2181 -sV example.com
Bash /dev/tcpPure bash TCP check (no extra tools needed)
(echo > /dev/tcp/example.com/2181) 2>/dev/null && echo "open" || echo "closed"

Open port in firewall

UFW (Ubuntu / Debian)
sudo ufw allow 2181/tcp
iptables
sudo iptables -A INPUT -p tcp --dport 2181 -j ACCEPT
firewalld (RHEL / CentOS)
sudo firewall-cmd --permanent --add-port=2181/tcp && sudo firewall-cmd --reload

Security Considerations

!

ZooKeeper has historically had minimal built-in authentication. Enable SASL authentication (Kerberos or DIGEST-MD5) and ACLs on ZooKeeper nodes. Never expose port 2181 to the internet — ZooKeeper provides administrative access to critical infrastructure. Use network segmentation and firewall rules. ZooKeeper 3.5+ supports TLS for client connections.

Popular Ports Reference

The most commonly used and referenced network ports

Related Ports