# Setting default # of replications and shards ES 5.0

**URL:** https://discuss.elastic.co/t/setting-default-of-replications-and-shards-es-5-0/69484
**Category:** Elasticsearch
**Created:** [December 19, 2016, 6:40pm UTC](https://discuss.elastic.co/t/setting-default-of-replications-and-shards-es-5-0/69484 "2016-12-19T18:40:06Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Mike\_Clarke](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mike_clarke/32/87948_2.png) [@Mike\_Clarke](https://discuss.elastic.co/u/Mike_Clarke)
#### Post date: [December 19, 2016, 6:40pm UTC](https://discuss.elastic.co/t/setting-default-of-replications-and-shards-es-5-0/69484/1 "2016-12-19T18:40:06Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![Lumaraf](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lumaraf/32/50639_2.png) [@Lumaraf](https://discuss.elastic.co/u/Lumaraf)
#### Post date: [December 20, 2016, 9:07am UTC](https://discuss.elastic.co/t/setting-default-of-replications-and-shards-es-5-0/69484/2 "2016-12-20T09:07:14Z")

</div>

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](https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-templates.html)

---

<div class="post-metadata">

### Author: ![Mike\_Clarke](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mike_clarke/32/87948_2.png) [@Mike\_Clarke](https://discuss.elastic.co/u/Mike_Clarke)
#### Post date: [December 20, 2016, 10:10pm UTC](https://discuss.elastic.co/t/setting-default-of-replications-and-shards-es-5-0/69484/3 "2016-12-20T22:10:11Z")

</div>

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.

---

<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: [January 17, 2017, 10:10pm UTC](https://discuss.elastic.co/t/setting-default-of-replications-and-shards-es-5-0/69484/4 "2017-01-17T22:10:18Z")

</div>

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