title: NoNodeAvailableException[None of the configured nodes are available] Elasticsearch
body: <p>I have tried every available solution posted on internet but those didn't fix the error I'm facing. I have created single node master and data server, the configuration for my cluster is as follow:</p>
  
  <p><strong>Elasticsearch.yml</strong></p>
  
  <pre><code># ======================== Elasticsearch Configuration =========================
  #
  # NOTE: Elasticsearch comes with reasonable defaults for most settings.
  #       Before you set out to tweak and tune the configuration, make sure you
  #       understand what are you trying to accomplish and the consequences.
  #
  # The primary way of configuring a node is via this file. This template lists
  # the most important settings you may want to configure for a production cluster.
  #
  # Please see the documentation for further information on configuration options:
  # &lt;http://www.elastic.co/guide/en/elasticsearch/reference/current/setup-configuration.html&gt;
  #
  # ---------------------------------- Cluster -----------------------------------
  #
  # Use a descriptive name for your cluster:
  #
   cluster.name: ers-reseller-data
  #
  # ------------------------------------ Node ------------------------------------
  #
  # Use a descriptive name for the node:
  #
   node.name: node-1
  #
  # Add custom attributes to the node:
  
   node.master: true
  # node.client: true
   node.data: true
  
  # node.rack: r1
  #
  # ----------------------------------- Paths ------------------------------------
  #
  # Path to directory where to store the data (separate multiple locations by comma):
  #
  # path.data: /opt/seamless/etc/dist/core/database/elasticsearch
  #
  # Path to log files:
  #
  # path.logs: /path/to/logs
  #
  # ----------------------------------- Memory -----------------------------------
  #
  # Lock the memory on startup:
   bootstrap.memory_lock: true
   bootstrap.system_call_filter: false
  #
  # Make sure that the `ES_HEAP_SIZE` environment variable is set to about half the memory
  # available on the system and that the owner of the process is allowed to use this limit.
  #
  # Elasticsearch performs poorly when the system is swapping the memory.
  #
  # ---------------------------------- Network -----------------------------------
  #
  # Set the bind address to a specific IP (IPv4 or IPv6):
  #
   network.host: 0.0.0.0
   cluster.initial_master_nodes: node-1
  #
  # Set a custom port for HTTP:
  #
   http.port: 9200
  #
  # For more information, see the documentation at:
  # &lt;http://www.elastic.co/guide/en/elasticsearch/reference/current/modules-network.html&gt;
  #
  # --------------------------------- Discovery ----------------------------------
  #
  # Pass an initial list of hosts to perform discovery when new node is started:
  # The default list of hosts is ["127.0.0.1", "[::1]"]
  #
  #discovery.zen.ping.unicast.hosts: ["node-1", "node-2", "node-3"]
  #
  # Prevent the "split brain" by configuring the majority of nodes (total number of nodes / 2 + 1):
  #
  # discovery.zen.minimum_master_nodes: 3
  #
  # For more information, see the documentation at:
  # &lt;http://www.elastic.co/guide/en/elasticsearch/reference/current/modules-discovery.html&gt;
  #
  # ---------------------------------- Gateway -----------------------------------
  #
  # Block initial recovery after a full cluster restart until N nodes are started:
  #
  # gateway.recover_after_nodes: 3
  #
  # For more information, see the documentation at:
  # &lt;http://www.elastic.co/guide/en/elasticsearch/reference/current/modules-gateway.html&gt;
  #
  # ---------------------------------- Various -----------------------------------
  #
  # Disable starting multiple nodes on a single system:
  #
   node.max_local_storage_nodes: 2
  #
  # Require explicit names when deleting indices:
  #
  # action.destructive_requires_name: true
  #node.local: true
  # discovery.zen.ping.multicast.enabled: false
  # discovery.zen.ping.unicast.hosts: ["node-1"]
  </code></pre>
  
  <p>When I execute the <code>curl 'http://locahost:9200'</code> it shows the following output which means the node is up and running</p>
  
  <pre><code>{
    "name" : "node-1",
    "cluster_name" : "ers-reseller-data",
    "version" : {
      "number" : "2.2.0",
      "build_hash" : "8ff36d139e16f8720f2947ef62c8167a888992fe",
      "build_timestamp" : "2016-01-27T13:32:39Z",
      "build_snapshot" : false,
      "lucene_version" : "5.4.1"
    },
    "tagline" : "You Know, for Search"
  }
  </code></pre>
  
  <p>while executing the <code>curl 'http://localhost:9200/_nodes'</code> it also shows the detail about the available nodes. But when I tried to connect execute with <code>Java</code> code it shows the following exception.</p>
  
  <p><strong>Exception:</strong></p>
  
  <pre><code>java.lang.Exception: NoNodeAvailableException[None of the configured nodes are available: [{#transport#-1}{Ntvnz9ljSha0lZ7-2d3VGQ}{localhost}{127.0.0.1:9200}]]
      at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
      at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
      at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
      at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
      at org.codehaus.groovy.reflection.CachedConstructor.invoke(CachedConstructor.java:83)
      at org.codehaus.groovy.runtime.callsite.ConstructorSite$ConstructorSiteNoUnwrapNoCoerce.callConstructor(ConstructorSite.java:105)
      at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallConstructor(CallSiteArray.java:60)
      at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:235)
      at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:247)
      at se.seamless.mcs.profilingsystem.services.impl.ElasticSearchSalesDataService.findCreditScoreMetrics(ElasticSearchSalesDataService:79)
      at se.seamless.mcs.profilingsystem.services.SalesDataService$findCreditScoreMetrics.call(Unknown Source)
      at o
  </code></pre>
  
  <p>Please guide me what I'm missing or doing wrong and why it's throwing No available node exception. Thanks</p>