# Very large index , delete and recreate replica

**URL:** https://discuss.elastic.co/t/very-large-index-delete-and-recreate-replica/314608
**Category:** Elasticsearch
**Created:** [September 17, 2022, 4:04am UTC](https://discuss.elastic.co/t/very-large-index-delete-and-recreate-replica/314608 "2022-09-17T04:04:39Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![Paul-Ayo](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/paul-ayo/32/110962_2.png) [@Paul-Ayo](https://discuss.elastic.co/u/Paul-Ayo)
#### Post date: [September 17, 2022, 4:04am UTC](https://discuss.elastic.co/t/very-large-index-delete-and-recreate-replica/314608/1 "2022-09-17T04:04:39Z")

</div>

I have a huge index which i want to split or reindex , the index has one primary and one replica shard both 118gb . I need to create a new index from the current to be able to use ILM as the index name does not fulfill the naming requirements . The issue here is i don't have sufficient space to just split the index into a new one . can set replicas to 0 , split the index, delete the old index , set replica to one again on the new index without data loss ?

---

<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: [September 17, 2022, 4:31am UTC](https://discuss.elastic.co/t/very-large-index-delete-and-recreate-replica/314608/2 "2022-09-17T04:31:00Z")

</div>

The splitting of an index happens on a single node, which requires additional disk space, so I do not think that will work. IF you drop the replica you should however be able to reindex into a new index/set of indices as these can be located on the other node.

---

<div class="post-metadata">

### Author: ![Paul-Ayo](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/paul-ayo/32/110962_2.png) [@Paul-Ayo](https://discuss.elastic.co/u/Paul-Ayo)
#### Post date: [September 17, 2022, 4:42am UTC](https://discuss.elastic.co/t/very-large-index-delete-and-recreate-replica/314608/3 "2022-09-17T04:42:17Z")

</div>

Thanks for the response  
what is the likely impact of dropping the replica in the mean time  
to perform re-index  
and also how does the clone api work?

---

<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: [September 17, 2022, 4:46am UTC](https://discuss.elastic.co/t/very-large-index-delete-and-recreate-replica/314608/4 "2022-09-17T04:46:54Z")

</div>

> [@Paul-Ayo](#):
>
> what is the likely impact of dropping the replica in the mean time  
> to perform re-index

You will be running without a replica, so any node failures during the reindexing could lead to data loss. If the data is important I would recommend [creating a snapshot](https://www.elastic.co/guide/en/elasticsearch/reference/8.4/snapshot-restore-apis.html) before working on the index.

> [@Paul-Ayo](#):
>
> and also how does the clone api work?

Cloning an index creates an exact copy, which is not what you want.

---

<div class="post-metadata">

### Author: ![Paul-Ayo](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/paul-ayo/32/110962_2.png) [@Paul-Ayo](https://discuss.elastic.co/u/Paul-Ayo)
#### Post date: [September 17, 2022, 6:10am UTC](https://discuss.elastic.co/t/very-large-index-delete-and-recreate-replica/314608/5 "2022-09-17T06:10:45Z")

</div>

For a future purpose, does clone api also happen on a single node  
@Christian_Dahlqvist

---

<div class="post-metadata">

### Author: ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)
#### Post date: [September 17, 2022, 10:15am UTC](https://discuss.elastic.co/t/very-large-index-delete-and-recreate-replica/314608/6 "2022-09-17T10:15:02Z")

</div>

> [@Paul-Ayo](#):
>
> does clone api also happen on a single node

No, cloning happens in-place for each shard separately.

Do you really need to do anything to this index? 118GiB isn't all that large really, I don't think it'll cause many problems. I would suggest just leaving it alone, and using ILM-managed indices for new data only.

---

<div class="post-metadata">

### Author: ![Paul-Ayo](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/paul-ayo/32/110962_2.png) [@Paul-Ayo](https://discuss.elastic.co/u/Paul-Ayo)
#### Post date: [September 17, 2022, 10:37am UTC](https://discuss.elastic.co/t/very-large-index-delete-and-recreate-replica/314608/7 "2022-09-17T10:37:50Z")

</div>

So , this index has the potential to become really big , has one primary shard and one replica , instead of endless scaling up the host server i want to use ILM on this index to managed it properly ... One primary shard means the entire pressure is on a single node

---

<div class="post-metadata">

### Author: ![Paul-Ayo](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/paul-ayo/32/110962_2.png) [@Paul-Ayo](https://discuss.elastic.co/u/Paul-Ayo)
#### Post date: [September 17, 2022, 10:38am UTC](https://discuss.elastic.co/t/very-large-index-delete-and-recreate-replica/314608/8 "2022-09-17T10:38:50Z")

</div>

I also want to increase the number of primary shards on the index ..

---

<div class="post-metadata">

### Author: ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)
#### Post date: [September 18, 2022, 10:03am UTC](https://discuss.elastic.co/t/very-large-index-delete-and-recreate-replica/314608/9 "2022-09-18T10:03:26Z")

</div>

> [@Paul-Ayo](#):
>
> So , this index has the potential to become really big

Sure, but if you leave it alone and start using ILM for _new data only_ then it won't grow any further.

---

<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: [October 16, 2022, 10:03am UTC](https://discuss.elastic.co/t/very-large-index-delete-and-recreate-replica/314608/10 "2022-10-16T10:03:39Z")

</div>

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