# Index.number\_of\_replicas setting is not applied during ES startup

**URL:** https://discuss.elastic.co/t/index-number-of-replicas-setting-is-not-applied-during-es-startup/281946
**Category:** Elasticsearch
**Created:** [August 19, 2021, 11:30am UTC](https://discuss.elastic.co/t/index-number-of-replicas-setting-is-not-applied-during-es-startup/281946 "2021-08-19T11:30:52Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Viktor\_H](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/viktor_h/32/93428_2.png) [@Viktor\_H](https://discuss.elastic.co/u/Viktor_H)
#### Post date: [August 19, 2021, 11:30am UTC](https://discuss.elastic.co/t/index-number-of-replicas-setting-is-not-applied-during-es-startup/281946/1 "2021-08-19T11:30:52Z")

</div>

I have a question regarding index.number\_of\_replicas setting in elasticsearch.yml. I'm using elastisearch 2.4. Let me explain the situation. I mirror the ES index from single (PROD) node into 3 nodes, which together form a 3 node cluster. To ensure resilience I configured each node via elasticsearch.yml to contain:

```auto
index.number_of_shards: 1
index.number_of_replicas: 2

```

The problem is after I start up the cluster, replicas are not being created.

```auto
index shard prirep state docs store ip node
searchables_c-03_production_cplace 0 p STARTED 87920 408mb 10.96.63.251 ES1
searchables_c-01_production_cplace 0 p STARTED 12498936 293.4gb 10.96.63.148 ES2
searchables_c-02_production_cplace 0 p STARTED 530056 4gb 10.96.63.248 ES3

```

How can I ensure replica creation is issued at startup?  
When I use API, replicas are being created:

```auto
curl http://10.96.63.248:9200/_cat/shards?v

index shard prirep state docs store ip node
searchables_c-03_production_cplace 0 p STARTED 87920 408mb 10.96.63.251 ES1
searchables_c-03_production_cplace 0 r INITIALIZING 10.96.63.148 ES2
searchables_c-03_production_cplace 0 r INITIALIZING 10.96.63.248 ES3
searchables_c-01_production_cplace 0 r INITIALIZING 10.96.63.251 ES1
searchables_c-01_production_cplace 0 p STARTED 12498936 293.4gb 10.96.63.148 ES2
searchables_c-01_production_cplace 0 r INITIALIZING 10.96.63.248 ES3
searchables_c-02_production_cplace 0 r INITIALIZING 10.96.63.251 ES1
searchables_c-02_production_cplace 0 r INITIALIZING 10.96.63.148 ES2
searchables_c-02_production_cplace 0 p STARTED 530056 4gb 10.96.63.248 ES3

```

---

<div class="post-metadata">

### Author: ![Viktor\_H](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/viktor_h/32/93428_2.png) [@Viktor\_H](https://discuss.elastic.co/u/Viktor_H)
#### Post date: [September 9, 2021, 6:17am UTC](https://discuss.elastic.co/t/index-number-of-replicas-setting-is-not-applied-during-es-startup/281946/2 "2021-09-09T06:17:22Z")

</div>

Can anyone help?

---

<div class="post-metadata">

### Author: ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)
#### Post date: [September 9, 2021, 6:37am UTC](https://discuss.elastic.co/t/index-number-of-replicas-setting-is-not-applied-during-es-startup/281946/3 "2021-09-09T06:37:31Z")

</div>

2.4 is EOL for years now.

It's super urgent that you upgrade to 7.14.1. 8.0.0-alpha1 has been released as well.

In those versions, setting the number of shards in `elasticsearch.yml` is not supported anymore.  
Instead you should use index templates.

---

<div class="post-metadata">

### Author: ![Viktor\_H](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/viktor_h/32/93428_2.png) [@Viktor\_H](https://discuss.elastic.co/u/Viktor_H)
#### Post date: [September 9, 2021, 6:43am UTC](https://discuss.elastic.co/t/index-number-of-replicas-setting-is-not-applied-during-es-startup/281946/4 "2021-09-09T06:43:20Z")

</div>

Thank you for the answer. I'm forced to use 2.4 as this is the version which is supported by the application. I will use API to trigger replication for now. There will be application upgrade later on this year, and with that new ES 7 come into the game.

---

<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: [October 7, 2021, 7:01am UTC](https://discuss.elastic.co/t/index-number-of-replicas-setting-is-not-applied-during-es-startup/281946/6 "2021-10-07T07:01:16Z")

</div>

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