title: Not able to connect to kafka server on google compute engine from local machine
body: <p>I am running my zookeeper and kafka server on google compute engine. Both are running on default ports(zookeeper on 2181 an kafka on 9092). Both are running on the same instance. I have opened up both the ports as well. In my server.properties I have configured </p>
  
  <pre><code>zookeeper.connect=&lt;InternalIP&gt;:2181
  host.name=localhost
  </code></pre>
  
  <p>If I try to push/consume message form the same server, I am able to do so
  To push/consume I use</p>
  
  <pre><code> bin/kafka-console-producer.sh --broker-list localhost:9092 --topic test
   bin/kafka-console-consumer.sh --zookeeper localhost:2181 --topic test --from-beginning
  </code></pre>
  
  <p>However, If try to the same from my local machine I get kafka.common.FailedToSendMessageException in producer and java.net.ConnectException: connection refuesed in case of consumer
  I try to push/consume via</p>
  
  <pre><code>bin/kafka-console-producer.sh --broker-list &lt;ExternalIP&gt;:9092 --topic topic1
  bin/kafka-console-consumer.sh --zookeeper &lt;ExternalIP&gt;:2181 --topic topic1 --from-beginning
  </code></pre>
  
  <p>Please note that i am able to ping the external ip from my local system.</p>
  
  <p>I have configured the below mentioned firewall rules in compute engine</p>
  
  <pre><code>Description
  
  kafka port enabled
  Network
  
  default
  Source filter
  
  Allow from any source (0.0.0.0/0)
  Allowed protocols and ports
  
  tcp:9092
  </code></pre>
  
  <p>Description</p>
  
  <pre><code>zookeeper port enabled
  Network
  
  default
  Source filter
  
  Allow from any source (0.0.0.0/0)
  Allowed protocols and ports
  
  tcp:2181
  </code></pre>