# How to clean up storage space in elasticsearch cluster

**URL:** <https://discuss.elastic.co/t/how-to-clean-up-storage-space-in-elasticsearch-cluster/43044>\
**Category:** Elasticsearch\
**Created:** [February 29, 2016, 8:27pm UTC](https://discuss.elastic.co/t/how-to-clean-up-storage-space-in-elasticsearch-cluster/43044 "2016-02-29T20:27:33Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kaufusihm](https://avatars.discourse-cdn.com/v4/letter/k/bcef8e/32.png) [@Kaufusihm](https://discuss.elastic.co/u/Kaufusihm)\
**Post date:** [February 29, 2016, 8:27pm UTC](https://discuss.elastic.co/t/how-to-clean-up-storage-space-in-elasticsearch-cluster/43044/1 "2016-02-29T20:27:33Z")

</div>

I'm currently about 80% storage used accross my ES data nodes. I was trying to clear up indexes to get more storage back, but I guess the deleting of indices alone does not remove documents.

Problem 2:  
I am looking for a manual temp solution to get disk space back now

Problem 1:  
Next I want to delete indices and documents older than 7 days.

---

<div class="post-metadata">

**Author:** ![nik9000](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nik9000/32/44947_2.png) [@nik9000](https://discuss.elastic.co/u/nik9000)\
**Post date:** [February 29, 2016, 8:39pm UTC](https://discuss.elastic.co/t/how-to-clean-up-storage-space-in-elasticsearch-cluster/43044/2 "2016-02-29T20:39:46Z")

</div>

For this the best thing to do is to create a new index every day and them after 7 days. It is very very inefficient to 1/7 of and index every day. If you delete the index that should give you the space back within a few seconds.

---

<div class="post-metadata">

**Author:** ![Kaufusihm](https://avatars.discourse-cdn.com/v4/letter/k/bcef8e/32.png) [@Kaufusihm](https://discuss.elastic.co/u/Kaufusihm)\
**Post date:** [February 29, 2016, 8:48pm UTC](https://discuss.elastic.co/t/how-to-clean-up-storage-space-in-elasticsearch-cluster/43044/3 "2016-02-29T20:48:54Z")

</div>

Nik,

Thanks for the reply. I am creating indexes every new day, but when I delete the index I am not getting the space back.

Here is how I'm doing the deletion of indices:

curl -XDELETE '[http://172.24.29.X:9200/](http://172.24.29.X:9200/)'

---

<div class="post-metadata">

**Author:** ![theuntergeek](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/theuntergeek/32/44961_2.png) [@theuntergeek](https://discuss.elastic.co/u/theuntergeek)\
**Post date:** [February 29, 2016, 9:24pm UTC](https://discuss.elastic.co/t/how-to-clean-up-storage-space-in-elasticsearch-cluster/43044/4 "2016-02-29T21:24:46Z")

</div>

> [@Kaufusihm](#):
>
> curl -XDELETE '[http://172.24.29.X:9200/](http://172.24.29.X:9200/)'

I presume you're putting the index name at the end? Even so, it should clear up _soon,_ if not immediately. Keep checking cluster state.

---

<div class="post-metadata">

**Author:** ![Kaufusihm](https://avatars.discourse-cdn.com/v4/letter/k/bcef8e/32.png) [@Kaufusihm](https://discuss.elastic.co/u/Kaufusihm)\
**Post date:** [February 29, 2016, 9:48pm UTC](https://discuss.elastic.co/t/how-to-clean-up-storage-space-in-elasticsearch-cluster/43044/5 "2016-02-29T21:48:06Z")

</div>

Yeah. I could have been more specific.

I am including the index name and that index does get deleted, but the documents and Free Disk Space does not change.

Are you saying after we delete an index the documents will also get removed?

Best,  
Monty

---

<div class="post-metadata">

**Author:** ![theuntergeek](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/theuntergeek/32/44961_2.png) [@theuntergeek](https://discuss.elastic.co/u/theuntergeek)\
**Post date:** [March 23, 2016, 2:24pm UTC](https://discuss.elastic.co/t/how-to-clean-up-storage-space-in-elasticsearch-cluster/43044/6 "2016-03-23T14:24:44Z")

</div>

> [@Kaufusihm](#):
>
> Are you saying after we delete an index the documents will also get removed?

Yes. You can go to the node where the indices reside and check the `indices` subdirectory of where your data resides and a `df` will show they are gone after deletion. Filesystem queue of I/O operations _may_ delay the eventual removal, but you should see that the indices disappear almost instantly.

---

<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, 11:05pm UTC](https://discuss.elastic.co/t/how-to-clean-up-storage-space-in-elasticsearch-cluster/43044/7 "2017-07-05T23:05:51Z")

</div>


