# Cluster.routing.allocation.same\_shard.host: true not working as expected

**URL:** <https://discuss.elastic.co/t/cluster-routing-allocation-same-shard-host-true-not-working-as-expected/134496>\
**Category:** Elasticsearch\
**Created:** [June 4, 2018, 10:19pm UTC](https://discuss.elastic.co/t/cluster-routing-allocation-same-shard-host-true-not-working-as-expected/134496 "2018-06-04T22:19:14Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Matias\_Antinanco](https://avatars.discourse-cdn.com/v4/letter/m/f14d63/32.png) [@Matias\_Antinanco](https://discuss.elastic.co/u/Matias_Antinanco)\
**Post date:** [June 4, 2018, 10:19pm UTC](https://discuss.elastic.co/t/cluster-routing-allocation-same-shard-host-true-not-working-as-expected/134496/1 "2018-06-04T22:19:15Z")

</div>

Hi, I have a cluster with 29 physical servers running ElasticSearch 2.2.1. Three of the servers are dedicated master nodes and I am running 2 datanodes in each of the other servers (this is 52 datanodes in total). I am creating one index per day with 7 shards and 1 replica.

All the datanodes have the cluster.routing.allocation.same\_shard.host: true parameter in the elasticsearch.yml and the network.host parameter is the same for each datanodes pair sharing the same physical host, but for some reason I see some shards with its primary and replica allocated on the same physical server.

|index\_20180420|1|p|STARTED|248622278|35.7gb|XX.XXX.XXX.01|datanode29\_2|  
|index\_20180420|1|r|STARTED|248622278|35.7gb|XX.XXX.XXX.01|datanode29\_1|

Am i missing something here?

Of course I can fix this rerouting the shard to another server or using the shard allocation awareness, but I'd like to understand why is this happening.

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 2, 2018, 10:19pm UTC](https://discuss.elastic.co/t/cluster-routing-allocation-same-shard-host-true-not-working-as-expected/134496/2 "2018-07-02T22:19:18Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
