# Assign primary shards to specifc set of nodes

**URL:** <https://discuss.elastic.co/t/assign-primary-shards-to-specifc-set-of-nodes/139120>\
**Category:** Elasticsearch\
**Created:** [July 9, 2018, 9:23am UTC](https://discuss.elastic.co/t/assign-primary-shards-to-specifc-set-of-nodes/139120 "2018-07-09T09:23:32Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Figedi](https://avatars.discourse-cdn.com/v4/letter/f/f475e1/32.png) [@Figedi](https://discuss.elastic.co/u/Figedi)\
**Post date:** [July 9, 2018, 9:23am UTC](https://discuss.elastic.co/t/assign-primary-shards-to-specifc-set-of-nodes/139120/1 "2018-07-09T09:23:32Z")

</div>

Hey there,

I have an ES 6.2 cluster consisting of preemptible and non-preemptible-nodes on gcloud (preemptible nodes can re-start at any point in time). The idea here is to have a (smaller) set of nodes which do not restart and a larger set of nodes which can restart. To ensure data-correctness, the non-preemptible nodes should always contain all primary-shards, thus always guaranteeing availability of the full-dataset. Replica-shards may go to any node (as long as it is balanced).

I did however, not find any setting which differentiates for shard-allocation based on it being a primary or a duplicate shard. Shard-Allocation seems to only work index-based, not shard-based.

Is it possible to assign primary-shards only to a specific set of nodes?

---

<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:** [July 9, 2018, 9:26am UTC](https://discuss.elastic.co/t/assign-primary-shards-to-specifc-set-of-nodes/139120/2 "2018-07-09T09:26:07Z")

</div>

No, it is not possible to control placement of primary shards. Elasticsearch can promote any replica to primary when needed, so this can change over time.

---

<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:** [August 6, 2018, 9:26am UTC](https://discuss.elastic.co/t/assign-primary-shards-to-specifc-set-of-nodes/139120/3 "2018-08-06T09:26:10Z")

</div>

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