# Why No shard becomes primary on second node when it is UP again?

**URL:** https://discuss.elastic.co/t/why-no-shard-becomes-primary-on-second-node-when-it-is-up-again/78987
**Category:** Elasticsearch
**Created:** [March 17, 2017, 9:12am UTC](https://discuss.elastic.co/t/why-no-shard-becomes-primary-on-second-node-when-it-is-up-again/78987 "2017-03-17T09:12:36Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![stephen](https://avatars.discourse-cdn.com/v4/letter/s/96bed5/32.png) [@stephen](https://discuss.elastic.co/u/stephen)
#### Post date: [March 17, 2017, 9:12am UTC](https://discuss.elastic.co/t/why-no-shard-becomes-primary-on-second-node-when-it-is-up-again/78987/1 "2017-03-17T09:12:36Z")

</div>

I have configured two node cluster and created an `index` with `4 shards` and `1 replica`  
[![enter image description here](https://i.stack.imgur.com/bF6AZ.png)](https://i.stack.imgur.com/bF6AZ.png)

Elastic created 2 primary shards on each node, this is how it looks from head plugin. `shard 1`, `shard 3` are primary on `node 1(stephen1c7)` AND `shard 0` and `shard 2` are primary on `node 2(stephen2c7)`

[![enter image description here](https://i.stack.imgur.com/gXeR4.png)](https://i.stack.imgur.com/gXeR4.png)

## Shutdown one Node

Now i have shutdown the `node 2(stephen2c7)` to see if all the shards on `node 1(stephen1c7)` became primary. Yes, all shards are now primary.

[![enter image description here](https://i.stack.imgur.com/M2LUt.png)](https://i.stack.imgur.com/M2LUt.png)

## UP the shutdown node

Now i have made the `Node 2(stephen2c7)` up again to see if any shards on this node will be primary. But surprisingly no shard on this node became primary. Waited for long time but still no shard is primary on `Node 2`.  
Why so?

[![enter image description here](https://i.stack.imgur.com/uKf9M.png)](https://i.stack.imgur.com/uKf9M.png)

Is there any configuration to set for making the shards primary again after a node is up?

Thanks in advance!

---

<div class="post-metadata">

### Author: ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)
#### Post date: [March 17, 2017, 9:30am UTC](https://discuss.elastic.co/t/why-no-shard-becomes-primary-on-second-node-when-it-is-up-again/78987/2 "2017-03-17T09:30:21Z")

</div>

It's not really important where primaries and secondaries are allocated.

All will get the same load basically

---

<div class="post-metadata">

### Author: ![stephen](https://avatars.discourse-cdn.com/v4/letter/s/96bed5/32.png) [@stephen](https://discuss.elastic.co/u/stephen)
#### Post date: [March 17, 2017, 10:05am UTC](https://discuss.elastic.co/t/why-no-shard-becomes-primary-on-second-node-when-it-is-up-again/78987/3 "2017-03-17T10:05:03Z")

</div>

@dadoonet is that true for write operations also? why can't elastic make any shard on node2 as primary?

---

<div class="post-metadata">

### Author: ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)
#### Post date: [March 17, 2017, 10:28am UTC](https://discuss.elastic.co/t/why-no-shard-becomes-primary-on-second-node-when-it-is-up-again/78987/4 "2017-03-17T10:28:42Z")

</div>

> is that true for write operations also?

Yes. Write operations will happen on both shards (primary and replica).

> why can't elastic make any shard on node2 as primary?

Why would it do that if the load is the same?

---

<div class="post-metadata">

### Author: ![stephen](https://avatars.discourse-cdn.com/v4/letter/s/96bed5/32.png) [@stephen](https://discuss.elastic.co/u/stephen)
#### Post date: [March 17, 2017, 10:54am UTC](https://discuss.elastic.co/t/why-no-shard-becomes-primary-on-second-node-when-it-is-up-again/78987/5 "2017-03-17T10:54:20Z")

</div>

Got it ! Thank you @dadoonet. Are write operations happening in synchronous or asynchronous?  
(Writing to primary and then secondary OR start writing to primary and secondary at same time)

---

<div class="post-metadata">

### Author: ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)
#### Post date: [March 17, 2017, 11:07am UTC](https://discuss.elastic.co/t/why-no-shard-becomes-primary-on-second-node-when-it-is-up-again/78987/6 "2017-03-17T11:07:39Z")

</div>

Writing to primary and then **all secondaries in parallel**

---

<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: [April 14, 2017, 11:08am UTC](https://discuss.elastic.co/t/why-no-shard-becomes-primary-on-second-node-when-it-is-up-again/78987/7 "2017-04-14T11:08:04Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
