# Restore index from s3

**URL:** https://discuss.elastic.co/t/restore-index-from-s3/221042
**Category:** Elasticsearch
**Created:** [February 26, 2020, 12:34pm UTC](https://discuss.elastic.co/t/restore-index-from-s3/221042 "2020-02-26T12:34:47Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![DILIP\_SHARMA](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dilip_sharma/32/42672_2.png) [@DILIP\_SHARMA](https://discuss.elastic.co/u/DILIP_SHARMA)
#### Post date: [February 26, 2020, 12:34pm UTC](https://discuss.elastic.co/t/restore-index-from-s3/221042/1 "2020-02-26T12:34:47Z")

</div>

hi i am using ES cloud managed version .  
i did index backup to s3 using following command

> PUT /\_snapshot/hc\_es\_s3\_repository/dtoperation\_1  
> {
> 
> "indices": "dtoperation",
> 
> "ignore\_unavailable": true,
> 
> "include\_global\_state": false
> 
> }

after that i deleted the index from ES  
and did snapshot restore using below command -

> POST /\_snapshot/hc\_es\_s3\_repository/dtoperation\_1/\_restore  
> {
> 
> "indices": "dtoperation",
> 
> "ignore\_unavailable": false,
> 
> "include\_global\_state": false
> 
> }

both command was ran successfully and index is created , but index status is still red and document count is 0 .

any suggestion in this ?  
as there is no error in above steps .

thanks

---

<div class="post-metadata">

### Author: ![Armin\_Braun](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/armin_braun/32/20092_2.png) [@Armin\_Braun](https://discuss.elastic.co/u/Armin_Braun)
#### Post date: [February 26, 2020, 1:31pm UTC](https://discuss.elastic.co/t/restore-index-from-s3/221042/2 "2020-02-26T13:31:36Z")

</div>

@DILIP_SHARMA

looks like the shards in that index failed to properly restore. Can you check the [cat shards](https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-shards.html#_example_with_reasons_for_unassigned_shards) API and paste the output here so we can understand why the restore failed?

---

<div class="post-metadata">

### Author: ![DILIP\_SHARMA](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dilip_sharma/32/42672_2.png) [@DILIP\_SHARMA](https://discuss.elastic.co/u/DILIP_SHARMA)
#### Post date: [February 26, 2020, 3:21pm UTC](https://discuss.elastic.co/t/restore-index-from-s3/221042/3 "2020-02-26T15:21:07Z")

</div>

Hi Armin  
Please find output of following command -  
GET \_cat/shards/dtoperation

dtoperation 1 p UNASSIGNED  
dtoperation 1 r UNASSIGNED  
dtoperation 0 r UNASSIGNED  
dtoperation 0 p UNASSIGNED

---

<div class="post-metadata">

### Author: ![Armin\_Braun](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/armin_braun/32/20092_2.png) [@Armin\_Braun](https://discuss.elastic.co/u/Armin_Braun)
#### Post date: [February 26, 2020, 3:22pm UTC](https://discuss.elastic.co/t/restore-index-from-s3/221042/4 "2020-02-26T15:22:18Z")

</div>

@DILIP_SHARMA

we need the format from the paragraph I linked to get the reason:

```auto
GET _cat/shards?h=index,shard,prirep,state,unassigned.reason

```

🙂

---

<div class="post-metadata">

### Author: ![DILIP\_SHARMA](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dilip_sharma/32/42672_2.png) [@DILIP\_SHARMA](https://discuss.elastic.co/u/DILIP_SHARMA)
#### Post date: [February 26, 2020, 3:23pm UTC](https://discuss.elastic.co/t/restore-index-from-s3/221042/5 "2020-02-26T15:23:10Z")

</div>

> [@Armin\_Braun](#):
>
> GET \_cat/shards?h=index,shard,prirep,state,unassigned.reason

dtoperation 1 p UNASSIGNED NEW\_INDEX\_RESTORED  
dtoperation 1 r UNASSIGNED NEW\_INDEX\_RESTORED  
dtoperation 0 r UNASSIGNED NEW\_INDEX\_RESTORED  
dtoperation 0 p UNASSIGNED NEW\_INDEX\_RESTORED

---

<div class="post-metadata">

### Author: ![Armin\_Braun](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/armin_braun/32/20092_2.png) [@Armin\_Braun](https://discuss.elastic.co/u/Armin_Braun)
#### Post date: [February 26, 2020, 3:26pm UTC](https://discuss.elastic.co/t/restore-index-from-s3/221042/6 "2020-02-26T15:26:36Z")

</div>

@DILIP_SHARMA

thanks seems those shards are not getting assigned. Can you check the [allocation explain API](https://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-allocation-explain.html#cluster-allocation-explain-api-desc) to see what's going on there?

```auto
GET /_cluster/allocation/explain

```

---

<div class="post-metadata">

### Author: ![DILIP\_SHARMA](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dilip_sharma/32/42672_2.png) [@DILIP\_SHARMA](https://discuss.elastic.co/u/DILIP_SHARMA)
#### Post date: [February 26, 2020, 3:33pm UTC](https://discuss.elastic.co/t/restore-index-from-s3/221042/7 "2020-02-26T15:33:11Z")

</div>

Please find the output

> {  
> "index" : ".monitoring-alerts-7",  
> "shard" : 0,  
> "primary" : false,  
> "current\_state" : "unassigned",  
> "unassigned\_info" : {  
> "reason" : "REPLICA\_ADDED",  
> "at" : "2020-02-26T11:44:03.853Z",  
> "last\_allocation\_status" : "no\_attempt"  
> },  
> "can\_allocate" : "no",  
> "allocate\_explanation" : "cannot allocate because allocation is not permitted to any of the nodes",  
> "node\_allocation\_decisions" : [  
> {  
> "node\_id" : "_**",  
> "node\_name" : "**",  
> "transport\_address" : "_**_",  
> "node\_attributes" : {  
> "logical\_availability\_zone" : "zone-0",  
> "server\_name" : "",  
> "availability\_zone" : "ap-southeast-1a",  
> "xpack.installed" : "true",  
> "data" : "warm",  
> "instance\_configuration" : "aws.data.highstorage.d2",  
> "region" : "ap-southeast-1"  
> },  
> "node\_decision" : "no",  
> "deciders" : [  
> {  
> "decider" : "filter",  
> "decision" : "NO",  
> "explanation" : """node does not match index setting [index.routing.allocation.require] filters [data:"hot"]"""  
> },  
> {  
> "decider" : "awareness",  
> "decision" : "NO",  
> "explanation" : "there are too many copies of the shard allocated to nodes with attribute [availability\_zone], there are [2] total configured shard copies for this shard id and [2] total attribute values, expected the allocated shard count per attribute [2] to be less than or equal to the upper bound of the required number of shards per attribute [1]"  
> }  
> ]  
> },  
> {  
> "node\_id" : "",  
> "node\_name" : "_",  
> "transport\_address" : " ****",  
> "node\_attributes" : {  
> "logical\_availability\_zone" : "zone-1",  
> "server\_name" : " ****",  
> "availability\_zone" : "ap-southeast-1b",  
> "xpack.installed" : "true",  
> "data" : "hot",  
> "instance\_configuration" : "aws.data.highio.i3",  
> "region" : "ap-southeast-1"  
> },  
> "node\_decision" : "no",  
> "deciders" : [  
> {  
> "decider" : "disk\_threshold",  
> "decision" : "NO",  
> "explanation" : "the node is above the low watermark cluster setting [cluster.routing.allocation.disk.watermark.low=85%], using more disk space than the maximum allowed [85.0%], actual free: [9.611063003540039%]"  
> }  
> ]  
> },  
> {  
> "node\_id" : " ****",  
> "node\_name" : " ****",  
> "transport\_address" : " ****",  
> "node\_attributes" : {  
> "logical\_availability\_zone" : "zone-0",  
> "server\_name" : "\*\*\*\*\*",  
> "availability\_zone" : " ****",  
> "xpack.installed" : "true",  
> "data" : "hot",  
> "instance\_configuration" : "aws.data.highio.i3",  
> "region" : "ap-southeast-1"  
> },  
> "node\_decision" : "no",  
> "deciders" : [  
> {  
> "decider" : "same\_shard",  
> "decision" : "NO",  
> "explanation" : "the shard cannot be allocated to the same node on which a copy of the shard already exists [[.monitoring-alerts-7][0], node[**_], [P], s[STARTED], a[id=_\*\*]]"  
> },  
> {  
> "decider" : "disk\_threshold",  
> "decision" : "NO",  
> "explanation" : "the node is above the low watermark cluster setting [cluster.routing.allocation.disk.watermark.low=85%], using more disk space than the maximum allowed [85.0%], actual free: [12.751328945159912%]"  
> },  
> {  
> "decider" : "awareness",  
> "decision" : "NO",  
> "explanation" : "there are too many copies of the shard allocated to nodes with attribute [availability\_zone], there are [2] total configured shard copies for this shard id and [2] total attribute values, expected the allocated shard count per attribute [2] to be less than or equal to the upper bound of the required number of shards per attribute [1]"  
> }  
> ]  
> }  
> ]  
> }

---

<div class="post-metadata">

### Author: ![Armin\_Braun](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/armin_braun/32/20092_2.png) [@Armin\_Braun](https://discuss.elastic.co/u/Armin_Braun)
#### Post date: [February 26, 2020, 3:38pm UTC](https://discuss.elastic.co/t/restore-index-from-s3/221042/8 "2020-02-26T15:38:03Z")

</div>

See here:

> [@DILIP\_SHARMA](#):
>
> "explanation" : "the node is above the low watermark cluster setting [cluster.routing.allocation.disk.watermark.low=85%], using more disk space than the maximum allowed [85.0%], actual free: [9.611063003540039%]"

The shards can't be allocated (at least not with the current constraints from the allocation attributes because the relevant nodes don't have enough free disk space. You'll have to fix that so recovery of these indices can start.

---

<div class="post-metadata">

### Author: ![DILIP\_SHARMA](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dilip_sharma/32/42672_2.png) [@DILIP\_SHARMA](https://discuss.elastic.co/u/DILIP_SHARMA)
#### Post date: [February 26, 2020, 3:44pm UTC](https://discuss.elastic.co/t/restore-index-from-s3/221042/9 "2020-02-26T15:44:48Z")

</div>

ok let me check with my infra team , will get back to you with results

---

<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: [March 25, 2020, 3:44pm UTC](https://discuss.elastic.co/t/restore-index-from-s3/221042/10 "2020-03-25T15:44:53Z")

</div>

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