# Moving Index/Shards from One Node to Another

**URL:** <https://discuss.elastic.co/t/moving-index-shards-from-one-node-to-another/19254>\
**Category:** Elasticsearch\
**Created:** [August 13, 2014, 1:08pm UTC](https://discuss.elastic.co/t/moving-index-shards-from-one-node-to-another/19254 "2014-08-13T13:08:19Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ElasticSearch\_Users\_](https://avatars.discourse-cdn.com/v4/letter/e/b4bc9f/32.png) [@ElasticSearch\_Users\_](https://discuss.elastic.co/u/ElasticSearch_Users_)\
**Post date:** [August 13, 2014, 1:08pm UTC](https://discuss.elastic.co/t/moving-index-shards-from-one-node-to-another/19254/1 "2014-08-13T13:08:19Z")

</div>

Hi,

Lets say I have a 3 node cluster and I deploy one index SPECIFIC to every  
data node in the cluster.  
So, index1 goes to node1, index2 goes to node2, etc. using the  
routing.allocation settings based on node.zone etc. config properties.  
There may be 5-6 shards per index, but no replicas. All three indices,  
index 1/2/3 will have the same mapping schemas.

Now, if the following scenarios occur:

1.] One node, node2, goes down:  
How can I get the node 2's index, index2, live on the other two data nodes?  
Can I just copy the data directory to the other nodes? Since there is no  
mapping like index2 defined on those nodes, will I have to first create the  
mapping there?  
Can I move half the shards to each remaining node?

2.] Assume one more node is now added to this cluster:  
Can I copy the mapping schema to the new node and selectively copy 1-2  
shards each from the existing 3 data nodes so that I can rebalance the  
cluster 3-4 shards per index per node?

I am not sure if there is this level of control and how it is exposed.  
Please let me know. Thanks,

Thanks,  
Sandeep

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/9a5eca15-401d-4aae-ad62-ef39a78d863f%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/9a5eca15-401d-4aae-ad62-ef39a78d863f%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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:** [August 13, 2014, 11:16pm UTC](https://discuss.elastic.co/t/moving-index-shards-from-one-node-to-another/19254/2 "2014-08-13T23:16:16Z")

</div>

Mappings aren't saved to a specific node, so you don't need to worry about  
that.  
You may be able to physically copy the data across and have it recover, but  
you should test this.

With out more information I'd question why you want to do this. ES handles  
allocation itself perfectly fine and not running replicas is risky,  
especially if you are forcing the entire index onto one instance.

Regards,  
Mark Walkom

Infrastructure Engineer  
Campaign Monitor  
email: [markw@campaignmonitor.com](mailto:markw@campaignmonitor.com)  
web: [www.campaignmonitor.com](http://www.campaignmonitor.com)

On 13 August 2014 23:08, 'Sandeep Ramesh Khanzode' via elasticsearch \<  
[elasticsearch@googlegroups.com](mailto:elasticsearch@googlegroups.com)\> wrote:

> Hi,
> 
> Lets say I have a 3 node cluster and I deploy one index SPECIFIC to every  
> data node in the cluster.  
> So, index1 goes to node1, index2 goes to node2, etc. using the  
> routing.allocation settings based on node.zone etc. config properties.  
> There may be 5-6 shards per index, but no replicas. All three indices,  
> index 1/2/3 will have the same mapping schemas.
> 
> Now, if the following scenarios occur:
> 
> 1.] One node, node2, goes down:  
> How can I get the node 2's index, index2, live on the other two data nodes?  
> Can I just copy the data directory to the other nodes? Since there is no  
> mapping like index2 defined on those nodes, will I have to first create the  
> mapping there?  
> Can I move half the shards to each remaining node?
> 
> 2.] Assume one more node is now added to this cluster:  
> Can I copy the mapping schema to the new node and selectively copy 1-2  
> shards each from the existing 3 data nodes so that I can rebalance the  
> cluster 3-4 shards per index per node?
> 
> I am not sure if there is this level of control and how it is exposed.  
> Please let me know. Thanks,
> 
> Thanks,  
> Sandeep
> 
> --  
> You received this message because you are subscribed to the Google Groups  
> "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/9a5eca15-401d-4aae-ad62-ef39a78d863f%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/9a5eca15-401d-4aae-ad62-ef39a78d863f%40googlegroups.com)  
> [https://groups.google.com/d/msgid/elasticsearch/9a5eca15-401d-4aae-ad62-ef39a78d863f%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/9a5eca15-401d-4aae-ad62-ef39a78d863f%40googlegroups.com?utm_medium=email&utm_source=footer)  
> .  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAEM624YNKYL3x4tm\_9QJBVR4iHw4rW50tYLpMqAoX%2BOeSS63zg%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAEM624YNKYL3x4tm_9QJBVR4iHw4rW50tYLpMqAoX%2BOeSS63zg%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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, 1:08am UTC](https://discuss.elastic.co/t/moving-index-shards-from-one-node-to-another/19254/3 "2017-07-06T01:08:45Z")

</div>


