# Force replication

**URL:** https://discuss.elastic.co/t/force-replication/254429
**Category:** Elasticsearch
**Created:** [November 5, 2020, 2:55pm UTC](https://discuss.elastic.co/t/force-replication/254429 "2020-11-05T14:55:21Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![vincent2mots](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vincent2mots/32/55226_2.png) [@vincent2mots](https://discuss.elastic.co/u/vincent2mots)
#### Post date: [November 5, 2020, 2:55pm UTC](https://discuss.elastic.co/t/force-replication/254429/1 "2020-11-05T14:55:22Z")

</div>

Hi there!

I started a new fresh Elasticsearch (7.9) cluster with sample flights data.

If I look up for the "number\_of\_replicas" setting of this index, I get 1. And, if I try to use the cat/shards API, I see one primary replicas one of my nodes and the other replica on other node.

Now, I want to modify the number\_of\_replicas from 1 to 2. When I do so, everything seems fine but I was excepting, into the /cat/shards API, to see a new replica and it's not the case.

Did I misunderstood the concept of replicas? Or maybe there is some time between the change of parameter and the moment the data is actually replicated?

Best regards,

---

<div class="post-metadata">

### Author: ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)
#### Post date: [November 5, 2020, 3:19pm UTC](https://discuss.elastic.co/t/force-replication/254429/2 "2020-11-05T15:19:54Z")

</div>

You can never have more than one copy of a shard (primary/replica) per node so it will depend on the number of data nodes you have in the cluster.

---

<div class="post-metadata">

### Author: ![vincent2mots](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vincent2mots/32/55226_2.png) [@vincent2mots](https://discuss.elastic.co/u/vincent2mots)
#### Post date: [November 5, 2020, 3:33pm UTC](https://discuss.elastic.co/t/force-replication/254429/3 "2020-11-05T15:33:02Z")

</div>

I have 4 data nodes in my cluster

---

<div class="post-metadata">

### Author: ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)
#### Post date: [November 5, 2020, 3:44pm UTC](https://discuss.elastic.co/t/force-replication/254429/4 "2020-11-05T15:44:14Z")

</div>

Can you share the output and how you changed the setting?

---

<div class="post-metadata">

### Author: ![vincent2mots](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vincent2mots/32/55226_2.png) [@vincent2mots](https://discuss.elastic.co/u/vincent2mots)
#### Post date: [November 5, 2020, 8:10pm UTC](https://discuss.elastic.co/t/force-replication/254429/5 "2020-11-05T20:10:50Z")

</div>

Thanks for the idea!!

The problem was the command I used to change the number of replicas

Instead of :

> PUT /kibana\_sample\_data\_ecommerce/\_settings  
> {  
> "index" : {  
> "number\_of\_replicas" : 2  
> }  
> }

I had to use:

> PUT /kibana\_sample\_data\_ecommerce/\_settings  
> {  
> "index" : {  
> "number\_of\_replicas" : 2,  
> **"auto\_expand\_replicas": false**  
> }  
> }

Now it's better!

---

<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: [December 3, 2020, 8:10pm UTC](https://discuss.elastic.co/t/force-replication/254429/6 "2020-12-03T20:10:54Z")

</div>

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