# Index partition strategy

**URL:** <https://discuss.elastic.co/t/index-partition-strategy/2835>\
**Category:** Elasticsearch\
**Created:** [March 4, 2010, 12:31pm UTC](https://discuss.elastic.co/t/index-partition-strategy/2835 "2010-03-04T12:31:31Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Valerio](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/valerio/32/3362_2.png) [@Valerio](https://discuss.elastic.co/u/Valerio)\
**Post date:** [March 4, 2010, 12:31pm UTC](https://discuss.elastic.co/t/index-partition-strategy/2835/1 "2010-03-04T12:31:31Z")

</div>

Hello,  
can you provide some technical details about how indexes are  
partitioned on nodes ?

Thanks,  
Valerio

---

<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:** [March 4, 2010, 12:59pm UTC](https://discuss.elastic.co/t/index-partition-strategy/2835/2 "2010-03-04T12:59:50Z")

</div>

Sure. Each index is broken down into shards, each shard can have 0 or more  
replicas. Each index can have a different number of shards (and replicas)  
exposed through the create index API. When a node comes up, shards are  
allocated to it either by relocating them from existing nodes, or simply  
creating them if they were not previously allocated. It is ensured that a  
specific shard and its replica will not be created on the same node (later  
versions will provide more control to not allocated them on the same rack  
and so on).

In terms of clustering model, there is a single master in the cluster  
(automatically elected), which controls the shards allocation.

Is this what you were after?  
-shay.banon

On Thu, Mar 4, 2010 at 2:31 PM, Valerio Schiavoni \<  
[valerio.schiavoni@gmail.com](mailto:valerio.schiavoni@gmail.com)\> wrote:

> Hello,  
> can you provide some technical details about how indexes are  
> partitioned on nodes ?
> 
> Thanks,  
> Valerio

---

<div class="post-metadata">

**Author:** ![Valerio](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/valerio/32/3362_2.png) [@Valerio](https://discuss.elastic.co/u/Valerio)\
**Post date:** [March 4, 2010, 1:47pm UTC](https://discuss.elastic.co/t/index-partition-strategy/2835/3 "2010-03-04T13:47:58Z")

</div>

Hello Shay,  
thanks for the quick reply, which got me even more interested.

I am particularly interested in the allocation strategy of shrads.

Which is the strategy to choose a node responsible for a shard ?  
How shrad replicas are placed ?  
Do you react in case the number of replicas for a given shrad fall

thanks,  
valerio

On Thu, Mar 4, 2010 at 1:59 PM, Shay Banon [shay.banon@elasticsearch.com](mailto:shay.banon@elasticsearch.com)wrote:

> Sure. Each index is broken down into shards, each shard can have 0 or more  
> replicas. Each index can have a different number of shards (and replicas)  
> exposed through the create index API. When a node comes up, shards are  
> allocated to it either by relocating them from existing nodes, or simply  
> creating them if they were not previously allocated. It is ensured that a  
> specific shard and its replica will not be created on the same node (later  
> versions will provide more control to not allocated them on the same rack  
> and so on).
> 
> In terms of clustering model, there is a single master in the cluster  
> (automatically elected), which controls the shards allocation.

---

<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:** [March 4, 2010, 2:01pm UTC](https://discuss.elastic.co/t/index-partition-strategy/2835/4 "2010-03-04T14:01:24Z")

</div>

Hey,

Shards are allocated in an even manner between nodes. Specific shard  
replicas are only placed on nodes that have no other instance of that shard  
running. If a node fails, then its is detected and the shards allocated on  
it are reallocated to other nodes.

-shay.banon

On Thu, Mar 4, 2010 at 3:47 PM, Valerio Schiavoni \<  
[valerio.schiavoni@gmail.com](mailto:valerio.schiavoni@gmail.com)\> wrote:

> Hello Shay,  
> thanks for the quick reply, which got me even more interested.
> 
> I am particularly interested in the allocation strategy of shrads.
> 
> Which is the strategy to choose a node responsible for a shard ?  
> How shrad replicas are placed ?  
> Do you react in case the number of replicas for a given shrad fall
> 
> thanks,  
> valerio
> 
> On Thu, Mar 4, 2010 at 1:59 PM, Shay Banon [shay.banon@elasticsearch.com](mailto:shay.banon@elasticsearch.com)wrote:
> 
> > Sure. Each index is broken down into shards, each shard can have 0 or more  
> > replicas. Each index can have a different number of shards (and replicas)  
> > exposed through the create index API. When a node comes up, shards are  
> > allocated to it either by relocating them from existing nodes, or simply  
> > creating them if they were not previously allocated. It is ensured that a  
> > specific shard and its replica will not be created on the same node (later  
> > versions will provide more control to not allocated them on the same rack  
> > and so on).
> > 
> > In terms of clustering model, there is a single master in the cluster  
> > (automatically elected), which controls the shards allocation.

---

<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:25am UTC](https://discuss.elastic.co/t/index-partition-strategy/2835/5 "2017-07-06T04:25:28Z")

</div>


