# Dynamically adding replicas to index

**URL:** <https://discuss.elastic.co/t/dynamically-adding-replicas-to-index/27133>\
**Category:** Elasticsearch\
**Created:** [August 10, 2015, 2:15pm UTC](https://discuss.elastic.co/t/dynamically-adding-replicas-to-index/27133 "2015-08-10T14:15:09Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pavel\_Pavelsky](https://avatars.discourse-cdn.com/v4/letter/p/c77e96/32.png) [@Pavel\_Pavelsky](https://discuss.elastic.co/u/Pavel_Pavelsky)\
**Post date:** [August 10, 2015, 2:15pm UTC](https://discuss.elastic.co/t/dynamically-adding-replicas-to-index/27133/1 "2015-08-10T14:15:09Z")

</div>

Is it possible to dynamically add as many replicas to my cluster as I want?  
My setup is: 1 index with 1 shard and 1 replica, and in case of high load I want to add more replicas to handle more requests. I don't know ahead how many replicas I will need.

For now I only see that I can define number of replicas when I create the index. I can also increase number of replicas using REST API, but I want to have it fully automatic, I can't have any steps before starting up a new server (I'm using Amazon's Autoscaling mechanism of EC2).

---

<div class="post-metadata">

**Author:** ![colings86](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/colings86/32/44960_2.png) [@colings86](https://discuss.elastic.co/u/colings86)\
**Post date:** [August 10, 2015, 2:25pm UTC](https://discuss.elastic.co/t/dynamically-adding-replicas-to-index/27133/2 "2015-08-10T14:25:57Z")

</div>

You can use the REST API as you mentioned to increase the number of replicas (or decrease it) dynamically, but you would need orchestration logic somewhere outside of Elasticsearch that determine that you need to scale up, provisions new VMs, installs Elasticsearch (may by using the puppet modules or chef cookbooks), starts Elasticsearch on your new VMs and then calls to the REST API to increase the number of replicas. You would also need similar logic to decommission nodes that you no longer require (basically do the reverse of above). This is all certainly possible but there is nothing currently in Elasticsearch to perform those steps for you.

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [August 10, 2015, 11:09pm UTC](https://discuss.elastic.co/t/dynamically-adding-replicas-to-index/27133/3 "2015-08-10T23:09:20Z")

</div>

You could probably build something with a Watcher webhook to do this.

---

<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:** [July 5, 2017, 11:56pm UTC](https://discuss.elastic.co/t/dynamically-adding-replicas-to-index/27133/4 "2017-07-05T23:56:33Z")

</div>


