Connect to Apache ZooKeeper from a different machine or network

IMPORTANT: Making this application’s network ports public is a significant security risk. You are strongly advised to only allow access to those ports from trusted networks. If, for development purposes, you need to access from outside of a trusted network, please do not allow access to those ports via a public IP address. Instead, use a secure channel such as a VPN or an SSH tunnel. Follow these instructions to remotely connect safely and reliably.

Connect from the same network

To connect to the Apache ZooKeeper cluster from the same network where is running you can use or any other Apache ZooKeeper client such as Apache Curator or Kazoo.

NOTE: Remember that you can find the required configuration parameters in the /opt/bitnami/zookeeper/conf/zoo_jaas.conf file.

Connect from a different network

If you must connect to the database from a machine that it is not running in the same network as the Apache ZooKeeper cluster, you can follow these approaches (these are shown in order of preference, from the most secure to the least recommended solution):

  • Option 1: Peer both virtual networks to secure the connections between the two instances. Learn how to connect instances in different networks using network peering.

  • Option 2: Create an SSH tunnel to connect the database console to perform administrative tasks using the primary host’s public IP address. Refer to the FAQ for more information on this.

    NOTE: You should only access the primary server using an SSH tunnel if you wish to temporarily connect to, or use, the Apache ZooKeeper console. This approach is not recommended to permanently connect your application to the Apache ZooKeeper cluster, as a connectivity failure in the SSH tunnel would affect your application’s functionality.

  • Option 3: Make the server publicly accessible and restrict access to a trusted list of source IP addresses using firewall rules. Refer to the FAQ for information on opening ports in the server firewall.

Last modification April 8, 2020