# Index dynamically created using Template ignores defined shards settings

**URL:** https://discuss.elastic.co/t/index-dynamically-created-using-template-ignores-defined-shards-settings/134295
**Category:** Elasticsearch
**Created:** [June 2, 2018, 6:35pm UTC](https://discuss.elastic.co/t/index-dynamically-created-using-template-ignores-defined-shards-settings/134295 "2018-06-02T18:35:38Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![patricio.gorin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/patricio.gorin/32/31865_2.png) [@patricio.gorin](https://discuss.elastic.co/u/patricio.gorin)
#### Post date: [June 2, 2018, 6:35pm UTC](https://discuss.elastic.co/t/index-dynamically-created-using-template-ignores-defined-shards-settings/134295/1 "2018-06-02T18:35:38Z")

</div>

Hi, I hope that anyone can help me with this issue.

I have a few indexes created using a Template (time-framed index pattern), defining 5 primary shards and 3 replicas. But for my surprise a few indexes (not all), have been dynamically created on the corresponding date but with just 1 primary shard an no replicas. Also I can see that the indexes contain the full mapping correctly and the alias given by the defined template.

I can not imagine a scenario where this can happen. Again, indexes have been created dynamically, not manually, respecting all the settings configured under template except for the shards settings (the only settings configured are number of shards and replicas).

I'm using ES v5.5, using docker under kubernetes environment.

---

<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: [June 2, 2018, 6:56pm UTC](https://discuss.elastic.co/t/index-dynamically-created-using-template-ignores-defined-shards-settings/134295/2 "2018-06-02T18:56:48Z")

</div>

May be you have multiple templates or you or something created an index "manually" with settings?

---

<div class="post-metadata">

### Author: ![patricio.gorin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/patricio.gorin/32/31865_2.png) [@patricio.gorin](https://discuss.elastic.co/u/patricio.gorin)
#### Post date: [June 2, 2018, 7:15pm UTC](https://discuss.elastic.co/t/index-dynamically-created-using-template-ignores-defined-shards-settings/134295/3 "2018-06-02T19:15:26Z")

</div>

David, thank for your rapid response, but I don't think so.  
Again, the "wrong" indexes have been created at midnight, when the first document needs to be indexed. The index contains the template alias, and a complex mapping definitions. I can assure you that the indexes were created dynamically.

Here is an example of those indexes:  
{  
"prices\_20180423\_v1": {  
"aliases": {  
"historical\_prices\_v1": {}  
},  
"mappings": {...},  
"settings": {  
"index": {  
"creation\_date": "1524452341133",  
"number\_of\_shards": "1",  
"number\_of\_replicas": "0",  
"uuid": "1rr5KvtWQXmw1hyAVy0IUQ",  
"version": {  
"created": "5050299"  
},  
"provided\_name": "prices\_20180423\_v1"  
}  
}  
}  
}

And this is te template definition (the only one template defined):  
{  
"historical\_prices\_v1": {  
"order": 0,  
"template": "prices\_\*\_v1",  
"settings": {  
"index": {  
"number\_of\_shards": "5",  
"number\_of\_replicas": "3"  
}  
},  
"mappings": {...},  
"aliases": {  
"historical\_prices\_v1": {}  
}  
}  
}

---

<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: [June 2, 2018, 8:19pm UTC](https://discuss.elastic.co/t/index-dynamically-created-using-template-ignores-defined-shards-settings/134295/4 "2018-06-02T20:19:33Z")

</div>

I could understand if you had 5 primaries and 1 replica but 1 primary and 0 replica is not something "standard".

What gives

```
GET /_template

```

Did you define anything in `elasticsearch.yml`?

I remember similar bug with old versions. May be upgrade to latest 5.6 would help here.

---

<div class="post-metadata">

### Author: ![patricio.gorin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/patricio.gorin/32/31865_2.png) [@patricio.gorin](https://discuss.elastic.co/u/patricio.gorin)
#### Post date: [June 2, 2018, 8:24pm UTC](https://discuss.elastic.co/t/index-dynamically-created-using-template-ignores-defined-shards-settings/134295/5 "2018-06-02T20:24:51Z")

</div>

Nothing especial in elasticsearch.yml configuration.  
The only template is the mentioned one.

---

<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: [June 2, 2018, 10:15pm UTC](https://discuss.elastic.co/t/index-dynamically-created-using-template-ignores-defined-shards-settings/134295/6 "2018-06-02T22:15:22Z")

</div>

Could you share both?

---

<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: [June 30, 2018, 10:15pm UTC](https://discuss.elastic.co/t/index-dynamically-created-using-template-ignores-defined-shards-settings/134295/7 "2018-06-30T22:15:25Z")

</div>

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