# How to speed up move es node migration to another machine

**URL:** <https://discuss.elastic.co/t/how-to-speed-up-move-es-node-migration-to-another-machine/300913>\
**Category:** Elastic Cloud on Kubernetes (ECK)\
**Created:** [March 29, 2022, 5:05am UTC](https://discuss.elastic.co/t/how-to-speed-up-move-es-node-migration-to-another-machine/300913 "2022-03-29T05:05:25Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![dalei2019](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dalei2019/32/92374_2.png) [@dalei2019](https://discuss.elastic.co/u/dalei2019)\
**Post date:** [March 29, 2022, 5:05am UTC](https://discuss.elastic.co/t/how-to-speed-up-move-es-node-migration-to-another-machine/300913/1 "2022-03-29T05:05:25Z")

</div>

Hi team,  
I have a 10 node es cluster created by ECK on k8s v1.22 .  
And Persistent storage uses local pv .  
For some reasons, I want to move one of the es instances to a new node.  
Because the index has opened the copy.  
I changed node affinity settings. Then delete the node directly.  
And wait for eck to reschedule.  
But it turned out that the machine had stored 500GB of data, and it took dozens of hours to reschedule calls.

My question is:

1. Is my approach correct？
2. How to speed up node migration to another machine？

Any suggestion will be very helpful for me, thanks a lot !

---

<div class="post-metadata">

**Author:** ![dalei2019](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dalei2019/32/92374_2.png) [@dalei2019](https://discuss.elastic.co/u/dalei2019)\
**Post date:** [April 1, 2022, 3:20am UTC](https://discuss.elastic.co/t/how-to-speed-up-move-es-node-migration-to-another-machine/300913/2 "2022-04-01T03:20:13Z")

</div>

+1 +1

---

<div class="post-metadata">

**Author:** ![pebrc](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pebrc/32/101790_2.png) [@pebrc](https://discuss.elastic.co/u/pebrc)\
**Post date:** [April 19, 2022, 9:31am UTC](https://discuss.elastic.co/t/how-to-speed-up-move-es-node-migration-to-another-machine/300913/3 "2022-04-19T09:31:40Z")

</div>

I am not sure I fully understand the sequence of events your are describing. I am assuming you are running your indices with replicas configured? If so, once you deleted the node the replicas should be promoted to primary, which should be almost instant.  
Elasticsearch will then start reallocating replicas for the shards that have been lost with the node you removed. This can indeed take a long time depending on the size of the indices as they recover the replica slowly from the primary.

As to whether this is right approach: local volumes on Kubernetes are tricky to manage. We have written up some thoughts in our documentation here: [Storage recommendations | Elastic Cloud on Kubernetes [master] | Elastic](https://www.elastic.co/guide/en/cloud-on-k8s/master/k8s-storage-recommendations.html)

But unless you have a way of copying the local volume to another node, I don't see another way than forcibly removing the node as you did it. This is of course not ideal because if this operation coincides with an unplanned failure of another node that holds the replicas (which are just about to become primaries) you are set up for data loss.

---

<div class="post-metadata">

**Author:** ![abrx](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/abrx/32/43881_2.png) [@abrx](https://discuss.elastic.co/u/abrx)\
**Post date:** [April 20, 2022, 1:31pm UTC](https://discuss.elastic.co/t/how-to-speed-up-move-es-node-migration-to-another-machine/300913/4 "2022-04-20T13:31:07Z")

</div>

You may speed up by adding the new node in advance, so it will take some shards as usual.

Then check the \_health of your cluster is green (so every index has primary and copy)

Then delete the old node (or first change the [shard allocation awareness](https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-cluster.html#shard-allocation-awareness) with a temporary zone to avoid going to yellow when deleting, in this case wait for the relocation of shards from the old node)

---

<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:** [May 18, 2022, 1:31pm UTC](https://discuss.elastic.co/t/how-to-speed-up-move-es-node-migration-to-another-machine/300913/5 "2022-05-18T13:31:10Z")

</div>

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