# Is it possible to delete a dangling index data directory from a running node?

**URL:** <https://discuss.elastic.co/t/is-it-possible-to-delete-a-dangling-index-data-directory-from-a-running-node/203354>\
**Category:** Elasticsearch\
**Created:** [October 13, 2019, 5:12pm UTC](https://discuss.elastic.co/t/is-it-possible-to-delete-a-dangling-index-data-directory-from-a-running-node/203354 "2019-10-13T17:12:41Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![bruce289](https://avatars.discourse-cdn.com/v4/letter/b/7bcc69/32.png) [@bruce289](https://discuss.elastic.co/u/bruce289)\
**Post date:** [October 13, 2019, 5:12pm UTC](https://discuss.elastic.co/t/is-it-possible-to-delete-a-dangling-index-data-directory-from-a-running-node/203354/1 "2019-10-13T17:12:41Z")

</div>

Hi,

I have a number of dangling indices across the cluster which all contain data that is no longer required. Is it safe to simply delete the particular directories under path.data that these dangling indices refer to, whilst the node is running? Or do I need to stop the node first?

Thanks.

---

<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:** [October 13, 2019, 6:58pm UTC](https://discuss.elastic.co/t/is-it-possible-to-delete-a-dangling-index-data-directory-from-a-running-node/203354/2 "2019-10-13T18:58:16Z")

</div>

The best thing to do is allow the dangling indices to be imported and then delete them through the API.

I would not recommend making any manual changes to the contents of the data path. Certainly not when the node is running, but even when it's down it's a risky business.

---

<div class="post-metadata">

**Author:** ![bruce289](https://avatars.discourse-cdn.com/v4/letter/b/7bcc69/32.png) [@bruce289](https://discuss.elastic.co/u/bruce289)\
**Post date:** [October 13, 2019, 7:12pm UTC](https://discuss.elastic.co/t/is-it-possible-to-delete-a-dangling-index-data-directory-from-a-running-node/203354/3 "2019-10-13T19:12:25Z")

</div>

> [@DavidTurner](#):
>
> allow the dangling indices to be imported

Thanks, David. How do I go about doing that though? Right now, the dangling indices to which I refer are the cause of log messages like:

[[XXXXXX]] can not be imported as a dangling index, as index with same name already exists in cluster metadata

---

<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:** [October 13, 2019, 7:25pm UTC](https://discuss.elastic.co/t/is-it-possible-to-delete-a-dangling-index-data-directory-from-a-running-node/203354/4 "2019-10-13T19:25:39Z")

</div>

Can you delete the index with the same name first?

Our of interest, how did your cluster end up in this state?

---

<div class="post-metadata">

**Author:** ![bruce289](https://avatars.discourse-cdn.com/v4/letter/b/7bcc69/32.png) [@bruce289](https://discuss.elastic.co/u/bruce289)\
**Post date:** [October 13, 2019, 7:35pm UTC](https://discuss.elastic.co/t/is-it-possible-to-delete-a-dangling-index-data-directory-from-a-running-node/203354/5 "2019-10-13T19:35:50Z")

</div>

> [@DavidTurner](#):
>
> Can you delete the index with the same name first?

Probably. Either that, or rename the existing one by reindexing and then delete it. Once I've done that, the dangling indices ought to get imported, and can then be deleted, right?

> [@DavidTurner](#):
>
> Our of interest, how did your cluster end up in this state?

Not sure. These indexes, and the log messages, originate from a time before I started working at the company.

---

<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:** [October 13, 2019, 7:45pm UTC](https://discuss.elastic.co/t/is-it-possible-to-delete-a-dangling-index-data-directory-from-a-running-node/203354/6 "2019-10-13T19:45:30Z")

</div>

> [@bruce289](#):
>
> Once I've done that, the dangling indices ought to get imported, and can then be deleted, right?

Yes that's right.

---

<div class="post-metadata">

**Author:** ![bruce289](https://avatars.discourse-cdn.com/v4/letter/b/7bcc69/32.png) [@bruce289](https://discuss.elastic.co/u/bruce289)\
**Post date:** [October 13, 2019, 7:55pm UTC](https://discuss.elastic.co/t/is-it-possible-to-delete-a-dangling-index-data-directory-from-a-running-node/203354/7 "2019-10-13T19:55:31Z")

</div>

Thanks, David 👍

---

<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:** [November 10, 2019, 7:55pm UTC](https://discuss.elastic.co/t/is-it-possible-to-delete-a-dangling-index-data-directory-from-a-running-node/203354/8 "2019-11-10T19:55:39Z")

</div>

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