# How to increase the number of shard in an exsisting index

**URL:** <https://discuss.elastic.co/t/how-to-increase-the-number-of-shard-in-an-exsisting-index/206320>\
**Category:** Elasticsearch\
**Created:** [November 4, 2019, 3:22am UTC](https://discuss.elastic.co/t/how-to-increase-the-number-of-shard-in-an-exsisting-index/206320 "2019-11-04T03:22:32Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![lusynda](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lusynda/32/53557_2.png) [@lusynda](https://discuss.elastic.co/u/lusynda)\
**Post date:** [November 4, 2019, 3:22am UTC](https://discuss.elastic.co/t/how-to-increase-the-number-of-shard-in-an-exsisting-index/206320/1 "2019-11-04T03:22:32Z")

</div>

Dear all,  
i have an elastic to collect log  
when i read the document they say that the default number of shard per index are 5 but when i create the index there are only one index, so how can i increate the number of shard in that index without having to create a template to create a new index

thank you.

---

<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:** [November 4, 2019, 6:03am UTC](https://discuss.elastic.co/t/how-to-increase-the-number-of-shard-in-an-exsisting-index/206320/2 "2019-11-04T06:03:55Z")

</div>

Why do you want to increase the number of shards?

But to answer your question, you can use the split API or you can create a new index and reindex.

You should probably change the template as well if you want that to happen automatically every day.

---

<div class="post-metadata">

**Author:** ![lusynda](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lusynda/32/53557_2.png) [@lusynda](https://discuss.elastic.co/u/lusynda)\
**Post date:** [November 4, 2019, 7:41am UTC](https://discuss.elastic.co/t/how-to-increase-the-number-of-shard-in-an-exsisting-index/206320/3 "2019-11-04T07:41:11Z")

</div>

Thank for responding  
i want to increase the numbers of shard because i was hoping that it would help me with the time out problems that i keep having when viewing a huge size log index

---

<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:** [November 4, 2019, 8:13am UTC](https://discuss.elastic.co/t/how-to-increase-the-number-of-shard-in-an-exsisting-index/206320/4 "2019-11-04T08:13:08Z")

</div>

What is the output of:

```auto
GET /
GET /_cat/nodes?v
GET /_cat/health?v
GET /_cat/indices?v

```

---

<div class="post-metadata">

**Author:** ![lusynda](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lusynda/32/53557_2.png) [@lusynda](https://discuss.elastic.co/u/lusynda)\
**Post date:** [November 4, 2019, 8:23am UTC](https://discuss.elastic.co/t/how-to-increase-the-number-of-shard-in-an-exsisting-index/206320/5 "2019-11-04T08:23:36Z")

</div>

The output of GET / is

```auto
{
  "name" : "coordinate-node-01",
  "cluster_name" : "",
  "cluster_uuid" : "L9t1WyZfRzyomh4AOnNRgQ",
  "version" : {
    "number" : "7.4.0",
    "build_flavor" : "default",
    "build_type" : "rpm",
    "build_hash" : "22e1767283e61a198cb4db791ea66e3f11ab9910",
    "build_date" : "2019-09-27T08:36:48.569419Z",
    "build_snapshot" : false,
    "lucene_version" : "8.2.0",
    "minimum_wire_compatibility_version" : "6.8.0",
    "minimum_index_compatibility_version" : "6.0.0-beta1"
  },
  "tagline" : "You Know, for Search"
}

```

the output of GET /\_cat/nodes?v is:

```auto
ip heap.percent ram.percent cpu load_1m load_5m load_15m node.role master name
            6 96 27 0.73 0.94 1.01 m - master-node-02
          33 92 7 0.45 0.44 0.37 - - coordinate-node-02
            5 96 33 1.63 1.38 1.47 mv - master-node-03
           15 75 0 0.28 0.37 0.43 d - data-node-01
           23 98 13 3.34 3.62 4.04 d - data-node-03
            7 92 1 0.09 0.10 0.08 i - ingest-node-01
           27 97 36 1.25 1.29 1.28 m * master-node-01
           15 98 5 1.84 1.99 2.21 d - data-node-02
           64 92 7 0.06 0.18 0.22 - - coordinate-node-01

```

the output of

```auto
epoch timestamp cluster status node.total node.data shards pri relo init unassign pending_tasks max_task_wait_time active_shards_percent
1572855595 08:19:55 green 9 3 120 74 0 0 0 0 - 100.0%

```

and the output of GET /\_cat/indices?v is:

```auto
health status index uuid pri rep docs.count docs.deleted store.size pri.store.size
green open wineventlog-2019.10 w78FS0ESQ6SDBFmP6cVAVw 1 0 1371220897 0 690.6gb 690.6gb
green open wineventlog-2019.11 Q6YaIoZgRH-8RhwqYgXDhg 1 1 837432644 0 1tb 515.9gb

```

When i view the log in the wineventlog index in more than 1 hours it always timeout

---

<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:** [November 4, 2019, 9:01am UTC](https://discuss.elastic.co/t/how-to-increase-the-number-of-shard-in-an-exsisting-index/206320/6 "2019-11-04T09:01:22Z")

</div>

That's indeed too much data for one single shard.

You probably need at least 14 primary shards per index.  
Another solution would be to change from daily indices to hourly indices or use the rollover API and rollover every 50gb...

---

<div class="post-metadata">

**Author:** ![sukhmet](https://avatars.discourse-cdn.com/v4/letter/s/4491bb/32.png) [@sukhmet](https://discuss.elastic.co/u/sukhmet)\
**Post date:** [November 5, 2019, 4:44am UTC](https://discuss.elastic.co/t/how-to-increase-the-number-of-shard-in-an-exsisting-index/206320/7 "2019-11-05T04:44:19Z")

</div>

Apart from increasing the shards which looks very critical, you can also increase your replicas to divert your read/write traffic. But replicas do come with extra cost.

---

<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:** [December 3, 2019, 4:44am UTC](https://discuss.elastic.co/t/how-to-increase-the-number-of-shard-in-an-exsisting-index/206320/8 "2019-12-03T04:44:23Z")

</div>

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