Need to adjust zeroreplicas template to have a lot more shards

(somerandomguy) #1

Hi. I have the following template in my ES.

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?


(somerandomguy) #2

Did the following and its working.

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

(Mark Walkom) #3

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

(somerandomguy) #4

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 ?

(Mark Walkom) #5

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

(somerandomguy) #6

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

(Mark Walkom) #7

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

(somerandomguy) #8


(system) #9