Relationship between No of nodes , shards and replica


(Prashant Agrawal) #1

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?


(Alexander Reelsen) #2

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> 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
Sent from the ElasticSearch Users mailing list archive at 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.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/1398858141001-4055094.post%40n3.nabble.com
.
For more options, visit 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.
To view this discussion on the web visit 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.


(system) #3