Index dynamically created using Template ignores defined shards settings


(Patricio Gorin) #1

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.


(David Pilato) #2

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


(Patricio Gorin) #3

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": {}
}
}
}


(David Pilato) #4

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.


(Patricio Gorin) #5

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


(David Pilato) #6

Could you share both?


(system) #7

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