# Changing number of replicas

**URL:** https://discuss.elastic.co/t/changing-number-of-replicas/188740
**Category:** Elasticsearch
**Created:** [July 3, 2019, 2:20pm UTC](https://discuss.elastic.co/t/changing-number-of-replicas/188740 "2019-07-03T14:20:55Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![zatom](https://avatars.discourse-cdn.com/v4/letter/z/f0a364/32.png) [@zatom](https://discuss.elastic.co/u/zatom)
#### Post date: [July 3, 2019, 2:20pm UTC](https://discuss.elastic.co/t/changing-number-of-replicas/188740/1 "2019-07-03T14:20:55Z")

</div>

Hi, I am trying to reindex huge index using reindex api. It fails everytime. Now, I am thinking if I can initially make the number of replica to 0 and later to 1. Is it possible with my case? How do I do it?  
Do I set the replica to 0 at the time of setting mapping for new index? And when and how to make it back to 1 later?

---

<div class="post-metadata">

### Author: ![jiouser](https://avatars.discourse-cdn.com/v4/letter/j/e99b99/32.png) [@jiouser](https://discuss.elastic.co/u/jiouser)
#### Post date: [July 3, 2019, 7:18pm UTC](https://discuss.elastic.co/t/changing-number-of-replicas/188740/2 "2019-07-03T19:18:27Z")

</div>

HI @zatom

You can change the replica of an index dynamically by firing the query from Kibana.  
Since you are reindexing huge data it is advisable you set replica to 0. Once you create the index, use the

> PUT indexname/\_settings {"number\_of\_replica":0}

to set replica as 0 for the index. Once you are done with indexing, replace 0 with 1.  
Also, it is advisable that you disable refresh during the bulk indexing so that you get maximum throughput. Once done, you can set refresh interval to whatever time is acceptable to you.  
Keep an eye on Heap usage as well as Bulk Thread Pool for data nodes.

---

<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 31, 2019, 7:18pm UTC](https://discuss.elastic.co/t/changing-number-of-replicas/188740/3 "2019-07-31T19:18:34Z")

</div>

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