title: Exception in thread "main" org.elasticsearch.client.transport.NoNodeAvailableException: No node available
body: <p>I am trying index using below Java code in elastic search..
  I gave my machine Ip in the code .It is unable to connect to node.
  It is giving error like below : </p>
  
  <p><strong>Exception in thread "main" org.elasticsearch.client.transport.NoNodeAvailableException: No node available
          at</strong> org.elasticsearch.client.transport.TransportClientNodesService.execute(TransportClientNodesService.java:219)
          at org.elasticsearch.client.transport.support.InternalTransportClient.execute(InternalTransportClient.java:106)
          at org.elasticsearch.client.support.AbstractClient.index(AbstractClient.java:82)
          at org.elasticsearch.client.transport.TransportClient.index(TransportClient.java:330)
          at org.elasticsearch.action.index.IndexRequestBuilder.doExecute(IndexRequestBuilder.java:314)
          at org.elasticsearch.action.ActionRequestBuilder.execute(ActionRequestBuilder.java:85)
          at org.elasticsearch.action.ActionRequestBuilder.execute(ActionRequestBuilder.java:59)
          at test.test1.main(test1.java:30)</p>
  
  <p>Code I am using:</p>
  
  <pre><code>public static void main(String[] args) {
  
      String json = "{" +         
                      "\"user\":\"AMaresh\"," +         
                      "\"postDate\":\"2014-04-23\"," + 
                      "\"message\":\"trying out Elasticsearch\"" +
                      "}";  
  
  
      Settings settings = ImmutableSettings.settingsBuilder().put("elasticsearch", "elasticsearch").build();
      TransportClient transportClient = new TransportClient(settings);
  
      Client client = new TransportClient().addTransportAddress(new InetSocketTransportAddress("10.210.51.207",9300));
  
      IndexResponse response = client.prepareIndex("Cricket", "cric", "1").setSource(json).execute().actionGet();
      //List&lt;String&gt; matches = response.matches();
      System.out.println(response);
      System.out.println("finished");
  </code></pre>
  
  <p>I have checked ports are open in the machine.</p>
  
  <p>Can anybody help me understanding the problem.</p>
  
  <p>Thanks in advance</p>