DBAtlas · Database operations atlas

Drain a node (decommission)

ElasticsearchCluster/Node

Command

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.

Open in DBAtlas →

Related