title: How to check if ElasticSearch is running properly
body: <p>I am new to ElasticSearch and I am facing issues while connecting to ElasticSearch. Please find below details:</p>
  
  <ol>
  <li><p><strong>hq</strong> plugin and <strong>head</strong> plugin are showing different results:
  <BR><em>Output of HQ Plugin:</em>
  <a href="https://i.stack.imgur.com/gIl45.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/gIl45.jpg" alt="Output of HQ Plugin"></a>
  <BR><em>Output of Head Plugin:</em>
  <a href="https://i.stack.imgur.com/VFi7T.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/VFi7T.jpg" alt="Output of Head Plugin"></a></p></li>
  <li><p>When I try to connect from my scala code, I get following error:</p>
  
  <pre><code>org.elasticsearch.client.transport.NoNodeAvailableException: None of the configured nodes are available: []
  at org.elasticsearch.client.transport.TransportClientNodesService.ensureNodesAreAvailable(TransportClientNodesService.java:305)
  at org.elasticsearch.client.transport.TransportClientNodesService.execute(TransportClientNodesService.java:200)
  at org.elasticsearch.client.transport.support.InternalTransportClient.execute(InternalTransportClient.java:106)
  at org.elasticsearch.client.support.AbstractClient.index(AbstractClient.java:102)
  at org.elasticsearch.client.transport.TransportClient.index(TransportClient.java:340)
  at com.sksamuel.elastic4s.IndexDsl$IndexDefinitionExecutable$$anonfun$apply$1.apply(IndexDsl.scala:23)
  at com.sksamuel.elastic4s.IndexDsl$IndexDefinitionExecutable$$anonfun$apply$1.apply(IndexDsl.scala:23)
  at com.sksamuel.elastic4s.Executable$class.injectFuture(Executable.scala:21)
  at com.sksamuel.elastic4s.IndexDsl$IndexDefinitionExecutable$.injectFuture(IndexDsl.scala:20)
  at com.sksamuel.elastic4s.IndexDsl$IndexDefinitionExecutable$.apply(IndexDsl.scala:23)
  at com.sksamuel.elastic4s.IndexDsl$IndexDefinitionExecutable$.apply(IndexDsl.scala:20)
  at com.sksamuel.elastic4s.ElasticClient.execute(ElasticClient.scala:28)
  </code></pre></li>
  </ol>
  
  <p>Here is my Code which I use for connection:</p>
  
  <pre><code>val settings = ImmutableSettings.settingsBuilder()
                                  .put("cluster.name", "elasticsearch")
                                  .build()
  val client = ElasticClient.remote(settings, ElasticsearchClientUri("elasticsearch://10.50.xxx.xxx:9300"))
  </code></pre>
  
  <ol start="3">
  <li><p>I also checked my connection and I am able to successfully telnet 10.50.xxx.xxx on both 9200 and 9300 ports</p></li>
  <li><p>I read somewhere that the problem might be with <code>http.cors</code>, So I added following lines to  <code>/etc/elasticsearch/elasticsearch.yml</code> file on the server:</p>
  
  <pre><code>http.cors.allow-origin: "/.*/"
  http.cors.enabled: true
  </code></pre>
  
  <p><br>
  Please suggest what am I doing wrong ?</p></li>
  </ol>
  
  <p><strong>-- Update --</strong><br>
  <em>Thanks @ Evaldas Buinauskas, It was version problem, I had installed elastic version 2.0 and was using libraries and plugins of version 1.7. I downgraded my elastic to version 1.7 and everything worked!</em></p>