# Creating Replicas

**URL:** <https://discuss.elastic.co/t/creating-replicas/11649>\
**Category:** Elasticsearch\
**Created:** [April 20, 2013, 3:57am UTC](https://discuss.elastic.co/t/creating-replicas/11649 "2013-04-20T03:57:23Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ben\_Timby](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ben_timby/32/2371_2.png) [@Ben\_Timby](https://discuss.elastic.co/u/Ben_Timby)\
**Post date:** [April 20, 2013, 3:57am UTC](https://discuss.elastic.co/t/creating-replicas/11649/1 "2013-04-20T03:57:23Z")

</div>

I had a failure of a couple nodes in my 3 node cluster. After recovering  
only two replicas remained for my 12 shards.

I updated the replica count to 0 (which deleted these replicas), then  
updated it to 1 again. The hope was that this would restore replicas for  
all 12 shards.

So far, no new replicas have been created, I don't see anything in the log  
files about performing replication or anything. Is my expectation that  
increasing the replica count from 0 to 1 would create replias misguided?  
How can I get more information about replication, to see if the process is  
running?

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Ben\_Timby](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ben_timby/32/2371_2.png) [@Ben\_Timby](https://discuss.elastic.co/u/Ben_Timby)\
**Post date:** [April 22, 2013, 3:03pm UTC](https://discuss.elastic.co/t/creating-replicas/11649/2 "2013-04-22T15:03:00Z")

</div>

Does anybody know if increasing the replica count of an index should start  
creating replicas? If it should, does anybody know how to find out why this  
does not work? The log file for the index  
(/var/log/elasticsearch/index\_name.log) is unhelpful.

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Itamar\_Syn\_Hershko](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/itamar_syn_hershko/32/725_2.png) [@Itamar\_Syn\_Hershko](https://discuss.elastic.co/u/Itamar_Syn_Hershko)\
**Post date:** [April 22, 2013, 4:36pm UTC](https://discuss.elastic.co/t/creating-replicas/11649/3 "2013-04-22T16:36:17Z")

</div>

Yes. Is the cluster in red state?

On Mon, Apr 22, 2013 at 6:03 PM, Ben Timby [btimby@gmail.com](mailto:btimby@gmail.com) wrote:

> Does anybody know if increasing the replica count of an index should start  
> creating replicas? If it should, does anybody know how to find out why this  
> does not work? The log file for the index  
> (/var/log/elasticsearch/index\_name.log) is unhelpful.
> 
> --  
> You received this message because you are subscribed to the Google Groups  
> "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Ben\_Timby](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ben_timby/32/2371_2.png) [@Ben\_Timby](https://discuss.elastic.co/u/Ben_Timby)\
**Post date:** [April 22, 2013, 4:45pm UTC](https://discuss.elastic.co/t/creating-replicas/11649/4 "2013-04-22T16:45:33Z")

</div>

Itamar, thank you for your reply!

On Mon, Apr 22, 2013 at 12:36 PM, Itamar Syn-Hershko [itamar@code972.com](mailto:itamar@code972.com)wrote:

> Yes. Is the cluster in red state?

Cluster state is yellow. All primary shards exist.

If I issue:

$ curl -XPUT [http://localhost:9200/documents/\_settings](http://localhost:9200/documents/_settings) -d '{  
"index.number\_of\_replicas": 0 }'

The state becomes green. If I then do:

$ curl -XPUT [http://localhost:9200/documents/\_settings](http://localhost:9200/documents/_settings) -d '{  
"index.number\_of\_replicas": 1 }'

The state goes back to yellow and besides the following log entry, nothing  
else happens.

[2013-04-22 12:39:41,030][INFO][cluster.metadata] [Lexington,  
Alexander] updating number\_of\_replicas to [1] for indices [documents]

I just upgraded to 0.20.6 (from 0.20.3) for all nodes and see the same  
behavior. I would expect ES to get busy replicating after setting replica  
count to 1.

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Itamar\_Syn\_Hershko](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/itamar_syn_hershko/32/725_2.png) [@Itamar\_Syn\_Hershko](https://discuss.elastic.co/u/Itamar_Syn_Hershko)\
**Post date:** [April 22, 2013, 4:50pm UTC](https://discuss.elastic.co/t/creating-replicas/11649/5 "2013-04-22T16:50:00Z")

</div>

Do you have any shard allocation rules in place? maybe that prevents the  
replica from being assigned

On Mon, Apr 22, 2013 at 7:45 PM, Ben Timby [btimby@gmail.com](mailto:btimby@gmail.com) wrote:

> Itamar, thank you for your reply!
> 
> On Mon, Apr 22, 2013 at 12:36 PM, Itamar Syn-Hershko [itamar@code972.com](mailto:itamar@code972.com)wrote:
> 
> > Yes. Is the cluster in red state?
> 
> Cluster state is yellow. All primary shards exist.
> 
> If I issue:
> 
> $ curl -XPUT [http://localhost:9200/documents/\_settings](http://localhost:9200/documents/_settings) -d '{  
> "index.number\_of\_replicas": 0 }'
> 
> The state becomes green. If I then do:
> 
> $ curl -XPUT [http://localhost:9200/documents/\_settings](http://localhost:9200/documents/_settings) -d '{  
> "index.number\_of\_replicas": 1 }'
> 
> The state goes back to yellow and besides the following log entry, nothing  
> else happens.
> 
> [2013-04-22 12:39:41,030][INFO][cluster.metadata] [Lexington,  
> Alexander] updating number\_of\_replicas to [1] for indices [documents]
> 
> I just upgraded to 0.20.6 (from 0.20.3) for all nodes and see the same  
> behavior. I would expect ES to get busy replicating after setting replica  
> count to 1.
> 
> --  
> You received this message because you are subscribed to the Google Groups  
> "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Ben\_Timby](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ben_timby/32/2371_2.png) [@Ben\_Timby](https://discuss.elastic.co/u/Ben_Timby)\
**Post date:** [April 22, 2013, 5:09pm UTC](https://discuss.elastic.co/t/creating-replicas/11649/6 "2013-04-22T17:09:13Z")

</div>

Itamar,

On Mon, Apr 22, 2013 at 12:50 PM, Itamar Syn-Hershko [itamar@code972.com](mailto:itamar@code972.com)wrote:

> Do you have any shard allocation rules in place? maybe that prevents the  
> replica from being assigned

Indeed. The cluster was lopsided a while back and I set:

$ curl -XPUT [http://localhost:9200/documents/\_settings](http://localhost:9200/documents/_settings) -d '{  
"index.routing.allocation.total\_shards\_per\_node": "4" }'

Which is enough for the primaries, but not the replicas, I had no clue this  
applied to both shard types (but it makes sense that it does).

I set this to 8 and replicas started popping up. How can I remove this  
setting altogether (go back to the default)?

$ curl -XPUT [http://localhost:9200/documents/\_settings](http://localhost:9200/documents/_settings) -d '{  
"index.routing.allocation.total\_shards\_per\_node": "8" }'

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Itamar\_Syn\_Hershko](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/itamar_syn_hershko/32/725_2.png) [@Itamar\_Syn\_Hershko](https://discuss.elastic.co/u/Itamar_Syn_Hershko)\
**Post date:** [April 22, 2013, 5:22pm UTC](https://discuss.elastic.co/t/creating-replicas/11649/7 "2013-04-22T17:22:39Z")

</div>

I recall the docs stating 0 would reset that  
On Apr 22, 2013 8:09 PM, "Ben Timby" [btimby@gmail.com](mailto:btimby@gmail.com) wrote:

> Itamar,
> 
> On Mon, Apr 22, 2013 at 12:50 PM, Itamar Syn-Hershko [itamar@code972.com](mailto:itamar@code972.com)wrote:
> 
> > Do you have any shard allocation rules in place? maybe that prevents the  
> > replica from being assigned
> 
> Indeed. The cluster was lopsided a while back and I set:
> 
> $ curl -XPUT [http://localhost:9200/documents/\_settings](http://localhost:9200/documents/_settings) -d '{  
> "index.routing.allocation.total\_shards\_per\_node": "4" }'
> 
> Which is enough for the primaries, but not the replicas, I had no clue  
> this applied to both shard types (but it makes sense that it does).
> 
> I set this to 8 and replicas started popping up. How can I remove this  
> setting altogether (go back to the default)?
> 
> $ curl -XPUT [http://localhost:9200/documents/\_settings](http://localhost:9200/documents/_settings) -d '{  
> "index.routing.allocation.total\_shards\_per\_node": "8" }'
> 
> --  
> You received this message because you are subscribed to the Google Groups  
> "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Ben\_Timby](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ben_timby/32/2371_2.png) [@Ben\_Timby](https://discuss.elastic.co/u/Ben_Timby)\
**Post date:** [April 22, 2013, 5:55pm UTC](https://discuss.elastic.co/t/creating-replicas/11649/8 "2013-04-22T17:55:33Z")

</div>

Itamar,

Thank you for your help!

On Mon, Apr 22, 2013 at 1:22 PM, Itamar Syn-Hershko [itamar@code972.com](mailto:itamar@code972.com)wrote:

> I recall the docs stating 0 would reset that

I checked before asking. The docs just say "Defaults to unbounded".

> **[Elasticsearch Platform — Find real-time answers at scale](https://www.elastic.co)**
>
> Power insights and outcomes with the Elasticsearch Platform and AI. See into your data and find answers that matter with enterprise solutions designed to help you build, observe, and protect. Try Elasticsearch free today.

I will try 0.

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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 6, 2017, 2:40am UTC](https://discuss.elastic.co/t/creating-replicas/11649/9 "2017-07-06T02:40:06Z")

</div>


