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 (192.168.20.100), and the hosts are configured in kibana.yml as follows.

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.

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

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

1 Like

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