# Set target nodes where shards are created to?

**URL:** <https://discuss.elastic.co/t/set-target-nodes-where-shards-are-created-to/151329>\
**Category:** Elasticsearch\
**Created:** [October 7, 2018, 12:06am UTC](https://discuss.elastic.co/t/set-target-nodes-where-shards-are-created-to/151329 "2018-10-07T00:06:00Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![af615dbd55cac2cacf32](https://avatars.discourse-cdn.com/v4/letter/a/9fc348/32.png) [@af615dbd55cac2cacf32](https://discuss.elastic.co/u/af615dbd55cac2cacf32)\
**Post date:** [October 7, 2018, 12:06am UTC](https://discuss.elastic.co/t/set-target-nodes-where-shards-are-created-to/151329/1 "2018-10-07T00:06:00Z")

</div>

hello,  
i have one question about shard location.

**Situation:**  
we do have currently 6data nodes as 6 VMs (virtual machine) on 3 actual hosts(each host currently have 1 hot node and 1warm node). we are planning to add 52 data nodes by adding 13 actual hosts (each host will have 2 hot and 2warm nodes; 2_2_13=52).  
currently we set primary=5 & replica=1, and would continue with this setting. but concern is if some shards are located in a specific host duplicately, then that host is down.  
\_e.g. \_  
_vm1(host1): p0_  
_vm2(host1): p1, r0_  
_..._  
_vm7(host4): r1_  
_..._  
_vm9(host5): p3_  
_vm10(host5): p2,r4_  
_..._  
_vm16(host08): p5_  
_..._  
_vm28(host14):r2_  
_..._  
_vm32(host16):r3_  
_..._

in case the host01 server is down, we will lose p0, p1 and r0 shards, then there are no primary nor replicas to recover. they are not on the same node, so this scenario is possible. right?

**Question:**

- can we set target nodes where the shards should be created? or should not be created? if so, is it possible that behavior works automatically?

if my understanding or question was wrong, please correct me.

thank you!

---

<div class="post-metadata">

**Author:** ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)\
**Post date:** [October 7, 2018, 6:28am UTC](https://discuss.elastic.co/t/set-target-nodes-where-shards-are-created-to/151329/2 "2018-10-07T06:28:34Z")

</div>

[Shard allocation awareness](https://www.elastic.co/guide/en/elasticsearch/reference/current/allocation-awareness.html) sounds like the feature you are looking for.

---

<div class="post-metadata">

**Author:** ![af615dbd55cac2cacf32](https://avatars.discourse-cdn.com/v4/letter/a/9fc348/32.png) [@af615dbd55cac2cacf32](https://discuss.elastic.co/u/af615dbd55cac2cacf32)\
**Post date:** [October 7, 2018, 7:04am UTC](https://discuss.elastic.co/t/set-target-nodes-where-shards-are-created-to/151329/3 "2018-10-07T07:04:14Z")

</div>

wow! you guys are awesome! thank you!

---

<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:** [November 4, 2018, 7:04am UTC](https://discuss.elastic.co/t/set-target-nodes-where-shards-are-created-to/151329/4 "2018-11-04T07:04:15Z")

</div>

Closed on November 4, 2018, 7:04am UTC

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