# ES 6.2.1 Unassigned shards due to DANGLING\_INDEX\_IMPORTED

**URL:** https://discuss.elastic.co/t/es-6-2-1-unassigned-shards-due-to-dangling-index-imported/121896
**Category:** Elasticsearch
**Created:** [February 28, 2018, 4:43pm UTC](https://discuss.elastic.co/t/es-6-2-1-unassigned-shards-due-to-dangling-index-imported/121896 "2018-02-28T16:43:51Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![ld\_pvl](https://avatars.discourse-cdn.com/v4/letter/l/cdc98d/32.png) [@ld\_pvl](https://discuss.elastic.co/u/ld_pvl)
#### Post date: [February 28, 2018, 4:43pm UTC](https://discuss.elastic.co/t/es-6-2-1-unassigned-shards-due-to-dangling-index-imported/121896/1 "2018-02-28T16:43:51Z")

</div>

Hi Team,

I am getting unassigned shards after I added a new data node to the cluster. This is the sequence of actions that I did prior that lead to unassigned shards:

1. Cluster is green
2. Then on host A, where there is a single node with name node\_0 (this node has all master, data, ingest set to true) running, I stopped node\_0.
3. On the same host A, I started node\_0 back up with a new node, node\_1 which is of type data.
4. Cluster now has unassigned shards.
5. Tried to remove node\_1 and restarted node\_0 to check, still the same amount of unassigned shards.

Upon running `http://localhost:9200/_cat/shards?h=index,shard,prirep,state,unassigned.reason&v`, the reason for unassigned shards is dangling index imported which is mentioned here [https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-shards.html](https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-shards.html) along with various other reasons but without a resolution advice. It would be really good if the docs could be updated with some resolution advice for each unassigned cause.

I tried rerouting as follows but did not help - same number of unassigned shards remain:

```
curl -H 'Content-Type: application/json' -XPOST 'localhost:9200/_cluster/reroute' -d '{
    "commands": [{
        "allocate_stale_primary": {
            "index": "my_index",
            "shard": 1,
            "node": "node_0",
            "accept_data_loss": true
        }
    }]
}'

```

Previously I used to use the `allocate` command for rerouting but doesn't look like it's available anymore.

What's the best way to solve the unassigned shards problem caused by dangling index imported?

Thanks a lot,

---

<div class="post-metadata">

### Author: ![JimP](https://avatars.discourse-cdn.com/v4/letter/j/8baadc/32.png) [@JimP](https://discuss.elastic.co/u/JimP)
#### Post date: [March 22, 2018, 4:47pm UTC](https://discuss.elastic.co/t/es-6-2-1-unassigned-shards-due-to-dangling-index-imported/121896/2 "2018-03-22T16:47:07Z")

</div>

Did you ever get this resolved? I'm in the same boat, and don't want to lose any data.

---

<div class="post-metadata">

### Author: ![ld\_pvl](https://avatars.discourse-cdn.com/v4/letter/l/cdc98d/32.png) [@ld\_pvl](https://discuss.elastic.co/u/ld_pvl)
#### Post date: [March 22, 2018, 5:10pm UTC](https://discuss.elastic.co/t/es-6-2-1-unassigned-shards-due-to-dangling-index-imported/121896/3 "2018-03-22T17:10:10Z")

</div>

I had to clean up stuff to get the cluster back to green state but some data were lost as part of the clean up.

I could afford losing my data though so I did not do the digging too thoroughly. When I looked inside the data folder for the indices, I noticed there were no data but there were some references to those problematic indices and shards which I then (I think) deleted.

---

<div class="post-metadata">

### Author: ![JimP](https://avatars.discourse-cdn.com/v4/letter/j/8baadc/32.png) [@JimP](https://discuss.elastic.co/u/JimP)
#### Post date: [March 22, 2018, 7:26pm UTC](https://discuss.elastic.co/t/es-6-2-1-unassigned-shards-due-to-dangling-index-imported/121896/4 "2018-03-22T19:26:53Z")

</div>

Thanks for the quick response!

---

<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: [April 19, 2018, 7:27pm UTC](https://discuss.elastic.co/t/es-6-2-1-unassigned-shards-due-to-dangling-index-imported/121896/5 "2018-04-19T19:27:15Z")

</div>

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