title: Send KafkaProducer from local machine to hortonworks sandbox on virtualbox
body: <p>I have a really simple producer that I am running through eclipse on my windows local machine... What I really want is to get a message through to kafka, so I will be able to view the broker through zookeeper. Just to see how communication works from end to end... So here goes the code:</p>
  
  <pre><code>Properties props = new Properties();
      props.put(ProducerConfig.BOOTSTRAP_SERVERS_CONFIG,"localhost:9020");
      props.put(ProducerConfig.VALUE_SERIALIZER_CLASS_CONFIG,StringSerializer.class.getName());
      props.put(ProducerConfig.KEY_SERIALIZER_CLASS_CONFIG,StringSerializer.class.getName());
  
      KafkaProducer&lt;String,String&gt; producer = new KafkaProducer&lt;String,String&gt;(props);
  
      boolean sync = true;
      String topic="mytopic";
      String key = "mykey";
      String value = "myvalue";
  
      ProducerRecord&lt;String,String&gt; producerRecord = new ProducerRecord&lt;String,String&gt;(topic, key, value);
  
      if (sync) {
          producer.send(producerRecord).get();
      } else {
          producer.send(producerRecord);
      }
  
      producer.close();
  </code></pre>
  
  <p>However after some time I get </p>
  
  <pre><code>Exception in thread "main" java.util.concurrent.ExecutionException: org.apache.kafka.common.errors.TimeoutException: Failed to update metadata after 60000 ms.
  at org.apache.kafka.clients.producer.KafkaProducer$FutureFailure.&lt;init&gt;(KafkaProducer.java:437)
  at org.apache.kafka.clients.producer.KafkaProducer.send(KafkaProducer.java:352)
  at org.apache.kafka.clients.producer.KafkaProducer.send(KafkaProducer.java:248)
  at kafkaProducer.TestProducer.main(TestProducer.java:30)  Caused by: org.apache.kafka.common.errors.TimeoutException: Failed to update metadata after 60000 ms.
  </code></pre>
  
  <p>I have hortonworks sandbox setup, with kafka running but I cannot seem to connect to it. I tried port forwarding in the virtualbox network configurations but still have the same issue. Is there something that I am missing?</p>