Closing node

Hi,

I want to close node, and want elastic to move his to different node.
What is the procedure for closing node? How it can be done automatically?

Thanks.

If you mean that you want to remove a node from a cluster. All that should need to be done is:

  1. Ensure you have another node in the cluster that can take over the load of the current cluster
  2. Ensure that any data on the node you're removing has at least 1 replica on a different node
  3. Shutdown the node you want to remove from the cluster

Elasticsearch should automatically handle re-distributing data across the remaining nodes in the cluster.

(The above assumes you're on an actively supported version of Elasticsearch, as this might not be true for older versions)

You need to exclude the node from shard allocation so the shards allocated on this node will move to other nodes.

To do that you need to have enough space in other nodes to store the shards currently on the nodes you want to exclude.

This is the documentation about cluster allocation.

You basically need to run this request and wait for the shards to be moved out from the node:

PUT _cluster/settings
{
  "persistent" : {
    "cluster.routing.allocation.exclude._ip" : "node-ip-address"
  }
}
2 Likes

I am not using replicas.
I am closing the node by pkill -F pid.
After doing it I am getting RED health with unassigned shards. I want to avoid it.

Check my previous answer, you need to remove the node from shard allocation, after the node has no more shards you can shutdown it.

1 Like

How can I do it?

Please, read the previous answer and check the linked documentation, the answer is there.

Thanks!

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