java无法还原快照索引HardRestoreFileDexception文件,在elasticsearch中找不到该文件
我在elasticsearch 1.3.1中使用3节点群集设置,我有17个索引,每个索引至少有0.5 M(1Gi)个文档,最大有1.4 M(3 Gi)。现在我想在我的群集中尝试快照和恢复过程。我使用了下面的REST调用来做同样的事情
创建存储库:
curl -XPUT 'http://host.name:9200/_snapshot/es_snapshot_repo' -d '{
"type": "fs",
"settings": {
"location": "/data/es_snapshot_bkup_repo/es_snapshot_repo"
}
}'
验证了存储库:
curl -XGET 'http://host.name:9200/_snapshot/es_snapshot_repo?pretty' the response is
{
"es_snapshot_repo" : {
"type" : "fs",
"settings" : {
"location" : "/data/es_snapshot_bkup_repo/es_snapshot_repo"
}
}
}
使用
curl -XPUT "http://host.name:9200/_snapshot/es_snapshot_repo/snap_001" -d '{
"indices": "index_01",
"ignore_unavailable": "true",
"include_global_state": false,
"wait_for_completion": true
}'
答案是
{
"accepted": true
}
然后,我试图通过请求恢复快照
curl -XPOST "http://host.name:9200/_snapshot/es_snapshot_repo/snap_001/_restore" -d '{
"indices": "index_01",
"ignore_unavailable": "true",
"include_global_state": false,
"rename_pattern": "index_01",
"rename_replacement": "index_01_bk",
"include_aliases": false
}'
问题: 如我所知,我有3个节点。我试图拍摄的索引快照&;restore is有6个碎片和2个副本
大多数碎片及其副本都已正确恢复,但有时1个、有时2个主碎片及其副本无法恢复。这些主碎片处于初始化状态。我允许集群重新定位它们一个多小时,但碎片没有重新定位到正确的节点。。。我的节点中出现以下异常
还原过程正在尝试将碎片放置在其他两个节点中。。。但这不可能
[2014-08-27 07:10:35,492][DEBUG][cluster.service ] [node_01] processing [
shard-failed (
[snap_001][4],
node[r4UoA7vJREmQfh6lz634NA],
[P],
restoring[es_snapshot_repo:snap_001],
s[INITIALIZING]),
reason [Failed to start shard,
message [IndexShardGatewayRecoveryException[[snap_001][4] failed recovery];
nested: IndexShardRestoreFailedException[[snap_001][4] restore failed];
nested: IndexShardRestoreFailedException[[snap_001][4] failed to restore snapshot [snap_001]];
nested: IndexShardRestoreFailedException[[snap_001][4] failed to read shard snapshot file];
nested: FileNotFoundException[/data/es_snapshot_bkup_repo/es_snapshot_repo/indices/index_01/4/snapshot-snap_001 (No such file or directory)]; ]]]:
done applying updated cluster_state (version: 56391)
谁能帮我克服这个问题,如果我在这个过程中犯了任何错误,请纠正我
仅供参考,我正在使用主节点传递curl请求
# 1 楼答案
我们需要提供一个共享文件系统位置,所有elasticsearch节点都可以通过
read & write
权限访问该位置