简体   繁体   中英

Elasticsearch cluster nodes , to which node need to connect?

We have elasticsearch cluster with three nodes. Now all are connected each other and each have it's own public IPS too. From curl commands it's working fine. In our program which running on a different network, need to connect with cluster. It's working when we connect with anyone of the nodes. It seems to be connected node is master.

Now suppose the connected master node fails because of hardware failure or any similar issue... Then how can my program reach to the cluster?

You can use any of the below two ways :

  1. Manual way: On master failure, elasticsearch would designate another node as a master. You can manually change in you client to point to the new node.

  2. Sniffing: Elasticsearch provides the sniffing functionality. eg: If you are using a TransportClient in java, you can provide a list of nodes and it can connect to the available node.

Hope it helps!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM