bchkafka

Connect to Kafka from a different machine

For security reasons, the Kafka ports in this solution cannot be accessed over a public IP address. To connect to Kafka and Zookeeper from a different machine, you must open ports 9092 and 2181 for remote access. Refer to the FAQ for more information on this.

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.

Once you have added the firewall rule and opened the ports, perform these additional steps:

  • Edit your Zookeeper configuration file (/opt/bitnami/zookeeper/conf/zoo.cfg) and comment out the following line:

    clientPortAddress=localhost
    
  • Edit your Kafka configuration file (/opt/bitnami/kafka/config/server.properties). If necessary, uncomment the following line and change the value of the parameter to the public IP address of the server:

    #advertised.host.name=<hostname routable by clients>
    
  • Restart the server to reload the configuration files.

    $ sudo /opt/bitnami/ctlscript.sh restart