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

Hi all.

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

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

elasticsearch.hosts: ["", "", ""]

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

  "statusCode": 500,
  "error": "Internal Server Error",
  "message": "An internal server error occurred"

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

{"type": "log","@timestamp": "2022-02-08T11:28:14Z", "tags":["error", "elasticsearch", "admin"], "pid":13806, "message": "Request error, retrying\nPOST => connect ECONNREFUSED"}

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??

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?


1 Like

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