# Elasticsearch index placement on specific nodes

**URL:** https://discuss.elastic.co/t/elasticsearch-index-placement-on-specific-nodes/356875
**Category:** Elasticsearch
**Created:** [April 5, 2024, 2:09pm UTC](https://discuss.elastic.co/t/elasticsearch-index-placement-on-specific-nodes/356875 "2024-04-05T14:09:22Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![jaykb77](https://avatars.discourse-cdn.com/v4/letter/j/ac8455/32.png) [@jaykb77](https://discuss.elastic.co/u/jaykb77)
#### Post date: [April 5, 2024, 2:09pm UTC](https://discuss.elastic.co/t/elasticsearch-index-placement-on-specific-nodes/356875/1 "2024-04-05T14:09:22Z")

</div>

Hi all,

I know that we can set 'cluster.routing.allocation.awareness.attributes' to route shards and replicas based on this configuration. However, I need a configuration where indices created with a specific template, say with name test\_index\_\<date\>, and its replicas be allocated to only a specific set of nodes and not on others.

For example, if i have node1-node5 in a cluster, I want the shards replicas of test\_index\_\<date\> to be only allocated to node4 and node5. Is this possible?

---

<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: [April 5, 2024, 2:17pm UTC](https://discuss.elastic.co/t/elasticsearch-index-placement-on-specific-nodes/356875/2 "2024-04-05T14:17:10Z")

</div>

You can place all shards belonging to an index on a specific set of nodes through [shard allocation filtering](https://www.elastic.co/guide/en/elasticsearch/reference/8.13/shard-allocation-filtering.html) but you can not control where primaries or replicas within an index go.

What is the high level problem you are trying to solve?

---

<div class="post-metadata">

### Author: ![jaykb77](https://avatars.discourse-cdn.com/v4/letter/j/ac8455/32.png) [@jaykb77](https://discuss.elastic.co/u/jaykb77)
#### Post date: [April 6, 2024, 5:09am UTC](https://discuss.elastic.co/t/elasticsearch-index-placement-on-specific-nodes/356875/3 "2024-04-06T05:09:23Z")

</div>

We have some indices, say index\_type1 that get queries from automation and sometimes faulty automation or excessive querying result in huge resource usage on the nodes where these indices are allocated.

We also have some other indices, say index\_type2, that another application uses for searching from UI. We want to avoid the impact of above mentioned automation and related problems on the UI searches. So if we could have them on separate nodes, I think it would limit the problem to only the automation related indices.

---

<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: [April 6, 2024, 7:17am UTC](https://discuss.elastic.co/t/elasticsearch-index-placement-on-specific-nodes/356875/4 "2024-04-06T07:17:38Z")

</div>

You can use the shard allocation filtering I linked to to designate some nodes as `zone1` and other nodes as `zone2`. You can then place indices (primaries and replicas) in one of these zones and that way ensure they do not overlap and affect eachother.

---

<div class="post-metadata">

### Author: ![jaykb77](https://avatars.discourse-cdn.com/v4/letter/j/ac8455/32.png) [@jaykb77](https://discuss.elastic.co/u/jaykb77)
#### Post date: [April 6, 2024, 8:54am UTC](https://discuss.elastic.co/t/elasticsearch-index-placement-on-specific-nodes/356875/5 "2024-04-06T08:54:41Z")

</div>

Great this sounds like the right solution for us. Sometimes its difficult to find the right solution in a sea of different features and documentation we have. Appreciate all your inputs 🤝
