# Difference between primary node and replica node

**URL:** <https://discuss.elastic.co/t/difference-between-primary-node-and-replica-node/97366>\
**Category:** Elasticsearch\
**Created:** [August 17, 2017, 8:58am UTC](https://discuss.elastic.co/t/difference-between-primary-node-and-replica-node/97366 "2017-08-17T08:58:47Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tushar\_Sharma1](https://avatars.discourse-cdn.com/v4/letter/t/c4cdca/32.png) [@Tushar\_Sharma1](https://discuss.elastic.co/u/Tushar_Sharma1)\
**Post date:** [August 17, 2017, 8:58am UTC](https://discuss.elastic.co/t/difference-between-primary-node-and-replica-node/97366/1 "2017-08-17T08:58:48Z")

</div>

difference between primary-replica node and primary -replica shards ?.  
as mention on page link given below:

[https://www.elastic.co/cloud/as-a-service/pricing](https://www.elastic.co/cloud/as-a-service/pricing)

---

<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:** [August 17, 2017, 9:10am UTC](https://discuss.elastic.co/t/difference-between-primary-node-and-replica-node/97366/2 "2017-08-17T09:10:27Z")

</div>

There is no such thing as a replica node.

But in the context of that link you have N DCs, which are really availability zones as it runs on AWS.  
Then within any Elasticsearch cluster you have primary and replica shards that are spread across the nodes. So here you have two nodes and the shards are spread across them.

So in the case a DC (zone) becomes unavailable, you still have the data in other DCs thanks to the replica shards.

---

<div class="post-metadata">

**Author:** ![poojagupta](https://avatars.discourse-cdn.com/v4/letter/p/5daacb/32.png) [@poojagupta](https://discuss.elastic.co/u/poojagupta)\
**Post date:** [August 17, 2017, 9:16am UTC](https://discuss.elastic.co/t/difference-between-primary-node-and-replica-node/97366/3 "2017-08-17T09:16:14Z")

</div>

In Elasticsearch , There is a concept of primary and replica shards not a replica node.  
for overcoming the issue of data loss this concept use replica feature i.e replicated all your index data to another node .

for more understanding of primary and replica shards you can follow the below link:  
[https://www.elastic.co/guide/en/elasticsearch/guide/current/\_how\_primary\_and\_replica\_shards\_interact.html](https://www.elastic.co/guide/en/elasticsearch/guide/current/_how_primary_and_replica_shards_interact.html)

---

<div class="post-metadata">

**Author:** ![Tushar\_Sharma1](https://avatars.discourse-cdn.com/v4/letter/t/c4cdca/32.png) [@Tushar\_Sharma1](https://discuss.elastic.co/u/Tushar_Sharma1)\
**Post date:** [August 17, 2017, 9:17am UTC](https://discuss.elastic.co/t/difference-between-primary-node-and-replica-node/97366/4 "2017-08-17T09:17:03Z")

</div>

Thanks

---

<div class="post-metadata">

**Author:** ![Tushar\_Sharma1](https://avatars.discourse-cdn.com/v4/letter/t/c4cdca/32.png) [@Tushar\_Sharma1](https://discuss.elastic.co/u/Tushar_Sharma1)\
**Post date:** [August 17, 2017, 9:21am UTC](https://discuss.elastic.co/t/difference-between-primary-node-and-replica-node/97366/5 "2017-08-17T09:21:43Z")

</div>

All shards and index occupies disk space for size allocation, so How Ram size will effect cluster for shard size allocation.

---

<div class="post-metadata">

**Author:** ![poojagupta](https://avatars.discourse-cdn.com/v4/letter/p/5daacb/32.png) [@poojagupta](https://discuss.elastic.co/u/poojagupta)\
**Post date:** [August 17, 2017, 9:39am UTC](https://discuss.elastic.co/t/difference-between-primary-node-and-replica-node/97366/6 "2017-08-17T09:39:46Z")

</div>

Using Cluster update settings API , you can manage the allocation of shards to nodes .  
follow the url:

[https://www.elastic.co/guide/en/elasticsearch/reference/current/disk-allocator.html](https://www.elastic.co/guide/en/elasticsearch/reference/current/disk-allocator.html)

---

<div class="post-metadata">

**Author:** ![Tushar\_Sharma1](https://avatars.discourse-cdn.com/v4/letter/t/c4cdca/32.png) [@Tushar\_Sharma1](https://discuss.elastic.co/u/Tushar_Sharma1)\
**Post date:** [August 17, 2017, 9:57am UTC](https://discuss.elastic.co/t/difference-between-primary-node-and-replica-node/97366/7 "2017-08-17T09:57:52Z")

</div>

I think i was not clear with my points,lets take some e.g.  
I have 2 nodes with (200GB Disk space +8Gb RAM) for each node .So  
1)what will be max index size for one index only setup?  
2)what will be max shard size for (5 primary+1 replica )=10 total shard for 2 node cluster?

---

<div class="post-metadata">

**Author:** ![poojagupta](https://avatars.discourse-cdn.com/v4/letter/p/5daacb/32.png) [@poojagupta](https://discuss.elastic.co/u/poojagupta)\
**Post date:** [August 17, 2017, 11:35am UTC](https://discuss.elastic.co/t/difference-between-primary-node-and-replica-node/97366/8 "2017-08-17T11:35:21Z")

</div>

value of maximum shard size and index will depend on the nature of document being indexed, indexing rate, search queries and search query rate.  
also, shard size depends on how much space is allocated to ES. which can also b edited as per user requirement.

In ./bin/elasticsearch file , allocation of heap size of elasticsearch i mentioned which can be edited as per your requirement.  
the only limit is the disk space of your server, but if your index is growing too fast you should think about having more replica servers.

---

<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:** [September 14, 2017, 11:35am UTC](https://discuss.elastic.co/t/difference-between-primary-node-and-replica-node/97366/9 "2017-09-14T11:35:28Z")

</div>

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