【发布时间】:2014-08-27 11:43:23
【问题描述】:
我在 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"
}
}
}
使用 SNAPSHOT 完成
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 个节点。我试图拍摄快照和恢复的索引有 6 个分片和 2 个副本。
大部分分片及其副本都已正确恢复,但有时 1 个,有时 2 个主分片及其副本恢复不会发生。这些主分片处于初始化状态。我允许集群将它们重定位超过一个小时,但分片没有重定位到正确的节点...我的节点中出现以下异常。
还原过程试图将分片放置在其他 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 请求
【问题讨论】:
-
此问题已修复,我在文件系统位置出错。实际上我们需要指向一个共享文件系统。我给出了每个节点的本地位置。现在我将位置更改为共享挂载文件夹 [所有节点均可访问],此问题已修复,谢谢
-
快照将存储在所有节点的公共位置。恢复操作也完成了:)
标签: java elasticsearch restore snapshot