# Advice on automatic failover in case of node failure

**URL:** <https://discuss.elastic.co/t/advice-on-automatic-failover-in-case-of-node-failure/134881>\
**Category:** Elasticsearch\
**Created:** [June 7, 2018, 3:18am UTC](https://discuss.elastic.co/t/advice-on-automatic-failover-in-case-of-node-failure/134881 "2018-06-07T03:18:49Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![kishoreji](https://avatars.discourse-cdn.com/v4/letter/k/e495f1/32.png) [@kishoreji](https://discuss.elastic.co/u/kishoreji)\
**Post date:** [June 7, 2018, 3:18am UTC](https://discuss.elastic.co/t/advice-on-automatic-failover-in-case-of-node-failure/134881/1 "2018-06-07T03:18:50Z")

</div>

Hi Experts,

I am first timer - created a HLRestClient to utilize BulkProcessor to push bulk data asynchronously to my cluster. Everything works great.

Details:  
node list is provided in prop file as below:  
el\_hosts=[node1.com](http://node1.com),[node2.com](http://node2.com),[node3.com](http://node3.com)

I loop though and prepare HttpHost list.  
for (int i = 0; i \< hostNames.length; i++) {  
HttpHost host = new HttpHost(hostNames[i]  
, port  
, scheme);  
hosts[i] = host;  
}

Finally the client:  
client = new RestHighLevelClient(  
RestClient.builder(  
hosts  
));

The problem I am facing is, if one of the node from the list, is down.. the HLRestClient is not able to option the connection at all.

How should I configure so that my client can manage to get master and push the data fro the list?

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [June 7, 2018, 5:18am UTC](https://discuss.elastic.co/t/advice-on-automatic-failover-in-case-of-node-failure/134881/2 "2018-06-07T05:18:27Z")

</div>

If the node is down, that's good IMO that the client refuses to start.  
I would only declare nodes that are actually running or I'd use the sniffer option to make that more dynamic.

---

<div class="post-metadata">

**Author:** ![kishoreji](https://avatars.discourse-cdn.com/v4/letter/k/e495f1/32.png) [@kishoreji](https://discuss.elastic.co/u/kishoreji)\
**Post date:** [June 11, 2018, 3:20am UTC](https://discuss.elastic.co/t/advice-on-automatic-failover-in-case-of-node-failure/134881/3 "2018-06-11T03:20:20Z")

</div>

Thanks for your reply David.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 9, 2018, 3:20am UTC](https://discuss.elastic.co/t/advice-on-automatic-failover-in-case-of-node-failure/134881/4 "2018-07-09T03:20:34Z")

</div>

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