Elasticsearch版本:6.3.2
我试图从只读S3存储库中还原Elasticsearch 5.2.2的旧快照(于2018年1月拍摄)。设置了实例的IAM角色所需的权限。
这是存储库定义: ```
{
"production_copy_old": {
"type": "s3",
"settings": {
"bucket": "elasticsearch-snapshot",
"readonly": "true",
"base_path": "snaps//"
}
}
}
```
存储库设置良好,因为当我在存储库上发布GET快照时,我得到了正确的响应:
GET _snapshot/production_copy_old/elasticsearch-snapshot-201804190000
{
"snapshots": [
{
"snapshot": "elasticsearch-snapshot-201804190000",
"uuid": "fT0oftdTQhi5sns704pg45",
"version_id": 5020299,
"version": "5.2.2",
"indices": [<huge list of indices>],
"state": "SUCCESS",
"start_time": "2018-04-19T00:00:20.726Z",
"start_time_in_millis": 1524096020726,
"end_time": "2018-04-19T00:09:30.210Z",
"end_time_in_millis": 1524096570210,
"duration_in_millis": 549484,
"failures": [],
"shards": {
"total": 2875,
"failed": 0,
"successful": 2875
}
}
]
}
但是,当我尝试还原快照时,出现错误:
POST _snapshot/production_copy_old/elasticsearch-snapshot-201804190000/_restore
{
"indices": "myindex-201801",
"ignore_unavailable": false,
"include_global_state": false,
"index_settings": {
"index.number_of_replicas": 0
}
}
{
"error": {
"root_cause": [
{
"type": "remote_transport_exception",
"reason": "[s-elasticsearch-2][IP:9300][cluster:admin/snapshot/restore]"
}
],
"type": "no_such_file_exception",
"reason": "Blob object [meta-fT0oftdTQhi5ns70paP4pg.dat] not found: The specified key does not exist. (Service: Amazon S3; Status Code: 404; Error Code: NoSuchKey; Request ID:<reqid>; S3 Extended Request ID:<extended-req-id)"
},
"status": 500
}
但是,当我尝试aws s3 ls elasticsearch-snapshot/snaps//meta-fT0oftdTQhi5ns70paP4pg.dat
时,我看到该实例能够看到该对象并下载它。由此我们可以知道权限设置正确。
此外,前缀结尾处带有//
的原因是因为自Elasticsearch 2.3起我们就一直在使用该存储库。在那个版本的elasticsearch中,我们在存储库定义前缀设置中添加了斜杠。我们在8月将迁移到具有正确前缀定义的新存储库。
有什么办法可以解决这个问题?我必须更改前缀吗?