# How to identify unallocated shards

**URL:** https://discuss.elastic.co/t/how-to-identify-unallocated-shards/9558
**Category:** Elasticsearch
**Created:** [November 5, 2012, 12:22pm UTC](https://discuss.elastic.co/t/how-to-identify-unallocated-shards/9558 "2012-11-05T12:22:57Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Rahul\_Sharma](https://avatars.discourse-cdn.com/v4/letter/r/df705f/32.png) [@Rahul\_Sharma](https://discuss.elastic.co/u/Rahul_Sharma)
#### Post date: [November 5, 2012, 12:22pm UTC](https://discuss.elastic.co/t/how-to-identify-unallocated-shards/9558/1 "2012-11-05T12:22:57Z")

</div>

Hi,

I have a production ES (1.9.4) deployed on AWS.  
Running with 2 nodes 0 replica. It has the default setting of 5 shards  
while creation of new index.

For some reason the master node went down and the other got elected as  
master.

Then I stopped both and restarted the old master first and then the second  
one.  
It allocate most of the shards except 4. And now the status is RED.

How do I identify the unallocated shards? And what can be done with those?

Would greatly appreciate your inputs.

Thanks  
Rahul

--

---

<div class="post-metadata">

### Author: ![Chuck\_McKenzie](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/chuck_mckenzie/32/19660_2.png) [@Chuck\_McKenzie](https://discuss.elastic.co/u/Chuck_McKenzie)
#### Post date: [November 5, 2012, 6:02pm UTC](https://discuss.elastic.co/t/how-to-identify-unallocated-shards/9558/2 "2012-11-05T18:02:31Z")

</div>

Unallocated shards are listed at [http://node:9200/\_cluster/state](http://node:9200/_cluster/state) in the  
routing\_nodes unassigned section.

What to do to fix it depends a lot on why they're remaining unassigned.  
What do the logs say there?

On Monday, November 5, 2012 6:23:00 AM UTC-6, Rahul Sharma wrote:

> Hi,
> 
> I have a production ES (1.9.4) deployed on AWS.  
> Running with 2 nodes 0 replica. It has the default setting of 5 shards  
> while creation of new index.
> 
> For some reason the master node went down and the other got elected as  
> master.
> 
> Then I stopped both and restarted the old master first and then the second  
> one.  
> It allocate most of the shards except 4. And now the status is RED.
> 
> How do I identify the unallocated shards? And what can be done with those?
> 
> Would greatly appreciate your inputs.
> 
> Thanks  
> Rahul

--

---

<div class="post-metadata">

### Author: ![Rahul\_Sharma](https://avatars.discourse-cdn.com/v4/letter/r/df705f/32.png) [@Rahul\_Sharma](https://discuss.elastic.co/u/Rahul_Sharma)
#### Post date: [November 5, 2012, 8:22pm UTC](https://discuss.elastic.co/t/how-to-identify-unallocated-shards/9558/3 "2012-11-05T20:22:01Z")

</div>

Thanks a lot Chuck for the tip. I finally able to identify the unallocated  
shards.

I did stopped a node just after starting it (before status going green -  
basically it was still trying to allocate shards during that time.). I did  
this because I realized after starting the very node, that I started a  
wrong node first for which it got elected as master. Not sure if this can  
be the reason.  
I can't see any useful logs that points me to the cause.

These shards are from one index and I can re-build it.  
Is there any easy way to re-assign these shards or remove them permanently  
so that I get my green status back?

Thanks  
Rahul

On Mon, Nov 5, 2012 at 11:32 PM, Chuck McKenzie [redchuck@gmail.com](mailto:redchuck@gmail.com) wrote:

> Unallocated shards are listed at [http://node:9200/\_cluster/state](http://node:9200/_cluster/state) in the  
> routing\_nodes unassigned section.
> 
> What to do to fix it depends a lot on why they're remaining unassigned.  
> What do the logs say there?
> 
> On Monday, November 5, 2012 6:23:00 AM UTC-6, Rahul Sharma wrote:
> 
> > Hi,
> > 
> > I have a production ES (1.9.4) deployed on AWS.  
> > Running with 2 nodes 0 replica. It has the default setting of 5 shards  
> > while creation of new index.
> > 
> > For some reason the master node went down and the other got elected as  
> > master.
> > 
> > Then I stopped both and restarted the old master first and then the  
> > second one.  
> > It allocate most of the shards except 4. And now the status is RED.
> > 
> > How do I identify the unallocated shards? And what can be done with those?
> > 
> > Would greatly appreciate your inputs.
> > 
> > Thanks  
> > Rahul
> 
> --

--

---

<div class="post-metadata">

### Author: ![Igor\_Motov](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/igor_motov/32/45193_2.png) [@Igor\_Motov](https://discuss.elastic.co/u/Igor_Motov)
#### Post date: [November 6, 2012, 12:03am UTC](https://discuss.elastic.co/t/how-to-identify-unallocated-shards/9558/4 "2012-11-06T00:03:50Z")

</div>

If you are going to rebuilt the index, you can just delete the index with  
unallocated shards. All shards, including unallocated, will be deleted when  
the index is deleted.

On Monday, November 5, 2012 3:22:04 PM UTC-5, Rahul Sharma wrote:

> Thanks a lot Chuck for the tip. I finally able to identify the unallocated  
> shards.
> 
> I did stopped a node just after starting it (before status going green -  
> basically it was still trying to allocate shards during that time.). I did  
> this because I realized after starting the very node, that I started a  
> wrong node first for which it got elected as master. Not sure if this can  
> be the reason.  
> I can't see any useful logs that points me to the cause.
> 
> These shards are from one index and I can re-build it.  
> Is there any easy way to re-assign these shards or remove them permanently  
> so that I get my green status back?
> 
> Thanks  
> Rahul
> 
> On Mon, Nov 5, 2012 at 11:32 PM, Chuck McKenzie \<[redc...@gmail.com](mailto:redc...@gmail.com)\<javascript:\>
> 
> > wrote:
> 
> > Unallocated shards are listed at [http://node:9200/\_cluster/state](http://node:9200/_cluster/state) in the  
> > routing\_nodes unassigned section.
> > 
> > What to do to fix it depends a lot on why they're remaining unassigned.  
> > What do the logs say there?
> > 
> > On Monday, November 5, 2012 6:23:00 AM UTC-6, Rahul Sharma wrote:
> > 
> > > Hi,
> > > 
> > > I have a production ES (1.9.4) deployed on AWS.  
> > > Running with 2 nodes 0 replica. It has the default setting of 5 shards  
> > > while creation of new index.
> > > 
> > > For some reason the master node went down and the other got elected as  
> > > master.
> > > 
> > > Then I stopped both and restarted the old master first and then the  
> > > second one.  
> > > It allocate most of the shards except 4. And now the status is RED.
> > > 
> > > How do I identify the unallocated shards? And what can be done with  
> > > those?
> > > 
> > > Would greatly appreciate your inputs.
> > > 
> > > Thanks  
> > > Rahul
> > 
> > --

--

---

<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 6, 2017, 3:06am UTC](https://discuss.elastic.co/t/how-to-identify-unallocated-shards/9558/5 "2017-07-06T03:06:06Z")

</div>


