# Distributed Search / Replication - some questions for a better understanding

**URL:** <https://discuss.elastic.co/t/distributed-search-replication-some-questions-for-a-better-understanding/4430>\
**Category:** Elasticsearch\
**Created:** [May 18, 2011, 12:15pm UTC](https://discuss.elastic.co/t/distributed-search-replication-some-questions-for-a-better-understanding/4430 "2011-05-18T12:15:14Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![maho](https://avatars.discourse-cdn.com/v4/letter/m/4da419/32.png) [@maho](https://discuss.elastic.co/u/maho)\
**Post date:** [May 18, 2011, 12:15pm UTC](https://discuss.elastic.co/t/distributed-search-replication-some-questions-for-a-better-understanding/4430/1 "2011-05-18T12:15:14Z")

</div>

hi,

1. Does Elasticsearch use a Master-/Slave Replication or a Multi-  
Master Replication?

2. If Elasticsearch uses Master-/Slave Replication: How can i know  
which instance is the master?

3. Has Elasticsearch an integrated load balancer - If yes, does it  
matter which instance i use for queries?

Thanks.

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [May 19, 2011, 11:34am UTC](https://discuss.elastic.co/t/distributed-search-replication-some-questions-for-a-better-understanding/4430/2 "2011-05-19T11:34:47Z")

</div>

A cluster in elasticsearch elects a single node as the master node. The master node is only responsible for cluster level operations and reacting to cluster changes (initiate shard rebalancing when a snode comes and goes for example).

Each index is broken down into shards. Each shard can have 0 or more replicas. When an index is created and shards are allocated, a primary shard between a shard replication group is elected. Primary shards are used for "dirty" operation since they funnel into them and the replicates to the replicas. When a node holding a primary shard is removed, one of its replicas will become the primary, and reallocation will happen.

Load balancing wise, if you hit the same node in the cluster with search requests, then they will be spread across all the shards and replicas. It is recommended to do some round robin between the nodes you hit just to get better network behavior.

-shay.banon  
On Wednesday, May 18, 2011 at 3:15 PM, maho wrote:  
hi,

> 1. Does Elasticsearch use a Master-/Slave Replication or a Multi-  
> Master Replication?
> 
> 2. If Elasticsearch uses Master-/Slave Replication: How can i know  
> which instance is the master?
> 
> 3. Has Elasticsearch an integrated load balancer - If yes, does it  
> matter which instance i use for queries?
> 
> Thanks.

---

<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, 4:05am UTC](https://discuss.elastic.co/t/distributed-search-replication-some-questions-for-a-better-understanding/4430/3 "2017-07-06T04:05:51Z")

</div>


