we somehow lost both the a shard and its replica for the head of our datastream .
I forced a rollover to get the datastream to accepting data again and removed the empty index (using api).
I now want to restore that backing index from a snapshot but restore fails saying that the index still exists.
At this point the backing index is restored... but I could not see the data in places...
BTW it can take a while to restore etc.. etc...
@Russell_FultonNow here is the secret Sauce ... even though you restored the index you need to add it back to the data stream in my case you need to use the Modify Data Stream API
I remember getting that when I first tried and the screwed up index was still there. I then deleted the (empty) index and now when I try to do the restore:
This is where I got to before... listing the indexes in the snapshot shows:
and I find that the empty index is back. There are some failed shards but this index was not listed as affected. I then went back to a snapshot with no failed shards got the same result.
I am guessing this is created before the restore starts.
I went back to the API to see what I could find out about the snapshot but got a 404 when I did a GET on the specific snapshot. I then tried to list the whole repository:
elasticsearch@secesprd02:~$ curl -X GET -u elastic --noproxy \* "https://es2.insec.auckland.ac.nz:9200/_snapshot/daily/*/_status?pretty" -H 'Content-Type: application/json'
Enter host password for user 'elastic':
{
"error" : {
"root_cause" : [
{
"type" : "snapshot_missing_exception",
"reason" : "[daily:*] is missing"
}
],
"type" : "snapshot_missing_exception",
"reason" : "[daily:*] is missing"
},
"status" : 404
}
First, is the index actually there in the snapshot? Are you sure you are not restoring and empty index.
I got the same no restored snapshots but it was really working...
2nd Did you wait? it can take a while.... it can look like an empty index for a while
The index appears as that for a while especially if it is large I noticed the same things it took several minutes because it is loading/restoring and has not refreshed.
Did you run this to see if the index is there GET _cat/indices/.ds-sec*?v
you can also refresh the index
POST /my-index-000001/_refresh
Not sure what is up with your snapshot you need a good snapshot..
Not sure about the API not sure where you got the _status path from I don't see that in the API.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.