# Unassigned shards not rerouting

**URL:** https://discuss.elastic.co/t/unassigned-shards-not-rerouting/63935
**Category:** Elasticsearch
**Created:** [October 25, 2016, 8:28pm UTC](https://discuss.elastic.co/t/unassigned-shards-not-rerouting/63935 "2016-10-25T20:28:43Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![gurodrigues](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/gurodrigues/32/12729_2.png) [@gurodrigues](https://discuss.elastic.co/u/gurodrigues)
#### Post date: [October 25, 2016, 8:28pm UTC](https://discuss.elastic.co/t/unassigned-shards-not-rerouting/63935/1 "2016-10-25T20:28:43Z")

</div>

My shards get red and they are all unassigned.

curl -XGET "[http://localhost:9200/\_cluster/health?level=shards](http://localhost:9200/_cluster/health?level=shards)"  
{  
"cluster\_name": "dk\_cluster",  
"status": "red",  
"timed\_out": false,  
"number\_of\_nodes": 1,  
"number\_of\_data\_nodes": 1,  
"active\_primary\_shards": 1,  
"active\_shards": 1,  
"relocating\_shards": 0,  
"initializing\_shards": 0,  
"unassigned\_shards": 5,  
"delayed\_unassigned\_shards": 0,  
"number\_of\_pending\_tasks": 0,  
"number\_of\_in\_flight\_fetch": 0,  
"task\_max\_waiting\_in\_queue\_millis": 0,  
"active\_shards\_percent\_as\_number": 16.666666666666664,  
"indices": {  
".kibana": {  
"status": "green",  
"number\_of\_shards": 1,  
"number\_of\_replicas": 0,  
"active\_primary\_shards": 1,  
"active\_shards": 1,  
"relocating\_shards": 0,  
"initializing\_shards": 0,  
"unassigned\_shards": 0,  
"shards": {  
"0": {  
"status": "green",  
"primary\_active": true,  
"active\_shards": 1,  
"relocating\_shards": 0,  
"initializing\_shards": 0,  
"unassigned\_shards": 0  
}  
}  
},  
"report": {  
"status": "red",  
"number\_of\_shards": 5,  
"number\_of\_replicas": 0,  
"active\_primary\_shards": 0,  
"active\_shards": 0,  
"relocating\_shards": 0,  
"initializing\_shards": 0,  
"unassigned\_shards": 5,  
"shards": {  
"0": {  
"status": "red",  
"primary\_active": false,  
"active\_shards": 0,  
"relocating\_shards": 0,  
"initializing\_shards": 0,  
"unassigned\_shards": 1  
},  
"1": {  
"status": "red",  
"primary\_active": false,  
"active\_shards": 0,  
"relocating\_shards": 0,  
"initializing\_shards": 0,  
"unassigned\_shards": 1  
},  
"2": {  
"status": "red",  
"primary\_active": false,  
"active\_shards": 0,  
"relocating\_shards": 0,  
"initializing\_shards": 0,  
"unassigned\_shards": 1  
},  
"3": {  
"status": "red",  
"primary\_active": false,  
"active\_shards": 0,  
"relocating\_shards": 0,  
"initializing\_shards": 0,  
"unassigned\_shards": 1  
},  
"4": {  
"status": "red",  
"primary\_active": false,  
"active\_shards": 0,  
"relocating\_shards": 0,  
"initializing\_shards": 0,  
"unassigned\_shards": 1  
}  
}  
}  
}  
}

curl -XGET "[http://localhost:9200/\_cat/shards](http://localhost:9200/_cat/shards)"  
.kibana 0 p STARTED 1 3.2kb 158.69.123.202 denakop1  
report 2 p UNASSIGNED  
report 3 p UNASSIGNED  
report 4 p UNASSIGNED  
report 1 p UNASSIGNED  
report 0 p UNASSIGNED

I'm trying to run the follow code to reroute my shards  
curl -XPOST "[http://localhost:9200/\_cluster/reroute](http://localhost:9200/_cluster/reroute)" -d'  
{  
"commands": [{  
"allocate": {  
"index": "report",  
"shard": 0,  
"node": "denakop1",  
"allow\_primary": 1  
}  
}]  
}'

But it is not working .. When i saw the log file it is returning "primary shard is not active"

I would like to know what i can do to restore my data.

---

<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: [July 5, 2017, 10:09pm UTC](https://discuss.elastic.co/t/unassigned-shards-not-rerouting/63935/2 "2017-07-05T22:09:45Z")

</div>


