# Need to adjust zeroreplicas template to have a lot more shards

**URL:** https://discuss.elastic.co/t/need-to-adjust-zeroreplicas-template-to-have-a-lot-more-shards/63459
**Category:** Elasticsearch
**Created:** [October 20, 2016, 2:27am UTC](https://discuss.elastic.co/t/need-to-adjust-zeroreplicas-template-to-have-a-lot-more-shards/63459 "2016-10-20T02:27:16Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![somerandomguy](https://avatars.discourse-cdn.com/v4/letter/s/e19b73/32.png) [@somerandomguy](https://discuss.elastic.co/u/somerandomguy)
#### Post date: [October 20, 2016, 2:27am UTC](https://discuss.elastic.co/t/need-to-adjust-zeroreplicas-template-to-have-a-lot-more-shards/63459/1 "2016-10-20T02:27:16Z")

</div>

Hi. I have the following template in my ES.

[http://pastebin.com/hAF40YFP](http://pastebin.com/hAF40YFP)

I need to hard set the number of shards I would like each new index to have.

I tried to add the following directly underneath the 'number of replicas' line but it complains.

**"number\_of\_shards" : "10"**

Error message:

{"error":{"root\_cause":[{"type":"illegal\_argument\_exception","reason":"failed to parse template source"}],"type":"illegal\_argument\_exception","reason":"failed to parse template source","caused\_by":{"type":"json\_parse\_exception","reason":"Unexpected character ('"' (code 34)): was expecting comma to separate OBJECT entries\n at [Source: [B@1bca689e; line: 8, column: 2]"}},"status":400}

Any pointers?

Thanks.

---

<div class="post-metadata">

### Author: ![somerandomguy](https://avatars.discourse-cdn.com/v4/letter/s/e19b73/32.png) [@somerandomguy](https://discuss.elastic.co/u/somerandomguy)
#### Post date: [October 20, 2016, 2:48am UTC](https://discuss.elastic.co/t/need-to-adjust-zeroreplicas-template-to-have-a-lot-more-shards/63459/2 "2016-10-20T02:48:18Z")

</div>

Did the following and its working.

Deleted my test index and it was recreated with 10 shards and 0 replicas.

[http://pastebin.com/kSubYpfQ](http://pastebin.com/kSubYpfQ)

---

<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: [October 20, 2016, 3:45am UTC](https://discuss.elastic.co/t/need-to-adjust-zeroreplicas-template-to-have-a-lot-more-shards/63459/3 "2016-10-20T03:45:15Z")

</div>

You should be careful doing that, you may end up wasting a lot of resources.

---

<div class="post-metadata">

### Author: ![somerandomguy](https://avatars.discourse-cdn.com/v4/letter/s/e19b73/32.png) [@somerandomguy](https://discuss.elastic.co/u/somerandomguy)
#### Post date: [October 20, 2016, 9:13am UTC](https://discuss.elastic.co/t/need-to-adjust-zeroreplicas-template-to-have-a-lot-more-shards/63459/4 "2016-10-20T09:13:31Z")

</div>

Thanks Mark.  
What happens if we have 10 ES Data Nodes and they are all of equal performance Servers.  
If we leave the default ES will only create 5 shards per index so some nodes will have shards and others won't ?

---

<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: [October 20, 2016, 9:37am UTC](https://discuss.elastic.co/t/need-to-adjust-zeroreplicas-template-to-have-a-lot-more-shards/63459/5 "2016-10-20T09:37:34Z")

</div>

What if you have one index with 5 documents and 10 shards?

---

<div class="post-metadata">

### Author: ![somerandomguy](https://avatars.discourse-cdn.com/v4/letter/s/e19b73/32.png) [@somerandomguy](https://discuss.elastic.co/u/somerandomguy)
#### Post date: [October 20, 2016, 10:12pm UTC](https://discuss.elastic.co/t/need-to-adjust-zeroreplicas-template-to-have-a-lot-more-shards/63459/6 "2016-10-20T22:12:05Z")

</div>

So it doesn't matter that some nodes won't have a shard?

---

<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: [October 20, 2016, 10:16pm UTC](https://discuss.elastic.co/t/need-to-adjust-zeroreplicas-template-to-have-a-lot-more-shards/63459/7 "2016-10-20T22:16:05Z")

</div>

It's more that you are wasting resources on empty/low volume shards

---

<div class="post-metadata">

### Author: ![somerandomguy](https://avatars.discourse-cdn.com/v4/letter/s/e19b73/32.png) [@somerandomguy](https://discuss.elastic.co/u/somerandomguy)
#### Post date: [October 20, 2016, 11:20pm UTC](https://discuss.elastic.co/t/need-to-adjust-zeroreplicas-template-to-have-a-lot-more-shards/63459/8 "2016-10-20T23:20:58Z")

</div>

Understood.

---

<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: [July 5, 2017, 10:10pm UTC](https://discuss.elastic.co/t/need-to-adjust-zeroreplicas-template-to-have-a-lot-more-shards/63459/9 "2017-07-05T22:10:42Z")

</div>


