# Unassigned shards after launching new node and then taking it down

**URL:** <https://discuss.elastic.co/t/unassigned-shards-after-launching-new-node-and-then-taking-it-down/11062>\
**Category:** Elasticsearch\
**Created:** [March 7, 2013, 6:12pm UTC](https://discuss.elastic.co/t/unassigned-shards-after-launching-new-node-and-then-taking-it-down/11062 "2013-03-07T18:12:02Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mike](https://avatars.discourse-cdn.com/v4/letter/m/58f4c7/32.png) [@Mike](https://discuss.elastic.co/u/Mike)\
**Post date:** [March 7, 2013, 6:12pm UTC](https://discuss.elastic.co/t/unassigned-shards-after-launching-new-node-and-then-taking-it-down/11062/1 "2013-03-07T18:12:02Z")

</div>

I have 1 node with 2 shards, 0 replicas, and a few indices. I'm able to  
access all of my data.  
nodeA  
indexA [0,1]  
indexB [0,1]  
indexC [0,1]  
indexD [0,1]

I brought up a 2nd node for testing, and the shards were distributed as  
such below. I'm still able to access all of my data, which is good.  
nodeA nodeB  
indexA [0,1]  
indexB [0,1]  
indexC [0,1]  
indexD [0,1]

I took down my second testing node, but now I can't access all my data like  
I had before. Is this correct? I thought my shards would have been  
brought back up on nodeA, similar to how they were moved to nodeB when it  
was brought up.  
nodeA UNASSIGNED  
indexA [0,1]  
indexB [0,1]  
indexC [0,1]  
indexD [0,1]

1. How do I fix this? Is the only solution now to bring back up my  
temporary nodeB, set replicas = 1 for all the indices, and then bring back  
down nodeB?
2. To ensure maximum availability, is the recommendation to set # shards \>=

# expected nodes and # replicas == # expected nodes - 1?

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Clinton\_Gormley](https://avatars.discourse-cdn.com/v4/letter/c/50afbb/32.png) [@Clinton\_Gormley](https://discuss.elastic.co/u/Clinton_Gormley)\
**Post date:** [March 7, 2013, 6:35pm UTC](https://discuss.elastic.co/t/unassigned-shards-after-launching-new-node-and-then-taking-it-down/11062/2 "2013-03-07T18:35:49Z")

</div>

Hiya Mike

On Thu, 2013-03-07 at 10:12 -0800, Mike wrote:

> I have 1 node with 2 shards, 0 replicas, and a few indices. I'm able  
> to access all of my data.

> I took down my second testing node, but now I can't access all my data  
> like I had before. Is this correct?

Yes - it relies on having replicas in order to be able to upgrade  
"replica" shards to "primary" shards. That's why it will never put a  
primary and its replica on the same node.

> I thought my shards would have been brought back up on nodeA, similar  
> to how they were moved to nodeB when it was brought up.  
> nodeA UNASSIGNED  
> indexA [0,1]  
> indexB [0,1]  
> indexC [0,1]  
> indexD [0,1]
> 
> 1. How do I fix this? Is the only solution now to bring back up my  
> temporary nodeB, set replicas = 1 for all the indices, and then bring  
> back down nodeB?

yes

> 1. To ensure maximum availability, is the recommendation to set #  
> shards \>= # expected nodes and # replicas == # expected nodes - 1?

yes

clint

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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, 2:47am UTC](https://discuss.elastic.co/t/unassigned-shards-after-launching-new-node-and-then-taking-it-down/11062/3 "2017-07-06T02:47:44Z")

</div>


