# How to manually delete indexes with elasticsearch running

**URL:** <https://discuss.elastic.co/t/how-to-manually-delete-indexes-with-elasticsearch-running/256392>\
**Category:** Elasticsearch\
**Created:** [November 23, 2020, 6:56pm UTC](https://discuss.elastic.co/t/how-to-manually-delete-indexes-with-elasticsearch-running/256392 "2020-11-23T18:56:38Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![bshaw](https://avatars.discourse-cdn.com/v4/letter/b/c2a13f/32.png) [@bshaw](https://discuss.elastic.co/u/bshaw)\
**Post date:** [November 23, 2020, 6:56pm UTC](https://discuss.elastic.co/t/how-to-manually-delete-indexes-with-elasticsearch-running/256392/1 "2020-11-23T18:56:38Z")

</div>

Hello,  
I ran into an issue this morning after leaving a test running over the weekend. The test generated more data then available space in my elasticsearch data partition. I am running 7.7.1 on a single node in a docker container with no replicas. My data directory is bind mounted so the data survives container restarts.

When I tried to view my indexes in Kibana so that I could delete some, it just threw errors and would not display any index.

I manually tried to delete an index using curl:

```auto
[root@d234bc67034e elasticsearch]# curl -XDELETE "http://localhost:9200/filebeat-2020-11-23"
{"error":{"root_cause":[{"type":"master_not_discovered_exception","reason":null}],"type":"master_not_discovered_exception","reason":null},"status":503}

```

I tried to restart elasticsearch and that made things worse because the container refused to even attempt a start. So, at this point elasticsearch isn't running.

I also looked at the directories to see if I could delete indexes with rm. The disk names of indexes are less then helpful:

```auto
$ ls -l elastic-data/elasticsearch/nodes/0/indices
total 48
drwxrwxr-x 4 user group 4096 Nov 23 17:27 0qYQLn1zQrGADve76AnL4w
drwxrwxr-x 4 user group 4096 Nov 23 17:27 0UlEcuzmTHOBbeDSx0MIXg
drwxrwxr-x 4 user group 4096 Nov 23 17:27 8zM11IVTT56t1wWsG2lcuw

```

Searching online for how to manually remove indexes only gave results for using the API in one form or another, which is not helpful for a scenario where elasticsearch is either not responding properly or not running at all.

I ended up completely deleting the contents of the the elastic-data partition and starting over. While elasticsearch is up and running again, I lost all my data from over the weekend.

My question then, is there a way to delete indexes when elasticsearch is not running? This way I could have freed up some space and got things going again without losing **all** my data.

Thank you.

---

<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:** [November 23, 2020, 7:29pm UTC](https://discuss.elastic.co/t/how-to-manually-delete-indexes-with-elasticsearch-running/256392/2 "2020-11-23T19:29:32Z")

</div>

> [@bshaw](#):
>
> My question then, is there a way to delete indexes when elasticsearch is not running?

No, there's various cross-references and consistency checks between the all the files in the data folder to detect corruption and other meddling. You can't manipulate them yourself in a way that would satisfy all those checks. There are no user-serviceable parts inside the data folder.

---

<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:** [November 23, 2020, 7:30pm UTC](https://discuss.elastic.co/t/how-to-manually-delete-indexes-with-elasticsearch-running/256392/3 "2020-11-23T19:30:55Z")

</div>

> [@bshaw](#):
>
> This way I could have freed up some space and got things going again without losing **all** my data.

You didn't necessarily need to lose your data tho. A `master_not_discovered_exception` is normally transient, and there will be details in the server logs that will help you understand what actions, if any, are needed.

---

<div class="post-metadata">

**Author:** ![bshaw](https://avatars.discourse-cdn.com/v4/letter/b/c2a13f/32.png) [@bshaw](https://discuss.elastic.co/u/bshaw)\
**Post date:** [November 23, 2020, 8:38pm UTC](https://discuss.elastic.co/t/how-to-manually-delete-indexes-with-elasticsearch-running/256392/4 "2020-11-23T20:38:23Z")

</div>

Thanks for the information. If it happens again, I'll try to gather more details to try and recover before being so drastic.

---

<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 21, 2020, 8:38pm UTC](https://discuss.elastic.co/t/how-to-manually-delete-indexes-with-elasticsearch-running/256392/5 "2020-12-21T20:38:28Z")

</div>

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