Drain a node (decommission)
ElasticsearchCluster/NodeCommand
PUT /_cluster/settings
{
"persistent": {
"cluster.routing.allocation.exclude._name": "node-3"
}
}What it does
Safely drains the specified node by moving its shards to other nodes.
When to use it
To move a node's data off before taking it out of service.
Caution
Shard relocation creates heavy network/IO load; make sure the remaining nodes have enough disk and capacity. Remove the setting with null after the node is removed. transient settings are deprecated since 7.16; use persistent.