title: KafkaProducer Connection refused
body: <p>I trying to send some data to kafka, but when i run my code i got</p>
  
  <pre><code>13:20:17.688 [kafka-producer-network-thread | producer-1] 
  DEBUG org.apache.kafka.clients.NetworkClient - Node -1 disconnected.
  13:20:17.784 [kafka-producer-network-thread | producer-1] DEBUG org.apache.kafka.clients.NetworkClient - Initialize connection to node -1 for sending metadata request
  13:20:17.784 [kafka-producer-network-thread | producer-1] DEBUG org.apache.kafka.clients.NetworkClient - Initiating connection to node -1 at kafkaAdress:2181.
  13:20:18.781 [kafka-producer-network-thread | producer-1] DEBUG org.apache.kafka.common.network.Selector - Connection with kafkaAdress/addressId disconnected
  java.net.ConnectException: Connection refused: no further information
  at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
  at sun.nio.ch.SocketChannelImpl.finishConnect(Unknown Source)
  at org.apache.kafka.common.network.PlaintextTransportLayer.finishConnect(PlaintextTransportLayer.java:54)
  at org.apache.kafka.common.network.KafkaChannel.finishConnect(KafkaChannel.java:72)
  at org.apache.kafka.common.network.Selector.poll(Selector.java:274)
  at org.apache.kafka.clients.NetworkClient.poll(NetworkClient.java:256)
  at org.apache.kafka.clients.producer.internals.Sender.run(Sender.java:216)
  at org.apache.kafka.clients.producer.internals.Sender.run(Sender.java:128)
  at java.lang.Thread.run(Unknown Source)
  </code></pre>
  
  <p>Code:</p>
  
  <pre><code>    String topic = "TST";
      Properties props = new Properties();
      props.put("bootstrap.servers", "kafkaAdress:2181");
      props.put("key.serializer",      "org.apache.kafka.common.serialization.StringSerializer");
      props.put("value.serializer", "org.apache.kafka.common.serialization.StringSerializer");
      KafkaProducer&lt;String, String&gt; producer = new KafkaProducer&lt;&gt;(props);
      for(int i = 0; i &lt; 100; i++)
          producer.send(new ProducerRecord&lt;String, String&gt;(topic, "TestMessage"));    
      producer.close();
  </code></pre>
  
  <p>Does anyone know how to solve this?</p>
  
  <p>I use kafka 0.9.1</p>