# Default shards and replicas

**URL:** https://discuss.elastic.co/t/default-shards-and-replicas/102141
**Category:** Elasticsearch
**Created:** [September 28, 2017, 3:31pm UTC](https://discuss.elastic.co/t/default-shards-and-replicas/102141 "2017-09-28T15:31:16Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![thn](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/thn/32/8061_2.png) [@thn](https://discuss.elastic.co/u/thn)
#### Post date: [September 28, 2017, 4:53pm UTC](https://discuss.elastic.co/t/default-shards-and-replicas/102141/2 "2017-09-28T16:53:05Z")

</div>

it looks like you can find your answer at the link below

> [@Controlling the number of shard/index in Elasticsearch 5](https://discuss.elastic.co/t/controlling-the-number-of-shard-index-in-elasticsearch-5/65092):
>
> Hello, Upgrading to ES 5 I've noticed that the elasticsearch.yml file has shrinked a bit. In particular, I can't find anymore these settings among the others: index.number\_of\_shards: 5 index.number\_of\_replicas: 1 From [https://github.com/elastic/elasticsearch/issues/18073](https://github.com/elastic/elasticsearch/issues/18073) I see that the thing is by design and one shoul call the REST API creating a index template like this: curl -XPUT 'http://localhost:9200/\_all/\_settings?preserve\_existing=true' -d '{ "index.number\_of\_shards" : "5" "index…

I used to do this in the configuration file but it appeared "using REST" is the preferred method as discussed in the thread above.

---

_[View the full topic](https://discuss.elastic.co/t/default-shards-and-replicas/102141)._
