# 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:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ipv6only](https://avatars.discourse-cdn.com/v4/letter/i/d26b3c/32.png) [@ipv6only](https://discuss.elastic.co/u/ipv6only)\
**Post date:** [September 28, 2017, 3:31pm UTC](https://discuss.elastic.co/t/default-shards-and-replicas/102141/1 "2017-09-28T15:31:16Z")

</div>

Hiho,

I'am trying to get into ElasticSearch and set up a one-node cluster.

Now everything seems to create indices (Kibana, x-pack, logstash, ...) with a configuration of more than one shard and at least one replica. This creates yellow-status notifications and probably isn't very healthy to just tolerate.

So I wonder now how I can have an index template which defines that no new index, doesn't matter which name, should never ever use a different setting than 1 shard and 0 replicas for the the future? I found how I can change that for existing indices. I found how a index template could look like with a template name matching to particular index in the future, but what I don't found was how this setting will affect all indices in the future.

Or do I just have to accept that users/applications will create their own settings and then my whole cluster will turn yellow or red because of that and I can't do anything against this?

PS: are there any guides or docs which explain the needed basic configuration of a one-node setup?

Thanks for any help in this.

Cheers  
Chris

---

<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.

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [September 28, 2017, 10:20pm UTC](https://discuss.elastic.co/t/default-shards-and-replicas/102141/3 "2017-09-28T22:20:13Z")

</div>

You can set a 0 priority template that matches `*` as the index pattern, then it should take precedence.

---

<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:** [October 26, 2017, 10:20pm UTC](https://discuss.elastic.co/t/default-shards-and-replicas/102141/4 "2017-10-26T22:20:48Z")

</div>

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