I'm supporting an ELK stack with version 6.3.x of all components. I want to reduce the sharding factor of all indices from the 5 (default) to 3 (the number of data nodes in the ES cluster). From reading the documentation and many threads in this forum, it seems clear that the way to do this is to create an index template.
For example (ref this thread):
POST _template/default
{
"index_patterns": ["*"],
"settings": {
"number_of_shards": "3"
}
}
Great, got it.
However, this requires me to wait for Elasticsearch to be up and healthy before I POST
this template to the API. From an automation standpoint - to take the human out of the loop - it looks like I have to write a process to wait for the cluster to be healthy, then POST
the template.
Is there no way to provision this template automatically at cluster creation time? Is there perhaps a /templates
directory where I can drop template files that ES will read on startup? I must be missing something, because this seems like it would be a common use case for automated provisioning.