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:
- Cluster is green
- 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.
- On the same host A, I started node_0 back up with a new node, node_1 which is of type data.
- Cluster now has unassigned shards.
- 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 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,