elastic / elasticsearch-cloud-aws

AWS Cloud Plugin for Elasticsearch
https://github.com/elastic/elasticsearch/tree/master/plugins/discovery-ec2
577 stars 181 forks source link

Moving snapshots to glacier, supported? #220

Closed dinoshauer closed 8 years ago

dinoshauer commented 9 years ago

Hey guys, I was wondering if it's supported to eventually move S3 snapshots to the glacier storage class and then restore from those?

I haven't tried yet myself just wanted to ask quickly to see if it was even possible before I spin up a test cluster

dadoonet commented 9 years ago

I think you could do something like: http://www.online-tech-tips.com/computer-tips/how-to-move-amazon-s3-data-to-glacier/ so backup first on S3 and then move to Glacier. I don't think you can backup directly on Glacier with this plugin. It could work but only if Glacier supports S3 API but I'm not sure it can.

piyushGoyal2 commented 9 years ago

Hey Guys, In continuation to the above mentioned problem, if a snapshot is moved from S3 to Glacier and is not permanently deleted from Glacier, those snapshots have storage class marked as Glacier in S3 console. During snapshot creation process, ES tries to read these snapshots as well. Since, it cannot read the Glacier objects, it gives the following warning: [2015-07-27 02:19:44,648][WARN ][index.snapshots.blobstore] [es_prod_cortez_node1] failed to read commit point [snapshot-cortezsnapshot_2015may17] java.io.IOException: Failed to get [snapshot-cortezsnapshot_2015may17] at org.elasticsearch.common.blobstore.support.AbstractBlobContainer.readBlobFully(AbstractBlobContainer.java:83) at org.elasticsearch.index.snapshots.blobstore.BlobStoreIndexShardRepository$Context.buildBlobStoreIndexShardSnapshots(BlobStoreIndexShardRepository.java:370) at org.elasticsearch.index.snapshots.blobstore.BlobStoreIndexShardRepository$SnapshotContext.snapshot(BlobStoreIndexShardRepository.java:420) at org.elasticsearch.index.snapshots.blobstore.BlobStoreIndexShardRepository.snapshot(BlobStoreIndexShardRepository.java:131) at org.elasticsearch.index.snapshots.IndexShardSnapshotAndRestoreService.snapshot(IndexShardSnapshotAndRestoreService.java:86) at org.elasticsearch.snapshots.SnapshotsService$6.run(SnapshotsService.java:829) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:745) Caused by: com.amazonaws.services.s3.model.AmazonS3Exception: The operation is not valid for the object's storage class (Service: Amazon S3; Status Code: 403; Error Code: InvalidObjectState; Request ID: 2066FA56825CF829), S3 Extended Request ID: OnfdWFKLyXq9SbXb/Ttb7nPFx/Ig97NAIW5XBCaz3JyxClu+zRtND0ZYES1RbRed at com.amazonaws.http.AmazonHttpClient.handleErrorResponse(AmazonHttpClient.java:820) at com.amazonaws.http.AmazonHttpClient.executeHelper(AmazonHttpClient.java:439) at com.amazonaws.http.AmazonHttpClient.execute(AmazonHttpClient.java:245) at com.amazonaws.services.s3.AmazonS3Client.invoke(AmazonS3Client.java:3722) at com.amazonaws.services.s3.AmazonS3Client.getObject(AmazonS3Client.java:1137) at com.amazonaws.services.s3.AmazonS3Client.getObject(AmazonS3Client.java:1002) at org.elasticsearch.cloud.aws.blobstore.AbstractS3BlobContainer$1.run(AbstractS3BlobContainer.java:83) ... 3 more

Either ES should avoid accessing snapshots which are moved to Glacier or it should read them. Let me know what you think.

maubarrerag commented 8 years ago

Hi, why don't you use a LifeCycle rule for the bucket with snapshots?

geekpete commented 8 years ago

Hi Team,

See also this discussion: https://github.com/elastic/elasticsearch/issues/12500

And this pull request which has been merged: https://github.com/elastic/elasticsearch/pull/13656

To be clear was this ticket about migrating existing/completed snapshots to Glacier or creating snapshots directly into Glacier?

dinoshauer commented 8 years ago

It was about moving existing snapshots to glacier, yes :)

With that being merged in I think we can close this issue