Connecting ES using RestHighLevelClient


(Ramkumar Pillai) #1
for (int i = 0; i < hostNames.length; i++) {
        HttpHost host = new HttpHost(hostNames[i] , 9200, "index_name"); 
        hosts[i] = host;
 }
RestHighLevelClient client = new RestHighLevelClient(RestClient.builder(hosts ));

i'm obtaining client using the above code snippet, it works fine when all nodes are available.

it is failing if any one of the node is down.

any solution to handle this situation ?


(Luca Cavanna) #2

Does it fail at initialization or when you send a request? Which version are you on? Can you please post the error you get?


(Neha Goswami) #3

In which jar are you getting RestHighLevelClient class file?
i m using 5.6 version restClient and i am not getting to use this class "RestHighLevelClient".


(system) #4

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.