# Relationship between No of nodes , shards and replica

**URL:** <https://discuss.elastic.co/t/relationship-between-no-of-nodes-shards-and-replica/17280>\
**Category:** Elasticsearch\
**Created:** [April 30, 2014, 11:42am UTC](https://discuss.elastic.co/t/relationship-between-no-of-nodes-shards-and-replica/17280 "2014-04-30T11:42:20Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Prashant\_Pal](https://avatars.discourse-cdn.com/v4/letter/p/b77776/32.png) [@Prashant\_Pal](https://discuss.elastic.co/u/Prashant_Pal)\
**Post date:** [April 30, 2014, 11:42am UTC](https://discuss.elastic.co/t/relationship-between-no-of-nodes-shards-and-replica/17280/1 "2014-04-30T11:42:20Z")

</div>

Hi ES Users,

Is there any pre defined formula regarding No of nodes , shards and replica.

For example if I am having 3 Nodes (1 Master and 2 Slave) , No of shards as 5. So what is the ideal case for number of replica to be set so that If any of nodes goes down then also I will be having full access of data.

I tried with replica setting as 1 as well as 2, in both cases if my slave nodes goes down I am able to access the full data. So what is the ideal solution for the same?

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [May 5, 2014, 10:32am UTC](https://discuss.elastic.co/t/relationship-between-no-of-nodes-shards-and-replica/17280/2 "2014-05-05T10:32:35Z")

</div>

Hey,

there is no predefined formula. The reason for this is, that it is very  
use-case dependent. If your data is really important, you might want to put  
it onto every node of your cluster. If your data is too big to be put onto  
a single node, you need to split it among several nodes, but still make  
sure that this data is replicated across your cluster. So usually you have  
a mix of replication and sharding, which ensures that a certain amount of  
nodes can go down and you still have all of your data available.

Also, there is no direct connection between number of nodes and number of  
shards due to different use-cases. Some queries need a lot of CPU (geo),  
some functionalities need a lot of memory (aggregations, facets,  
parent/child) - so there are different factors to take into account when  
doing capacity planning - which can only be found out by testing it for  
yourself (for example: fill a single node single shard no replica index and  
see when it doesnt match your requirements of performance anymore you will  
need to add more nodes).

--Alex

On Wed, Apr 30, 2014 at 1:42 PM, Prashant Agrawal \<  
[prashant.agrawal@paladion.net](mailto:prashant.agrawal@paladion.net)\> wrote:

> Hi ES Users,
> 
> Is there any pre defined formula regarding No of nodes , shards and  
> replica.
> 
> For example if I am having 3 Nodes (1 Master and 2 Slave) , No of shards as  
> 5. So what is the ideal case for number of replica to be set so that If any  
> of nodes goes down then also I will be having full access of data.
> 
> I tried with replica setting as 1 as well as 2, in both cases if my slave  
> nodes goes down I am able to access the full data. So what is the ideal  
> solution for the same?
> 
> --  
> View this message in context:  
> [http://elasticsearch-users.115913.n3.nabble.com/Relationship-between-No-of-nodes-shards-and-replica-tp4055094.html](http://elasticsearch-users.115913.n3.nabble.com/Relationship-between-No-of-nodes-shards-and-replica-tp4055094.html)  
> Sent from the Elasticsearch Users mailing list archive at [Nabble.com](http://Nabble.com).
> 
> --  
> 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).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/1398858141001-4055094.post%40n3.nabble.com](https://groups.google.com/d/msgid/elasticsearch/1398858141001-4055094.post%40n3.nabble.com)  
> .  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAGCwEM9wNcC82OWm3e-0g6yYWrNJaQgT-WcvmM\_yrQMn8v97%2Bw%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAGCwEM9wNcC82OWm3e-0g6yYWrNJaQgT-WcvmM_yrQMn8v97%2Bw%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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, 1:31am UTC](https://discuss.elastic.co/t/relationship-between-no-of-nodes-shards-and-replica/17280/3 "2017-07-06T01:31:44Z")

</div>


