从s3存储库还原时,快照不存在错误

时间:2017-02-01 07:42:49

标签: elasticsearch amazon-s3 elasticsearch-5

我刚刚在s3存储库上创建了一个小索引的快照。现在我正在尝试恢复它,它说没有找到快照。 我创建的快照来自elasticearch 2.3,我正在尝试恢复elasticsearch 5.1.1。是否存在一些我不知道的兼容性问题?

2017-02-01T01:38:32,669][INFO ][o.e.r.RepositoriesService] [development] update repository [elasticsearch]
[2017-02-01T01:38:33,552][WARN ][o.e.s.RestoreService     ] [development] [elasticsearch:backupname.17-01-31-1024] failed to restore snapshot
org.elasticsearch.snapshots.SnapshotRestoreException: [elasticsearch:backupname.17-01-31-1024]snapshot does not exist
    at org.elasticsearch.snapshots.RestoreService.restoreSnapshot(RestoreService.java:199) [elasticsearch-5.1.1.jar:5.1.1]
    at org.elasticsearch.action.admin.cluster.snapshots.restore.TransportRestoreSnapshotAction.masterOperation(TransportRestoreSnapshotAction.java:89) [elasticsearch-5.1.1.jar:5.1.1]
    at org.elasticsearch.action.admin.cluster.snapshots.restore.TransportRestoreSnapshotAction.masterOperation(TransportRestoreSnapshotAction.java:49) [elasticsearch-5.1.1.jar:5.1.1]
    at org.elasticsearch.action.support.master.TransportMasterNodeAction.masterOperation(TransportMasterNodeAction.java:86) [elasticsearch-5.1.1.jar:5.1.1]
    at org.elasticsearch.action.support.master.TransportMasterNodeAction$AsyncSingleAction$3.doRun(TransportMasterNodeAction.java:170) [elasticsearch-5.1.1.jar:5.1.1]
    at org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingAbstractRunnable.doRun(ThreadContext.java:527) [elasticsearch-5.1.1.jar:5.1.1]
    at org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:37) [elasticsearch-5.1.1.jar:5.1.1]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [?:1.8.0_111]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [?:1.8.0_111]
    at java.lang.Thread.run(Thread.java:745) [?:1.8.0_111]
[2017-02-01T01:38:33,552][WARN ][r.suppressed             ] path: /_snapshot/elasticsearch/backupname.17-01-31-1024/_restore, params: {repository=elasticsearch, wait_for_completion=true, snapshot=backupname.17-01-31-1024}
org.elasticsearch.snapshots.SnapshotRestoreException: [elasticsearch:backupname.17-01-31-1024]snapshot does not exist
    at org.elasticsearch.snapshots.RestoreService.restoreSnapshot(RestoreService.java:199) [elasticsearch-5.1.1.jar:5.1.1]
    at org.elasticsearch.action.admin.cluster.snapshots.restore.TransportRestoreSnapshotAction.masterOperation(TransportRestoreSnapshotAction.java:89) [elasticsearch-5.1.1.jar:5.1.1]
    at org.elasticsearch.action.admin.cluster.snapshots.restore.TransportRestoreSnapshotAction.masterOperation(TransportRestoreSnapshotAction.java:49) [elasticsearch-5.1.1.jar:5.1.1]
    at org.elasticsearch.action.support.master.TransportMasterNodeAction.masterOperation(TransportMasterNodeAction.java:86) [elasticsearch-5.1.1.jar:5.1.1]
    at org.elasticsearch.action.support.master.TransportMasterNodeAction$AsyncSingleAction$3.doRun(TransportMasterNodeAction.java:170) [elasticsearch-5.1.1.jar:5.1.1]
    at org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingAbstractRunnable.doRun(ThreadContext.java:527) [elasticsearch-5.1.1.jar:5.1.1]
    at org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:37) [elasticsearch-5.1.1.jar:5.1.1]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [?:1.8.0_111]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [?:1.8.0_111]
    at java.lang.Thread.run(Thread.java:745) [?:1.8.0_111]

另外,我没有在ES 2.3上恢复相同快照的错误 我使用GET / _snapshot / elasticsearch / _all api检查了快照是否存在。得到以下回应:

{
      "snapshot": "backup.backupname.17-01-31-1024",
      "version_id": 2030099,
      "version": "2.3.0",
      "indices": [
        "index_name"
      ],
      "state": "SUCCESS",
      "start_time": "2017-02-01T06:24:06.540Z",
      "start_time_in_millis": 1485930246540,
      "end_time": "2017-02-01T06:24:07.635Z",
      "end_time_in_millis": 1485930247635,
      "duration_in_millis": 1095,
      "failures": [],
      "shards": {
        "total": 2,
        "failed": 0,
        "successful": 2
      }
    }

1 个答案:

答案 0 :(得分:0)

从日志中我看到:

/_snapshot/elasticsearch/backupname.17-01-31-1024/_restore

您确定快照名称是elasticsearch:backupname.17-01-31-1024吗?

您可以查看

GET /_snapshot/elasticsearch/_all

如果存在快照,请输出快照的状态。如果不成功,则快照未正确完成。

更新:在我看来,您受到类似错误https://discuss.elastic.co/t/elasticsearch5-restore-snapshot-from-2-4/66488

的影响

基本的解决方法是,在版本2.3中恢复它并关闭群集并使用版本5启动群集,因为索引将被升级,或者等待错误修复。

虽然我不确定ES 5是否可以直接从v2.3恢复,但是v2.4介于两者之间。