Question

I am trying to implement elasticsearch cluster. I have 2 machines with 2 nodes each. I have following configuration in yml file. I have given unique node name on each node, all of them are master and data nodes.

cluster.name: elasticsearch
node.master: true
node.data: true
discovery.zen.ping.multicast.enabled: false
discovery.zen.ping.unicast.hosts: ["machine1", "machine2"]
discovery.zen.minimum_master_nodes: 3

the four nodes are working correctly in the cluster. I would like to bring one of the nodes down, and have other 3 run in the cluster. When I try to bring one of first three, cluster goes down, I get this error

{
   "error": "ClusterBlockException[blocked by: [SERVICE_UNAVAILABLE/1/state not recovered / initialized];]",
   "status": 503
}

If I bring down the last node that joined cluster, the cluster works fine. my understanding is, if I have 4 masters and one of the master (any) goes down, other three masters should run in the cluster. is there any issue with my configuration?

Was it helpful?

Solution

If you are running to nodes on one machine, it is probably better to add ports to your configuration.

 discovery.zen.ping.unicast.hosts: ["machine1:9300", "machine2:9300", "machine2:9301"]

Than also configure the ports yourself so you know which node has which port:

 transport.tcp.port: 9300
 http.port: 9200
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top