Hello,
I have several pipelines running in a Logstash, they read messages from queues on a RabbitMQ and output those messages in rolling indices in an Elasticsearch.
For those indices, I have templates matching my index names, for instance.
GET _template
Result:
{
...
"clicks_template": {
"order": 0,
"template": "[clicks-*]",
"settings": {
"index": {
"number_of_shards": "1"
}
},
"mappings": {
"click": {
"properties": {
"uniqueVisitorId": {
"type": "keyword"
},
"advertisementId": {
"type": "keyword"
},
"campaignId": {
"type": "keyword"
},
"lastUpdateOn": {
"type": "date"
},
"timestamp": {
"type": "date"
},
"publisherSpotReferenceId": {
"type": "keyword"
},
"device": {
"type": "keyword"
},
"userAgent": {
"type": "text"
},
"ipAddress": {
"type": "keyword"
},
"id": {
"type": "text"
}
}
}
},
"aliases": {}
}
...
}
But If I query the settings of one of those indices, the number of shards is not right.
GET clicks_2021-07-15_idx/_settings
Result:
{
"clicks_2021-07-15_idx": {
"settings": {
"index": {
"creation_date": "1626308727528",
"number_of_shards": "5",
"number_of_replicas": "1",
"uuid": "VGpag5DoSI6aCPQ1CeBwrQ",
"version": {
"created": "5061699"
},
"provided_name": "clicks_2021-07-15_idx"
}
}
}
}
For which reason the template would not be applied ? Can I maybe change the default number of shards for the entire cluster ?