从S3恢复数据

时间:2018-08-02 08:23:34

标签: elasticsearch

我在S3中已经有es备份,并且存储桶名称例如是“一些桶”。 我试图恢复数据...

curl -XPUT "http://localhost:9200/_snapshot/my_s3_repository1" -H'Content-Type: application/json' -d'
{
  "type": "s3",
  "settings": {
    "bucket": "some-bucket"
  }
}'

我得到了这样的回复...

{"acknowledged":true}

现在,当我尝试还原数据时,我会得到回购缺失的异常信息……

curl -XPOST "http://localhost:9200/_snapshot/my_s3_repository1/dev_1/_restore?pretty=true&wait_for_completion=true"

{
  "error" : {
    "root_cause" : [
      {
        "type" : "snapshot_restore_exception",
        "reason" : "[my_s3_repository1:dev_1] snapshot does not exist"
      }
    ],
    "type" : "snapshot_restore_exception",
    "reason" : "[my_s3_repository1:dev_1] snapshot does not exist"
  },
  "status" : 500
}

我想我没有正确提供快照名称。我提到了这篇文章,并尝试了所有可能。

https://medium.com/@rcdexta/periodic-snapshotting-of-elasticsearch-indices-f6b6ca221a0c

如何从S3恢复数据?


更新:

我可以看到2个空快照。但是我确定S3上有很多数据

 $ curl http://localhost:9200/_cat/snapshots/my_s3_repository1?v
id     status start_epoch start_time end_epoch  end_time duration indices successful_shards failed_shards total_shards
snap1 SUCCESS 1518343272  10:01:12   1518343272 10:01:12     52ms       0                 0             0            0
snap2 SUCCESS 1518343818  10:10:18   1518343818 10:10:18     64ms       0                 0             0            0

$ curl -XPOST "http://localhost:9200/_snapshot/my_s3_repository1/snap1/_restor
e?pretty=true&wait_for_completion=true"
{
  "snapshot" : {
    "snapshot" : "snap1",
    "indices" : [ ],
    "shards" : {
      "total" : 0,
      "failed" : 0,
      "successful" : 0
    }
  }
}

$ curl -XPOST "http://localhost:9200/_snapshot/my_s3_repository1/snap2/_restor
e?pretty=true&wait_for_completion=true"
{
  "snapshot" : {
    "snapshot" : "snap2",
    "indices" : [ ],
    "shards" : {
      "total" : 0,
      "failed" : 0,
      "successful" : 0
    }
  }
}

更新2:

我的数据在存储桶中的文件夹中。但是base_path参数似乎不起作用。

curl -XPUT "http://localhost:9200/_snapshot/my_s3_repository1" -H'Content-Type: application/json' -d'
{
  "type": "s3",
  "settings": {
    "bucket": "todel162",
"base_path": "elasticsearch/indices/dbaug"
  }
}'

如果重要的话,备份文件会很旧(2016年6月)。

0 个答案:

没有答案