# Removing a node in a cluster?

**URL:** <https://forum.opensearch.org/t/removing-a-node-in-a-cluster/17998>\
**Category:** OpenSearch\
**Created:** [February 21, 2024, 11:17am UTC](https://forum.opensearch.org/t/removing-a-node-in-a-cluster/17998 "2024-02-21T11:17:42Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Yathus](https://avatars.discourse-cdn.com/v4/letter/y/b9e5f3/32.png) [@Yathus](https://forum.opensearch.org/u/Yathus)\
**Post date:** [February 21, 2024, 11:17am UTC](https://forum.opensearch.org/t/removing-a-node-in-a-cluster/17998/1 "2024-02-21T11:17:42Z")

</div>

**Versions** (relevant - OpenSearch/Dashboard/Server OS/Browser):

2.11.1

**Describe the issue** :

I have 3 nodes in my cluster and I want to replace each node one by one with a new, more powerful node.

I found this API in ElasticSearch : [Put shutdown API | Elasticsearch Guide [7.17] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/7.17/put-shutdown.html)

I didn’t find this endpoint in OpenSearch documentation, i try the call and i get a 405 error.

What is the recommended practice for deleting a node?

Thanks

---

<div class="post-metadata">

**Author:** ![AESthetix256](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.opensearch.org/aesthetix256/32/4680_2.png) [@AESthetix256](https://forum.opensearch.org/u/AESthetix256)\
**Post date:** [February 22, 2024, 12:39pm UTC](https://forum.opensearch.org/t/removing-a-node-in-a-cluster/17998/2 "2024-02-22T12:39:18Z")

</div>

Hello @Yathus,

I have not encountered your exact scenario yet but I think this article by Opster would help in your case: [How to Remove a Node from an Elasticsearch Cluster](https://opster.com/guides/elasticsearch/operations/elasticsearch-remove-node/)

This uses the `cluster.routing.allocation.exclude` cluster setting to drain a node of its stored shards so you could shut down a node safely ([Cluster settings - OpenSearch Documentation](https://opensearch.org/docs/latest/install-and-configure/configuring-opensearch/cluster-settings/))

I have not tried this on my test-setup but I think the workflow would look roughly like this:

1. Exclude the node from shard allocation
2. Power off the node
3. Upgrade to the more powerful HW/VM
4. Install OpenSearch and join the cluster
5. Enable shard allocation again
6. Wait until cluster health is Green again and repeat with the remaining nodes

BR,  
Andreas

---

<div class="post-metadata">

**Author:** ![Yathus](https://avatars.discourse-cdn.com/v4/letter/y/b9e5f3/32.png) [@Yathus](https://forum.opensearch.org/u/Yathus)\
**Post date:** [February 26, 2024, 3:32pm UTC](https://forum.opensearch.org/t/removing-a-node-in-a-cluster/17998/3 "2024-02-26T15:32:08Z")

</div>

Thanks Andreas, i followed your proces and it worked.

However, wouldn’t the API offered by ElasticSearch be welcome? I’m also thinking of node restart, for example.

---

<div class="post-metadata">

**Author:** ![AESthetix256](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.opensearch.org/aesthetix256/32/4680_2.png) [@AESthetix256](https://forum.opensearch.org/u/AESthetix256)\
**Post date:** [February 26, 2024, 4:03pm UTC](https://forum.opensearch.org/t/removing-a-node-in-a-cluster/17998/4 "2024-02-26T16:03:53Z")

</div>

Happy to hear that it worked @Yathus!

But yeah I agree, a similar API endpoint would definitely improve the workflow for your use-case - I just took a look at their github and it seems that there already exists an issue exactly for that: [Shutdown API for shutting down nodes in a safe manner · Issue #1304 · opensearch-project/OpenSearch · GitHub](https://github.com/opensearch-project/OpenSearch/issues/1304)

Also could you mark the previous answer as the solution? Just for this thread to be “done”.

BR,  
Andreas
