# How index data of shard or replicat migrates from one node to other node when relocation of shard or replica?

**URL:** <https://discuss.elastic.co/t/how-index-data-of-shard-or-replicat-migrates-from-one-node-to-other-node-when-relocation-of-shard-or-replica/9468>\
**Category:** Elasticsearch\
**Created:** [October 25, 2012, 7:01am UTC](https://discuss.elastic.co/t/how-index-data-of-shard-or-replicat-migrates-from-one-node-to-other-node-when-relocation-of-shard-or-replica/9468 "2012-10-25T07:01:41Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![SuoNayi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/suonayi/32/2569_2.png) [@SuoNayi](https://discuss.elastic.co/u/SuoNayi)\
**Post date:** [October 25, 2012, 7:01am UTC](https://discuss.elastic.co/t/how-index-data-of-shard-or-replicat-migrates-from-one-node-to-other-node-when-relocation-of-shard-or-replica/9468/1 "2012-10-25T07:01:41Z")

</div>

Hi all,  
With reading about the source code of elasticsearch,I (a beginner  
with ES) cannot easily figure out the whole flow.  
I cannot find out how index data of shard or replicat migrates from one  
node to other node when relocation of shard or replica.  
Thanks for any tips or pointers.

SuoNayi

--

---

<div class="post-metadata">

**Author:** ![Itamar\_Syn\_Hershko](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/itamar_syn_hershko/32/725_2.png) [@Itamar\_Syn\_Hershko](https://discuss.elastic.co/u/Itamar_Syn_Hershko)\
**Post date:** [October 25, 2012, 7:06am UTC](https://discuss.elastic.co/t/how-index-data-of-shard-or-replicat-migrates-from-one-node-to-other-node-when-relocation-of-shard-or-replica/9468/2 "2012-10-25T07:06:45Z")

</div>

See

> **[Elasticsearch Platform — Find real-time answers at scale](https://www.elastic.co)**
>
> Power insights and outcomes with the Elasticsearch Platform and AI. See into your data and find answers that matter with enterprise solutions designed to help you build, observe, and protect. Try Elasticsearch free today.

On Thu, Oct 25, 2012 at 9:01 AM, SuoNayi [suonayi@gmail.com](mailto:suonayi@gmail.com) wrote:

> Hi all,  
> With reading about the source code of elasticsearch,I (a beginner  
> with ES) cannot easily figure out the whole flow.  
> I cannot find out how index data of shard or replicat migrates from one  
> node to other node when relocation of shard or replica.  
> Thanks for any tips or pointers.
> 
> SuoNayi
> 
> --

--

---

<div class="post-metadata">

**Author:** ![SuoNayi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/suonayi/32/2569_2.png) [@SuoNayi](https://discuss.elastic.co/u/SuoNayi)\
**Post date:** [October 25, 2012, 9:33am UTC](https://discuss.elastic.co/t/how-index-data-of-shard-or-replicat-migrates-from-one-node-to-other-node-when-relocation-of-shard-or-replica/9468/3 "2012-10-25T09:33:27Z")

</div>

I want to know which class is responsible for migrating index data from one  
node to other node.

Thanks.

在 2012年10月25日星期四UTC+8下午3时06分52秒，Itamar Syn-Hershko写道：

> See  
> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/videos/2011/08/09/road-to-a-distributed-searchengine-berlinbuzzwords.html)
> 
> On Thu, Oct 25, 2012 at 9:01 AM, SuoNayi \<[suo...@gmail.com](mailto:suo...@gmail.com) \<javascript:\>\>wrote:
> 
> > Hi all,  
> > With reading about the source code of elasticsearch,I (a beginner  
> > with ES) cannot easily figure out the whole flow.  
> > I cannot find out how index data of shard or replicat migrates from one  
> > node to other node when relocation of shard or replica.  
> > Thanks for any tips or pointers.
> > 
> > SuoNayi
> > 
> > --

--

---

<div class="post-metadata">

**Author:** ![Igor\_Motov](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/igor_motov/32/45193_2.png) [@Igor\_Motov](https://discuss.elastic.co/u/Igor_Motov)\
**Post date:** [October 25, 2012, 11:41am UTC](https://discuss.elastic.co/t/how-index-data-of-shard-or-replicat-migrates-from-one-node-to-other-node-when-relocation-of-shard-or-replica/9468/4 "2012-10-25T11:41:55Z")

</div>

That's somewhat complicated, involves many different classes and probably  
not the best place to start learning about ES. Are you trying to resolve  
some particular issue or just curious about how things work? To answer your  
question, if you are interested in the actual process of moving index  
pieces from one node to another you take a look at RecoveryTarget and  
RecoverySource in the org.elasticsearch.indices.recovery package.

On Thursday, October 25, 2012 5:33:28 AM UTC-4, SuoNayi wrote:

> I want to know which class is responsible for migrating index data from  
> one node to other node.
> 
> Thanks.
> 
> 在 2012年10月25日星期四UTC+8下午3时06分52秒，Itamar Syn-Hershko写道：
> 
> > See  
> > [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/videos/2011/08/09/road-to-a-distributed-searchengine-berlinbuzzwords.html)
> > 
> > On Thu, Oct 25, 2012 at 9:01 AM, SuoNayi [suo...@gmail.com](mailto:suo...@gmail.com) wrote:
> > 
> > > Hi all,  
> > > With reading about the source code of elasticsearch,I (a beginner  
> > > with ES) cannot easily figure out the whole flow.  
> > > I cannot find out how index data of shard or replicat migrates from one  
> > > node to other node when relocation of shard or replica.  
> > > Thanks for any tips or pointers.
> > > 
> > > SuoNayi
> > > 
> > > --

--

---

<div class="post-metadata">

**Author:** ![SuoNayi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/suonayi/32/2569_2.png) [@SuoNayi](https://discuss.elastic.co/u/SuoNayi)\
**Post date:** [October 26, 2012, 7:48am UTC](https://discuss.elastic.co/t/how-index-data-of-shard-or-replicat-migrates-from-one-node-to-other-node-when-relocation-of-shard-or-replica/9468/5 "2012-10-26T07:48:16Z")

</div>

Yes, I'm curious about how things work.It seems developer guide or  
references is missing.

在 2012年10月25日星期四UTC+8下午7时41分55秒，Igor Motov写道：

> That's somewhat complicated, involves many different classes and probably  
> not the best place to start learning about ES. Are you trying to resolve  
> some particular issue or just curious about how things work? To answer your  
> question, if you are interested in the actual process of moving index  
> pieces from one node to another you take a look at RecoveryTarget and  
> RecoverySource in the org.elasticsearch.indices.recovery package.
> 
> On Thursday, October 25, 2012 5:33:28 AM UTC-4, SuoNayi wrote:
> 
> > I want to know which class is responsible for migrating index data from  
> > one node to other node.
> > 
> > Thanks.
> > 
> > 在 2012年10月25日星期四UTC+8下午3时06分52秒，Itamar Syn-Hershko写道：
> > 
> > > See  
> > > [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/videos/2011/08/09/road-to-a-distributed-searchengine-berlinbuzzwords.html)
> > > 
> > > On Thu, Oct 25, 2012 at 9:01 AM, SuoNayi [suo...@gmail.com](mailto:suo...@gmail.com) wrote:
> > > 
> > > > Hi all,  
> > > > With reading about the source code of elasticsearch,I (a  
> > > > beginner with ES) cannot easily figure out the whole flow.  
> > > > I cannot find out how index data of shard or replicat migrates from one  
> > > > node to other node when relocation of shard or replica.  
> > > > Thanks for any tips or pointers.
> > > > 
> > > > SuoNayi
> > > > 
> > > > --

--

---

<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:** [July 6, 2017, 3:07am UTC](https://discuss.elastic.co/t/how-index-data-of-shard-or-replicat-migrates-from-one-node-to-other-node-when-relocation-of-shard-or-replica/9468/6 "2017-07-06T03:07:08Z")

</div>

Closed on July 6, 2017, 3:07am UTC


