# Elasticsearch Cluster, how to create 2 data nodes single node to primary shards and the other to replica?

**URL:** <https://discuss.elastic.co/t/elasticsearch-cluster-how-to-create-2-data-nodes-single-node-to-primary-shards-and-the-other-to-replica/163089>\
**Category:** Elasticsearch\
**Created:** [January 6, 2019, 5:21pm UTC](https://discuss.elastic.co/t/elasticsearch-cluster-how-to-create-2-data-nodes-single-node-to-primary-shards-and-the-other-to-replica/163089 "2019-01-06T17:21:19Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![m\_5amy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/m_5amy/32/32662_2.png) [@m\_5amy](https://discuss.elastic.co/u/m_5amy)\
**Post date:** [January 6, 2019, 5:21pm UTC](https://discuss.elastic.co/t/elasticsearch-cluster-how-to-create-2-data-nodes-single-node-to-primary-shards-and-the-other-to-replica/163089/1 "2019-01-06T17:21:19Z")

</div>

Elasticsearch Cluster, what is the best configuration to create 2 data nodes single node to primary shards and the other to replica??

---

<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:** [January 6, 2019, 9:51pm UTC](https://discuss.elastic.co/t/elasticsearch-cluster-how-to-create-2-data-nodes-single-node-to-primary-shards-and-the-other-to-replica/163089/2 "2019-01-06T21:51:03Z")

</div>

Elasticsearch will try to balance the shards, irrespective of if they are primary or replica.

---

<div class="post-metadata">

**Author:** ![m\_5amy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/m_5amy/32/32662_2.png) [@m\_5amy](https://discuss.elastic.co/u/m_5amy)\
**Post date:** [January 6, 2019, 10:36pm UTC](https://discuss.elastic.co/t/elasticsearch-cluster-how-to-create-2-data-nodes-single-node-to-primary-shards-and-the-other-to-replica/163089/3 "2019-01-06T22:36:19Z")

</div>

@warkolm you mean that 2 nodes have the same configuration as data-node and elasticsearch balance replica by default

---

<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:** [January 6, 2019, 10:37pm UTC](https://discuss.elastic.co/t/elasticsearch-cluster-how-to-create-2-data-nodes-single-node-to-primary-shards-and-the-other-to-replica/163089/4 "2019-01-06T22:37:26Z")

</div>

It balances _all_ shards, irrespective of if they are primary or replica.

---

<div class="post-metadata">

**Author:** ![m\_5amy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/m_5amy/32/32662_2.png) [@m\_5amy](https://discuss.elastic.co/u/m_5amy)\
**Post date:** [January 6, 2019, 10:51pm UTC](https://discuss.elastic.co/t/elasticsearch-cluster-how-to-create-2-data-nodes-single-node-to-primary-shards-and-the-other-to-replica/163089/5 "2019-01-06T22:51:25Z")

</div>

@warkolm OK but I need to create replica indecies in another data-node how I configure it?

Can you help me?

---

<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:** [January 6, 2019, 10:52pm UTC](https://discuss.elastic.co/t/elasticsearch-cluster-how-to-create-2-data-nodes-single-node-to-primary-shards-and-the-other-to-replica/163089/6 "2019-01-06T22:52:39Z")

</div>

The only way to do that is to manually reassign/reroute shards and manually manage allocation.

We don't recommend doing this.

---

<div class="post-metadata">

**Author:** ![m\_5amy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/m_5amy/32/32662_2.png) [@m\_5amy](https://discuss.elastic.co/u/m_5amy)\
**Post date:** [January 6, 2019, 11:03pm UTC](https://discuss.elastic.co/t/elasticsearch-cluster-how-to-create-2-data-nodes-single-node-to-primary-shards-and-the-other-to-replica/163089/7 "2019-01-06T23:03:34Z")

</div>

@warkolm OK but in case single data node is down what is the best solution to get data contained into this indecies?

---

<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:** [January 6, 2019, 11:04pm UTC](https://discuss.elastic.co/t/elasticsearch-cluster-how-to-create-2-data-nodes-single-node-to-primary-shards-and-the-other-to-replica/163089/8 "2019-01-06T23:04:54Z")

</div>

Can you rephrase that please? I don't understand what you mean.

---

<div class="post-metadata">

**Author:** ![m\_5amy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/m_5amy/32/32662_2.png) [@m\_5amy](https://discuss.elastic.co/u/m_5amy)\
**Post date:** [January 6, 2019, 11:09pm UTC](https://discuss.elastic.co/t/elasticsearch-cluster-how-to-create-2-data-nodes-single-node-to-primary-shards-and-the-other-to-replica/163089/9 "2019-01-06T23:09:17Z")

</div>

@warkolm sorry I mean that if data node is down what about data saved into indecies of this node

---

<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:** [January 6, 2019, 11:11pm UTC](https://discuss.elastic.co/t/elasticsearch-cluster-how-to-create-2-data-nodes-single-node-to-primary-shards-and-the-other-to-replica/163089/10 "2019-01-06T23:11:25Z")

</div>

If you have a single node cluster, then you have no redundancy.

If you have 2 nodes, then your primary and replica shards will be assigned across both nodes in the cluster. So if one node goes down (doesn't matter which one), then the other node still has a complete copy of the data and you don't lose anything.

However we recommend a minimum of 3 nodes in a cluster, see [here](https://www.elastic.co/guide/en/elasticsearch/guide/2.x/important-configuration-changes.html#_minimum_master_nodes)

---

<div class="post-metadata">

**Author:** ![m\_5amy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/m_5amy/32/32662_2.png) [@m\_5amy](https://discuss.elastic.co/u/m_5amy)\
**Post date:** [January 6, 2019, 11:14pm UTC](https://discuss.elastic.co/t/elasticsearch-cluster-how-to-create-2-data-nodes-single-node-to-primary-shards-and-the-other-to-replica/163089/11 "2019-01-06T23:14:48Z")

</div>

@warkolm cluster with 3 master node and 2 data nodes contains all the same indexes and all of nodes master and data nodes included into the same AWS VPC  
Is this the best cluster design??

---

<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:** [January 6, 2019, 11:17pm UTC](https://discuss.elastic.co/t/elasticsearch-cluster-how-to-create-2-data-nodes-single-node-to-primary-shards-and-the-other-to-replica/163089/12 "2019-01-06T23:17:40Z")

</div>

The best depends on how much data you have, what sort of use case, etc etc.

I would probably start with 3 nodes, that are both master eligible and data nodes.

---

<div class="post-metadata">

**Author:** ![m\_5amy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/m_5amy/32/32662_2.png) [@m\_5amy](https://discuss.elastic.co/u/m_5amy)\
**Post date:** [January 6, 2019, 11:22pm UTC](https://discuss.elastic.co/t/elasticsearch-cluster-how-to-create-2-data-nodes-single-node-to-primary-shards-and-the-other-to-replica/163089/13 "2019-01-06T23:22:11Z")

</div>

@warkolm OK I understand this  
But if three nodes work as master and data, I think the three nodes should have highly specs ex. 32G RAM isn't it?

---

<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:** [January 6, 2019, 11:23pm UTC](https://discuss.elastic.co/t/elasticsearch-cluster-how-to-create-2-data-nodes-single-node-to-primary-shards-and-the-other-to-replica/163089/14 "2019-01-06T23:23:27Z")

</div>

How much data is it?  
What sort of data?  
What sort of queries?

---

<div class="post-metadata">

**Author:** ![m\_5amy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/m_5amy/32/32662_2.png) [@m\_5amy](https://discuss.elastic.co/u/m_5amy)\
**Post date:** [January 6, 2019, 11:26pm UTC](https://discuss.elastic.co/t/elasticsearch-cluster-how-to-create-2-data-nodes-single-node-to-primary-shards-and-the-other-to-replica/163089/15 "2019-01-06T23:26:47Z")

</div>

@warkolm At least 5G logs by day and queries aggregations to get data analytics  
We have more indexes at least 50 index and retention is annually

---

<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:** [January 6, 2019, 11:27pm UTC](https://discuss.elastic.co/t/elasticsearch-cluster-how-to-create-2-data-nodes-single-node-to-primary-shards-and-the-other-to-replica/163089/16 "2019-01-06T23:27:58Z")

</div>

Then you might need those at some point, but not immediately.

---

<div class="post-metadata">

**Author:** ![m\_5amy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/m_5amy/32/32662_2.png) [@m\_5amy](https://discuss.elastic.co/u/m_5amy)\
**Post date:** [January 6, 2019, 11:29pm UTC](https://discuss.elastic.co/t/elasticsearch-cluster-how-to-create-2-data-nodes-single-node-to-primary-shards-and-the-other-to-replica/163089/17 "2019-01-06T23:29:35Z")

</div>

@warkolm you means we need to start with low specs and scale later due to data?

---

<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:** [January 6, 2019, 11:30pm UTC](https://discuss.elastic.co/t/elasticsearch-cluster-how-to-create-2-data-nodes-single-node-to-primary-shards-and-the-other-to-replica/163089/18 "2019-01-06T23:30:09Z")

</div>

Yes.

---

<div class="post-metadata">

**Author:** ![m\_5amy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/m_5amy/32/32662_2.png) [@m\_5amy](https://discuss.elastic.co/u/m_5amy)\
**Post date:** [January 6, 2019, 11:34pm UTC](https://discuss.elastic.co/t/elasticsearch-cluster-how-to-create-2-data-nodes-single-node-to-primary-shards-and-the-other-to-replica/163089/19 "2019-01-06T23:34:12Z")

</div>

@warkolm Very very thanks I will start to build our cluster and if I have any questions I will mention you back 🙏 sorry for headache my buddy 😉❤

---

<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:** [January 7, 2019, 2:41am UTC](https://discuss.elastic.co/t/elasticsearch-cluster-how-to-create-2-data-nodes-single-node-to-primary-shards-and-the-other-to-replica/163089/20 "2019-01-07T02:41:17Z")

</div>

May I suggest you look at the following resources about sizing:

[https://www.elastic.co/elasticon/conf/2016/sf/quantitative-cluster-sizing](https://www.elastic.co/elasticon/conf/2016/sf/quantitative-cluster-sizing)

> **[How many shards should I have in my Elasticsearch cluster?
	  	 | Elastic](https://www.elastic.co/blog/how-many-shards-should-i-have-in-my-elasticsearch-cluster)**
>
> Elasticsearch is a very versatile platform, that supports a variety of use cases, and provides great flexibility around data organisation and replication strategies. This flexibility can however somet...

> **[NetSecureDay: Managing your Black Friday Logs](https://speakerdeck.com/elastic/netsecureday-managing-your-black-friday-logs)**
>
> Surveiller une application complexe n’est pas une tâche aisée, mais avec les bons outils, ce n’est pas si sorcier. Néanmoins, des périodes fortes telles que les opérations de type « Black Friday » (Vendredi noir) ou période de Noël peuvent pousser...

And [https://www.elastic.co/webinars/using-rally-to-get-your-elasticsearch-cluster-size-right](https://www.elastic.co/webinars/using-rally-to-get-your-elasticsearch-cluster-size-right)

[Next page](https://discuss.elastic.co/t/elasticsearch-cluster-how-to-create-2-data-nodes-single-node-to-primary-shards-and-the-other-to-replica/163089.md?page=2)
