# Force shards to single node when changing phases

**URL:** https://discuss.elastic.co/t/force-shards-to-single-node-when-changing-phases/283476
**Category:** Elasticsearch
**Tags:** ilm-index-lifecycle-management
**Created:** [September 6, 2021, 6:57pm UTC](https://discuss.elastic.co/t/force-shards-to-single-node-when-changing-phases/283476 "2021-09-06T18:57:51Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![rschwa2](https://avatars.discourse-cdn.com/v4/letter/r/ed8c4c/32.png) [@rschwa2](https://discuss.elastic.co/u/rschwa2)
#### Post date: [September 6, 2021, 6:57pm UTC](https://discuss.elastic.co/t/force-shards-to-single-node-when-changing-phases/283476/1 "2021-09-06T18:57:51Z")

</div>

We have 2 warm data nodes in our cluster, and 6 shards configured for each index. When an index migrates from hot to warm, the shards are evenly distributed across both warm nodes. However we also have a shrink action confiigured in the warm phase. But before that can happen we have to relocate half the shards again since they all need to be on the same node. Is there a way to migrate from hot to warm such that all the shards for an index go to the same node?

---

<div class="post-metadata">

### Author: ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)
#### Post date: [September 6, 2021, 11:15pm UTC](https://discuss.elastic.co/t/force-shards-to-single-node-when-changing-phases/283476/2 "2021-09-06T23:15:58Z")

</div>

Welcome to our community! 😃

Elasticsearch and ILM should handle the moving of shards for you for the shrink action. Is that not happening?

---

<div class="post-metadata">

### Author: ![rschwa2](https://avatars.discourse-cdn.com/v4/letter/r/ed8c4c/32.png) [@rschwa2](https://discuss.elastic.co/u/rschwa2)
#### Post date: [September 6, 2021, 11:29pm UTC](https://discuss.elastic.co/t/force-shards-to-single-node-when-changing-phases/283476/3 "2021-09-06T23:29:23Z")

</div>

It is, it just seems wasteful to copy half the shards twice.

---

<div class="post-metadata">

### Author: ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)
#### Post date: [September 6, 2021, 11:35pm UTC](https://discuss.elastic.co/t/force-shards-to-single-node-when-changing-phases/283476/4 "2021-09-06T23:35:50Z")

</div>

Understandable.  
You could probably setup a custom policy that dropped the replicas, moved the shards to a single node, shrunk, enabled wider allocation and then add replicas back in if you wanted.

---

<div class="post-metadata">

### Author: ![rschwa2](https://avatars.discourse-cdn.com/v4/letter/r/ed8c4c/32.png) [@rschwa2](https://discuss.elastic.co/u/rschwa2)
#### Post date: [September 6, 2021, 11:48pm UTC](https://discuss.elastic.co/t/force-shards-to-single-node-when-changing-phases/283476/5 "2021-09-06T23:48:40Z")

</div>

Yeah, that doesn't sound hard but wanted to check if I was reinventing the wheel 🙂

---

<div class="post-metadata">

### Author: ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)
#### Post date: [September 6, 2021, 11:52pm UTC](https://discuss.elastic.co/t/force-shards-to-single-node-when-changing-phases/283476/6 "2021-09-06T23:52:45Z")

</div>

You kinda are, but it's a reasonable question to ask 😃

---

<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: [October 4, 2021, 11:53pm UTC](https://discuss.elastic.co/t/force-shards-to-single-node-when-changing-phases/283476/7 "2021-10-04T23:53:16Z")

</div>

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