# 595 unassigned shards

**URL:** <https://discuss.elastic.co/t/595-unassigned-shards/50136>\
**Category:** Elasticsearch\
**Created:** [May 16, 2016, 4:20pm UTC](https://discuss.elastic.co/t/595-unassigned-shards/50136 "2016-05-16T16:20:20Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Stuart\_Cracraft1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stuart_cracraft1/32/8036_2.png) [@Stuart\_Cracraft1](https://discuss.elastic.co/u/Stuart_Cracraft1)\
**Post date:** [May 16, 2016, 4:20pm UTC](https://discuss.elastic.co/t/595-unassigned-shards/50136/1 "2016-05-16T16:20:20Z")

</div>

Hi, I walked in this morning to 595 unassigned shards.

What is best practice for resolving without data loss?

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [May 16, 2016, 5:02pm UTC](https://discuss.elastic.co/t/595-unassigned-shards/50136/2 "2016-05-16T17:02:29Z")

</div>

Depends, are they primaries or replicas?

---

<div class="post-metadata">

**Author:** ![Stuart\_Cracraft1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stuart_cracraft1/32/8036_2.png) [@Stuart\_Cracraft1](https://discuss.elastic.co/u/Stuart_Cracraft1)\
**Post date:** [May 16, 2016, 6:31pm UTC](https://discuss.elastic.co/t/595-unassigned-shards/50136/3 "2016-05-16T18:31:31Z")

</div>

Okay, the problem has mutated.

Now down to 30 unassigned shards with 2 constantly relocating shards.

My question is: why are these two relocating shards taking forever? Could there be a different issue?

elasticsearch.yml on each node is:

[node.name](http://node.name): "elksrv1"  
node.master: true  
node.data: true  
index.number\_of\_replicas: 2  
index.number\_of\_shards: 5  
cluster.routing.allocation.node\_concurrent\_recoveries: 2  
indices.recovery.max\_bytes\_per\_sec: 20mb  
indices.recovery.compress: false  
discovery.zen.minimum\_master\_nodes: 3  
discovery.zen.ping.multicast.enabled: false  
discovery.zen.ping.unicast.hosts: ["elksrv1","elksrv2","elksrv3","elksrv4","elksrv5"]  
script.engine.groovy.inline.update: on  
http.cors.allow-origin: "/.\*/"  
http.cors.enabled: true  
threadpool.search.queue\_size: 10000  
cluster.routing.allocation.disk.threshold\_enabled: false  
cluster.routing.allocation.enable: all

pretty is below:

{  
"cluster\_name" : "elasticsearchlogstashkibana",  
"status" : "red",  
"timed\_out" : false,  
"number\_of\_nodes" : 6,  
"number\_of\_data\_nodes" : 5,  
"active\_primary\_shards" : 1190,  
"active\_shards" : 3531,  
"relocating\_shards" : 2,  
"initializing\_shards" : 0,  
"unassigned\_shards" : 30,  
"number\_of\_pending\_tasks" : 0,  
"number\_of\_in\_flight\_fetch" : 0  
}

---

<div class="post-metadata">

**Author:** ![Stuart\_Cracraft1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stuart_cracraft1/32/8036_2.png) [@Stuart\_Cracraft1](https://discuss.elastic.co/u/Stuart_Cracraft1)\
**Post date:** [May 16, 2016, 9:24pm UTC](https://discuss.elastic.co/t/595-unassigned-shards/50136/4 "2016-05-16T21:24:09Z")

</div>

All fixed up. I wrote a script to relocate shards and it fixed the issue.

---

<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:51pm UTC](https://discuss.elastic.co/t/595-unassigned-shards/50136/5 "2017-07-05T22:51:18Z")

</div>


