Unassigned shards not rerouting


(Gustavo Rodrigues) #1

My shards get red and they are all unassigned.

curl -XGET "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"
.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" -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.


(system) #2