Setting default # of replications and shards ES 5.0


(Mike Clarke) #1

How can I go about setting the default number of replications and shards for any new indices that will be created in ES? I know that you can use the API to define these for an already created index, but I would like to create my ES cluster, define default # of replications and shards for any index that is created and then let logstash start creating indices.


(Daniel Penning) #2

You should have a look at index templates. I use those to configure shard, replicas and mappings for my logstash indices.

https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-templates.html


(Mike Clarke) #3

Thanks for the reference. I found this late last night and created a template this morning. I then created a new index that matched the template and it created the correct number of shards and replicas.


(system) #4

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