# Replicate Data

**URL:** https://discuss.elastic.co/t/replicate-data/98849
**Category:** Elasticsearch
**Created:** [August 30, 2017, 11:51am UTC](https://discuss.elastic.co/t/replicate-data/98849 "2017-08-30T11:51:04Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![Ayman\_ANIKAD](https://avatars.discourse-cdn.com/v4/letter/a/b5a626/32.png) [@Ayman\_ANIKAD](https://discuss.elastic.co/u/Ayman_ANIKAD)
#### Post date: [August 30, 2017, 11:51am UTC](https://discuss.elastic.co/t/replicate-data/98849/1 "2017-08-30T11:51:04Z")

</div>

Hello ,  
A folder (index) have been deleted from a node : /data3/data/es/esdartyprd/nodes/0/indices/enc\_idx/2/index )

I can see that data are missed for primary shard in this node (node1) =\>  
for this index , here what gives me the command curl -XGET [http://localhost:9200/\_cat/shards](http://localhost:9200/_cat/shards)

enc\_idx 2 p STARTED 57824815 28.8gb 10.135.8.201 HDPESPRD1  
enc\_idx 2 r STARTED 57824815 36.5gb 10.135.8.202 HDPESPRD2  
enc\_idx 2 r STARTED 57824815 36.5gb 10.135.10.15 HDPESPRA1  
enc\_idx 2 r STARTED 57824815 36.5gb 10.135.8.203 HDPESPRD3  
enc\_idx 2 r UNASSIGNED

You can see that data are missed in the node1 which is master ! And still have problem to assign data to node4

Any possibility to recover or replicate missed data from replicate shards ? Is that done automatically? Any solutions to assign the shard which is not assigned ? In the log I find an error that a file is corrupted from this folder :

[enc\_idx][2] Corrupted index [corrupted\_1ytPPpKkTZCGG\_zQcbBG-w] caused by: CorruptIndexException[codec footer mismatch: actual footer=1063427 vs expected footer=-1071082520 (resource: NIOFSIndexInput(path="/data3/data/es/esdartyprd/nodes/0/indices/enc\_idx/2/index/\_3gv6\_es090\_0.pos"))]

---

<div class="post-metadata">

### Author: ![thiago](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/thiago/32/32096_2.png) [@thiago](https://discuss.elastic.co/u/thiago)
#### Post date: [August 31, 2017, 2:21am UTC](https://discuss.elastic.co/t/replicate-data/98849/2 "2017-08-31T02:21:41Z")

</div>

That index corruption seems really awful. Maybe it's not possible to recover.

You could try updating index settings with `number_of_replicas: 0`, so Elasticsearch will delete all replicas, including the one with problems. And then restore back to 4 replicas and check if they all get assigned after fully replicating.

---

<div class="post-metadata">

### Author: ![Ayman\_ANIKAD](https://avatars.discourse-cdn.com/v4/letter/a/b5a626/32.png) [@Ayman\_ANIKAD](https://discuss.elastic.co/u/Ayman_ANIKAD)
#### Post date: [August 31, 2017, 8:28am UTC](https://discuss.elastic.co/t/replicate-data/98849/3 "2017-08-31T08:28:19Z")

</div>

Thank you @thiago . In fact , the index which was corrupted, is the index that we deleted from the path :/data3/data/es/esdartyprd/nodes/0/indices/enc\_idx/2/index . This deleting was from the primary shard in the master node (node1), and even that we have always problems to reroute the shard, and we get the same error of index corruption.  
My proposition :  
1- Shut down the cluster.  
2- Change the master node to the node 2  
3- Reboot ElasticSearch  
That will give the hand to node 2 to be the primary shard , and so others shard will be replicated and assigned to other nodes.  
What do you think ? Have a comment or an other solution ?

---

<div class="post-metadata">

### Author: ![thiago](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/thiago/32/32096_2.png) [@thiago](https://discuss.elastic.co/u/thiago)
#### Post date: [August 31, 2017, 9:38am UTC](https://discuss.elastic.co/t/replicate-data/98849/4 "2017-08-31T09:38:41Z")

</div>

Take the node where the primary shards are down. Hopefully Elasticsearch will promote another one as primary.

---

<div class="post-metadata">

### Author: ![Ayman\_ANIKAD](https://avatars.discourse-cdn.com/v4/letter/a/b5a626/32.png) [@Ayman\_ANIKAD](https://discuss.elastic.co/u/Ayman_ANIKAD)
#### Post date: [August 31, 2017, 9:40am UTC](https://discuss.elastic.co/t/replicate-data/98849/5 "2017-08-31T09:40:59Z")

</div>

@thiago : Normally, that what should be happen no ?

---

<div class="post-metadata">

### Author: ![thiago](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/thiago/32/32096_2.png) [@thiago](https://discuss.elastic.co/u/thiago)
#### Post date: [August 31, 2017, 9:42am UTC](https://discuss.elastic.co/t/replicate-data/98849/6 "2017-08-31T09:42:59Z")

</div>

Yes. It's what it is expected. But, to be honest, I am not fully aware of the current state of your cluster. That would require running a diagnostics tool, but this is only done under a Support subscription.

---

<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: [September 28, 2017, 9:43am UTC](https://discuss.elastic.co/t/replicate-data/98849/7 "2017-09-28T09:43:02Z")

</div>

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