Skip to content

NoNodeAvailableException : None of the configured nodes are available

I’m trying to search from Elastic Search within my Java Web Service, here’s how I use now :

    Client client = new PreBuiltTransportClient(Settings.EMPTY).addTransportAddress(new InetSocketTransportAddress(InetAddress.getByName(""), 9200));
    SearchResponse searchResponse = client.prepareSearch().execute().actionGet();

The 1st line could work without an error, but when it goes to the 2nd line, the exception down below will occur :

NoNodeAvailableException[None of the configured nodes are available: [{#transport#-1}{TskPSVeBRR6CvCzP9EVhkQ}{}{}]]

No matter I use 9200 or 9300 to set the port, the results are the same.

Also, I’ve tried to search from my .Net program using NEST, and it run just fine. Here’s how I tried :

    var node = new Uri("");
    var settings = new ConnectionSettings(node).DefaultIndex("iod-2017.03.08.*");
    _EsClient = new ElasticClient(settings);
    var index = String.Format("iod-{0}.{1:00}.{2:00}.*", item.TriggerTime.Year, item.TriggerTime.Month, item.TriggerTime.Day);
    var uniqueId = item.UniqueId.ToString();
    var result = _EsClient.Search<logs>(s => s.Index(index).Query(q => q.Match(t => t.Field(l =>;

Did I do anything(Firewall, version of library, method to call the API, etc) wrong with my Java program? My current Java version is, the version of Elastic Search and Transport Client are both 5.2. Thanks!



As discussed in comments,

If you are using a cluster name other than elasticsearch, then you need to update the same in settings.

Settings settings = Settings.builder()
        .put("", "myClusterName").build();