Elasticsearch add node to cluster

Viewed 197

I have 3 node elasticsearch cluster

192.168.2.11 - node-01
192.168.2.12 - node-02
192.168.2.13 - node-03

and i deleted node-02 from cluster using this command

curl -XPUT 192.168.2.12:9200/_cluster/settings -H 'Content-Type: application/json' -d '{
  "transient" :{
      "cluster.routing.allocation.exclude._ip" : "192.168.2.12"
   }
}'

and ok, all my indexes moved to node-01 and node-03, but how to return back this node to the cluster? i try this command

curl -XPUT 192.168.2.12:9200/_cluster/settings -H 'Content-Type: application/json' -d '{
  "transient" :{
      "cluster.routing.allocation.include._ip" : "192.168.2.12"
   }
}'

but this doesn't works :"node does not cluster setting [cluster.routing.allocation.include] filters [_ip:\"192.168.2.12\"]

1 Answers

The node has not been deleted but you can 'undo' your command by updating the setting you changed to null

Try updating the settings on either of the running nodes (01 or 03) with

"transient" :{
  "cluster.routing.allocation.exclude._ip" : null
}

and the cluster should rebalance shards across the three nodes. Be careful using the include._ip: "192.168.2.12" as this might stop routing indices to the other two, instead include all three ip addresses if you wanted to us this, for example

"transient" :{
  "cluster.routing.allocation.include._ip" :"192.168.2.11, 192.168.2.12, 192.168.2.13"
}
Related