# Is there a way to automatically connect to another ES Node when the connected ES Node stops?

**URL:** <https://discuss.elastic.co/t/is-there-a-way-to-automatically-connect-to-another-es-node-when-the-connected-es-node-stops/296596>\
**Category:** Kibana\
**Created:** [February 8, 2022, 1:06pm UTC](https://discuss.elastic.co/t/is-there-a-way-to-automatically-connect-to-another-es-node-when-the-connected-es-node-stops/296596 "2022-02-08T13:06:55Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Simon\_Benjamin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/simon_benjamin/32/101528_2.png) [@Simon\_Benjamin](https://discuss.elastic.co/u/Simon_Benjamin)\
**Post date:** [February 8, 2022, 1:06pm UTC](https://discuss.elastic.co/t/is-there-a-way-to-automatically-connect-to-another-es-node-when-the-connected-es-node-stops/296596/1 "2022-02-08T13:06:55Z")

</div>

Hi all.

There are three ES Nodes, each of which is a master eligible node.

Kibana is connected to one of them (192.168.20.100), and the hosts are configured in kibana.yml as follows.

```auto
elasticsearch.hosts: ["http://192.168.20.100:9200", "http://192.168.21.100:9200", "http://192.168.22.100:9200"]

```

When I kill the es process on 192.168.20.100, kibana gives me the following error.

```auto
{
  "statusCode": 500,
  "error": "Internal Server Error",
  "message": "An internal server error occurred"
}

```

/var/log/kibana/kibana.log contains the following log.

```auto
{"type": "log","@timestamp": "2022-02-08T11:28:14Z", "tags":["error", "elasticsearch", "admin"], "pid":13806, "message": "Request error, retrying\nPOST http://192.168.20.100:9200/_monitoring/bulk?system_id=kibana&system_api_version=6&interval=10000ms => connect ECONNREFUSED 192.168.20.100:9200"}

```

I thought ideally it would automatically reconnect to the other ES Node, is it possible to make it behave that way?

I thought sniffing would accomplish that, but it doesn't work. Is this a misunderstanding??

> **[Configure Kibana | Kibana Guide \[7.17\] | Elastic](https://www.elastic.co/guide/en/kibana/current/settings.html#:~:text=elasticsearch.sniffOnConnectionFault:)**
>
> A reference of the reporting settings administrators configure in kibana.yml.

---

<div class="post-metadata">

**Author:** ![LeeDr](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leedr/32/9289_2.png) [@LeeDr](https://discuss.elastic.co/u/LeeDr)\
**Post date:** [February 22, 2022, 8:10pm UTC](https://discuss.elastic.co/t/is-there-a-way-to-automatically-connect-to-another-es-node-when-the-connected-es-node-stops/296596/2 "2022-02-22T20:10:12Z")

</div>

You didn't show the rest of your kibana.yml. Are you setting `elasticsearch.sniffOnConnectionFault:`? I think you need to set that to true and also `elasticsearch.sniffOnStart:`. Do you have `elasticsearch.sniffInterval:` set?

If you don't have sniffInterval set, I think you would have to hit an error for Kibana to know to switch to a different Elasticsearch host. After hitting the error, can you refresh Kibana and it works with a different node from your list of hosts?

Regards,  
Lee

---

<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:** [March 22, 2022, 8:10pm UTC](https://discuss.elastic.co/t/is-there-a-way-to-automatically-connect-to-another-es-node-when-the-connected-es-node-stops/296596/3 "2022-03-22T20:10:39Z")

</div>

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