How to properly remove or decommission a node from an Elasticsearch cluster? - Big Data In Real World

How to properly remove or decommission a node from an Elasticsearch cluster?

How to rename an S3 bucket?
April 20, 2023
How to transpose a DataFrame from columns to rows in Spark?
April 27, 2023
How to rename an S3 bucket?
April 20, 2023
How to transpose a DataFrame from columns to rows in Spark?
April 27, 2023

Shutting down a node abruptly is not the right way to decommission or remove a node from the Elasticsearch cluster. Doing so will cause your shards which are replicated to go down in replication and it could cause disruption to the clients who are currently consuming data from Elasticsearch.

Proper way to decommission or remove a node from Elasticsearch is to add the host to the exclusion list.

Adding a node to the exclusion list

Issue the below PUT on _cluster/settings with the cluster.routing.allocation.exclude._ip property along with the IP address of the host you want to exclude.

This will cause Elasticsearch to allocate the shards on that node to the remaining nodes at the same time, not abruptly crashing the clients consuming data from the node.

Once all the shards have been reallocated we can shutdown the node.

curl -X PUT "localhost:9200/_cluster/settings?pretty" -H 'Content-Type: application/json' -d'
{
  "transient" : {
    "cluster.routing.allocation.exclude._ip" : "178.2.3.1"
  }
}'

If we have multiple IPs to exclude we can use a wildcard in the exclusion IPs.

Big Data In Real World
Big Data In Real World
We are a group of Big Data engineers who are passionate about Big Data and related Big Data technologies. We have designed, developed, deployed and maintained Big Data applications ranging from batch to real time streaming big data platforms. We have seen a wide range of real world big data problems, implemented some innovative and complex (or simple, depending on how you look at it) solutions.

1 Comment

  1. […] The Big Data in Real World team spams the delete button: […]

How to properly remove or decommission a node from an Elasticsearch cluster?
This website uses cookies to improve your experience. By using this website you agree to our Data Protection Policy.

Hadoop In Real World is now Big Data In Real World!

X