# Disk usage elasticsearch

**URL:** <https://discuss.elastic.co/t/disk-usage-elasticsearch/113009>\
**Category:** Elasticsearch\
**Created:** [December 22, 2017, 1:34pm UTC](https://discuss.elastic.co/t/disk-usage-elasticsearch/113009 "2017-12-22T13:34:05Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![adriell](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/adriell/32/25925_2.png) [@adriell](https://discuss.elastic.co/u/adriell)\
**Post date:** [December 22, 2017, 1:34pm UTC](https://discuss.elastic.co/t/disk-usage-elasticsearch/113009/1 "2017-12-22T13:34:06Z")

</div>

Guys, how do I set a limit on disk usage in elasticsearch? My elasticsearch server has a disk space problem.

---

<div class="post-metadata">

**Author:** ![shanec](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/shanec/32/4004_2.png) [@shanec](https://discuss.elastic.co/u/shanec)\
**Post date:** [December 23, 2017, 12:52am UTC](https://discuss.elastic.co/t/disk-usage-elasticsearch/113009/2 "2017-12-23T00:52:44Z")

</div>

Have a look at the `cluster.routing.allocation.disk.watermark.flood_stage` and `cluster.routing.allocation.disk.watermark.high` settings at [https://www.elastic.co/guide/en/elasticsearch/reference/current/disk-allocator.html](https://www.elastic.co/guide/en/elasticsearch/reference/current/disk-allocator.html) (also, note that the `flood_stage` one was added on 6.0, so you'll need to be on 6.x to take advantage of that setting).

The `high` watermark tells Elasticsearch "when your disk is more than this percentage full, don't allocate shards to this node." The `flood_stage` is "harsher" in that it marks an index read-only once this threshold is passed. Once you hit the flood stage, you really need to look to clean up some old data on the server.

---

<div class="post-metadata">

**Author:** ![adriell](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/adriell/32/25925_2.png) [@adriell](https://discuss.elastic.co/u/adriell)\
**Post date:** [December 26, 2017, 8:41pm UTC](https://discuss.elastic.co/t/disk-usage-elasticsearch/113009/3 "2017-12-26T20:41:22Z")

</div>

I understand, however how do I automatically remove old indexes from elasticsearch, for example, remove after 30 days?

---

<div class="post-metadata">

**Author:** ![shanec](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/shanec/32/4004_2.png) [@shanec](https://discuss.elastic.co/u/shanec)\
**Post date:** [December 26, 2017, 9:10pm UTC](https://discuss.elastic.co/t/disk-usage-elasticsearch/113009/4 "2017-12-26T21:10:15Z")

</div>

There's currently nothing "inside of" Elasticsearch that does that type of index curation. For automatically deleting indices, many people use [curator](https://www.elastic.co/guide/en/elasticsearch/client/curator/current/about.html). There's an example curator config that does almost exactly what you're looking for [here](https://www.elastic.co/guide/en/elasticsearch/client/curator/current/ex_delete_indices.html) (it's just 45 days instead of 30, so you can change that as needed).

---

<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:** [January 23, 2018, 9:10pm UTC](https://discuss.elastic.co/t/disk-usage-elasticsearch/113009/5 "2018-01-23T21:10:18Z")

</div>

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