Unassigned shards after launching new node and then taking it down

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.
For more options, visit https://groups.google.com/groups/opt_out.

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.
For more options, visit https://groups.google.com/groups/opt_out.