Shard placement in a cluster

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/ :: Solr - Lucene - Nutch

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/ :: Solr - Lucene - Nutch