# Scale down production cluster

**URL:** <https://discuss.elastic.co/t/scale-down-production-cluster/223374>\
**Category:** Elasticsearch\
**Created:** [March 12, 2020, 3:50pm UTC](https://discuss.elastic.co/t/scale-down-production-cluster/223374 "2020-03-12T15:50:35Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![royal\_man](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/royal_man/32/67426_2.png) [@royal\_man](https://discuss.elastic.co/u/royal_man)\
**Post date:** [March 12, 2020, 3:50pm UTC](https://discuss.elastic.co/t/scale-down-production-cluster/223374/1 "2020-03-12T15:50:36Z")

</div>

I want the opinion about scaling down elasticsearch.

I have 2 shard cluster having 2 replicas (2P + 4R = 6shards) running on kubernetes. Now I want to remove replicas and corresponding nodes. I reduced kubernetes deployment pods but sometimes it deletes nodes having Primary replicas.

How to handle this scenario ? What is your opinion on following approach:

1. Get nodes that have primary shards using `/_cat/shards` api.
2. Reduce nodes and during the graceful shutdown, if kubernetes deletes nodes with primary then move the primary shards using `_cluster/reroute` api. [https://www.elastic.co/guide/en/elasticsearch/reference/6.8/cluster-reroute.html](https://www.elastic.co/guide/en/elasticsearch/reference/6.8/cluster-reroute.html)

During shutdown of a node, I already decommission node as a part of shut down.

Any help is appreciated.  
Thanks

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [April 9, 2020, 3:58pm UTC](https://discuss.elastic.co/t/scale-down-production-cluster/223374/2 "2020-04-09T15:58:04Z")

</div>

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