# Default number of shards clusterwide

**URL:** https://discuss.elastic.co/t/default-number-of-shards-clusterwide/139558
**Category:** Elasticsearch
**Created:** [July 11, 2018, 12:08pm UTC](https://discuss.elastic.co/t/default-number-of-shards-clusterwide/139558 "2018-07-11T12:08:58Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![akhalaiashota](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/akhalaiashota/32/33234_2.png) [@akhalaiashota](https://discuss.elastic.co/u/akhalaiashota)
#### Post date: [July 11, 2018, 12:08pm UTC](https://discuss.elastic.co/t/default-number-of-shards-clusterwide/139558/1 "2018-07-11T12:08:58Z")

</div>

hello  
I am googling almost 5 hrs and cant find information about how to change default number of shards (which is 5) clusterwide  
I know how to set number of shards during index creation or using template or set the number for templates but I need set default number for whole cluster  
in old versions I was able control default number of shards and replicas from yml config file but now I cant  
and I cant find any information about that  
could you help  
thnx

---

<div class="post-metadata">

### Author: ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)
#### Post date: [July 11, 2018, 12:25pm UTC](https://discuss.elastic.co/t/default-number-of-shards-clusterwide/139558/2 "2018-07-11T12:25:04Z")

</div>

You can create an index template which applies to all indices.

---

<div class="post-metadata">

### Author: ![akhalaiashota](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/akhalaiashota/32/33234_2.png) [@akhalaiashota](https://discuss.elastic.co/u/akhalaiashota)
#### Post date: [July 11, 2018, 12:29pm UTC](https://discuss.elastic.co/t/default-number-of-shards-clusterwide/139558/3 "2018-07-11T12:29:32Z")

</div>

thank you for reply  
so it's impossible to change the default number which is 5 😑

---

<div class="post-metadata">

### Author: ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)
#### Post date: [July 11, 2018, 9:43pm UTC](https://discuss.elastic.co/t/default-number-of-shards-clusterwide/139558/4 "2018-07-11T21:43:58Z")

</div>

It is. With an index template.

---

<div class="post-metadata">

### Author: ![zqc0512](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/zqc0512/32/32141_2.png) [@zqc0512](https://discuss.elastic.co/u/zqc0512)
#### Post date: [July 12, 2018, 1:50am UTC](https://discuss.elastic.co/t/default-number-of-shards-clusterwide/139558/5 "2018-07-12T01:50:28Z")

</div>

2.x can configure in elasticsearch.yml file  
5.x as i know only create with the index template.

---

<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: [August 9, 2018, 1:50am UTC](https://discuss.elastic.co/t/default-number-of-shards-clusterwide/139558/6 "2018-08-09T01:50:35Z")

</div>

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