# Primary and Replica Shard on the same node

**URL:** <https://discuss.elastic.co/t/primary-and-replica-shard-on-the-same-node/145213>\
**Category:** Elasticsearch\
**Created:** [August 20, 2018, 5:26pm UTC](https://discuss.elastic.co/t/primary-and-replica-shard-on-the-same-node/145213 "2018-08-20T17:26:46Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jibsonline](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jibsonline/32/63154_2.png) [@jibsonline](https://discuss.elastic.co/u/jibsonline)\
**Post date:** [August 20, 2018, 5:26pm UTC](https://discuss.elastic.co/t/primary-and-replica-shard-on-the-same-node/145213/1 "2018-08-20T17:26:46Z")

</div>

Is it possible to run replica and primary shard on a single node. I have mounted three volumes and configured the same in `data.path`. I tried adding replicas with

```
PUT /_settings
{
    "index" : {
        "number_of_replicas" : 2
    }
}

```

But my cluster state turned yellow and replicas were not added. How can I achieve this?

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [August 20, 2018, 5:49pm UTC](https://discuss.elastic.co/t/primary-and-replica-shard-on-the-same-node/145213/2 "2018-08-20T17:49:06Z")

</div>

No, Elasticsearch will never allocate primary and replica on the same node, and I do not think there is any way to override that.

---

<div class="post-metadata">

**Author:** ![jibsonline](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jibsonline/32/63154_2.png) [@jibsonline](https://discuss.elastic.co/u/jibsonline)\
**Post date:** [August 20, 2018, 6:55pm UTC](https://discuss.elastic.co/t/primary-and-replica-shard-on-the-same-node/145213/3 "2018-08-20T18:55:23Z")

</div>

Thanks for the update.

---

<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:** [September 17, 2018, 6:55pm UTC](https://discuss.elastic.co/t/primary-and-replica-shard-on-the-same-node/145213/4 "2018-09-17T18:55:39Z")

</div>

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