# Shard placement in a cluster

**URL:** https://discuss.elastic.co/t/shard-placement-in-a-cluster/6853
**Category:** Elasticsearch
**Created:** [March 1, 2012, 12:53pm UTC](https://discuss.elastic.co/t/shard-placement-in-a-cluster/6853 "2012-03-01T12:53:31Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Rafal\_Kuc\_3](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rafal_kuc_3/32/799_2.png) [@Rafal\_Kuc\_3](https://discuss.elastic.co/u/Rafal_Kuc_3)
#### Post date: [March 1, 2012, 12:53pm UTC](https://discuss.elastic.co/t/shard-placement-in-a-cluster/6853/1 "2012-03-01T12:53:31Z")

</div>

Hello,

We have 4 nodes cluster, multiple indices each having 2 shards and 2  
replicas. When creating new index, Elasticsearch puts two shards on the  
same node (not the case every time). I assumed that when having 4 nodes, I  
would have each shard (counting primaries and replicas) on different nodes.  
Is this expected behavior for Elasticsearch to place shards of the index on  
the same node instead of distributing them ?

Thanks,  
Rafał Kuć  
Sematext :: [http://sematext.com/](http://sematext.com/) :: Solr - Lucene - Nutch

---

<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 3, 2012, 9:28pm UTC](https://discuss.elastic.co/t/shard-placement-in-a-cluster/6853/2 "2012-03-03T21:28:45Z")

</div>

ElasticSEarch aims at having an even number of shards per node, regardless which index is comes from. There is a plan to get which index it comes from into the placement logic.

On Thursday, March 1, 2012 at 2:53 PM, Rafał Kuć wrote:

> Hello,
> 
> We have 4 nodes cluster, multiple indices each having 2 shards and 2 replicas. When creating new index, Elasticsearch puts two shards on the same node (not the case every time). I assumed that when having 4 nodes, I would have each shard (counting primaries and replicas) on different nodes. Is this expected behavior for Elasticsearch to place shards of the index on the same node instead of distributing them ?
> 
> Thanks,  
> Rafał Kuć  
> Sematext :: [http://sematext.com/](http://sematext.com/) :: Solr - Lucene - Nutch

---

<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, 3:37am UTC](https://discuss.elastic.co/t/shard-placement-in-a-cluster/6853/3 "2017-07-06T03:37:30Z")

</div>


