# How to split an Index, number\_of\_routing\_shards issue

**URL:** <https://discuss.elastic.co/t/how-to-split-an-index-number-of-routing-shards-issue/238024>\
**Category:** Elasticsearch\
**Created:** [June 22, 2020, 7:40am UTC](https://discuss.elastic.co/t/how-to-split-an-index-number-of-routing-shards-issue/238024 "2020-06-22T07:40:44Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![defalt](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/defalt/32/71379_2.png) [@defalt](https://discuss.elastic.co/u/defalt)\
**Post date:** [June 22, 2020, 7:40am UTC](https://discuss.elastic.co/t/how-to-split-an-index-number-of-routing-shards-issue/238024/1 "2020-06-22T07:40:44Z")

</div>

Hi,  
I want to split my index with 5 shards into 10 or 30 shards. At first I tried it with the `_split`API but i get the following result  
`the number of routing shards [5] must be a multiple of the target shards [10]`  
I tried changing the settings of the routing shards and I got back an "acknowledged":  
 ![grafik](https://us1.discourse-cdn.com/elastic/original/3X/f/1/f100c163970caf739c4662715038bcf2b44928a2.png)

But when I tried to split the the index again I get the same error and it says that my number of routing shards is 5.  
When I use `GET index/_settings` it displays `number_of_routing_shards	"30"`

How do I fix this?  
Thanks,  
defalt

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [June 24, 2020, 4:57am UTC](https://discuss.elastic.co/t/how-to-split-an-index-number-of-routing-shards-issue/238024/2 "2020-06-24T04:57:11Z")

</div>

I assume you are using Elasticsearch 6.x, and in that case [the docs state that the index need to be created with number\_of\_routing\_shards set](https://www.elastic.co/guide/en/elasticsearch/reference/6.8/indices-split-index.html). You can therefore not set this parameter for existing indices, so will need to reindex to increase the primary shard count. In Elasticsearch 7.x I believe this parameter is set by default when indices are created.

---

<div class="post-metadata">

**Author:** ![defalt](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/defalt/32/71379_2.png) [@defalt](https://discuss.elastic.co/u/defalt)\
**Post date:** [June 24, 2020, 6:09am UTC](https://discuss.elastic.co/t/how-to-split-an-index-number-of-routing-shards-issue/238024/3 "2020-06-24T06:09:47Z")

</div>

I use Elastic 7.7. So I would need to reindex the whole thing?

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [June 24, 2020, 8:04am UTC](https://discuss.elastic.co/t/how-to-split-an-index-number-of-routing-shards-issue/238024/4 "2020-06-24T08:04:44Z")

</div>

Not if the index was created in Elasticsearch 7 and not migrated fro version 6.

---

<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 22, 2020, 8:04am UTC](https://discuss.elastic.co/t/how-to-split-an-index-number-of-routing-shards-issue/238024/5 "2020-07-22T08:04:52Z")

</div>

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