# ES Index creation: discrepancy in no. of primary/replica shards

**URL:** https://discuss.elastic.co/t/es-index-creation-discrepancy-in-no-of-primary-replica-shards/60394
**Category:** Elasticsearch
**Created:** [September 13, 2016, 2:58pm UTC](https://discuss.elastic.co/t/es-index-creation-discrepancy-in-no-of-primary-replica-shards/60394 "2016-09-13T14:58:53Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![dimalini](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dimalini/32/22448_2.png) [@dimalini](https://discuss.elastic.co/u/dimalini)
#### Post date: [September 13, 2016, 2:58pm UTC](https://discuss.elastic.co/t/es-index-creation-discrepancy-in-no-of-primary-replica-shards/60394/1 "2016-09-13T14:58:53Z")

</div>

Hi,  
We are currently using ES 1.7. We have appropriate setting file where the no.of primary/replica shards count are read from and ES indices are created accordingly.

In one rare occurrence in our production, we found there was 1 index which was created with different primary/replica shards ,than what was mentioned in the setting(i couldn't repro it locally in my machine thou).

Is this any known issue? Could someone state the possibility or the reason why this might have happened?

Thanks, Divya

---

<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: [September 15, 2016, 1:42am UTC](https://discuss.elastic.co/t/es-index-creation-discrepancy-in-no-of-primary-replica-shards/60394/2 "2016-09-15T01:42:42Z")

</div>

If an index is created via the APIs and specifies a different number of shards than the settings, whatever is specified in the API call will take precedence.

---

<div class="post-metadata">

### Author: ![dimalini](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dimalini/32/22448_2.png) [@dimalini](https://discuss.elastic.co/u/dimalini)
#### Post date: [September 15, 2016, 5:27am UTC](https://discuss.elastic.co/t/es-index-creation-discrepancy-in-no-of-primary-replica-shards/60394/3 "2016-09-15T05:27:29Z")

</div>

Agree, we use APIs for index creation and that's exactly why i dont get the reason behind a single index alone showing a discrepancy whereas others are created as specified in the settings.

Not sure if it is possibly timing issue ?

---

<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: [September 15, 2016, 5:36am UTC](https://discuss.elastic.co/t/es-index-creation-discrepancy-in-no-of-primary-replica-shards/60394/4 "2016-09-15T05:36:47Z")

</div>

No, ES has created what was requested of it.

---

<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, 10:20pm UTC](https://discuss.elastic.co/t/es-index-creation-discrepancy-in-no-of-primary-replica-shards/60394/5 "2017-07-05T22:20:06Z")

</div>


