无法还原快照 - 在elasticsearch中找不到IndexShardRestoreFailedException文件

时间:2014-08-27 11:43:24

标签: java elasticsearch restore snapshot

我正在使用带有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
}'

ISSUE: 正如我所知,我有3个节点。我试图拍摄快照的索引& restore有6个分片和2个副本。

大多数分片及其副本都已正确恢复,但有时1个,有时2个主分片及其副本恢复不会发生。那些主分片处于INITIALIZING状态。我允许集群重新定位它们超过一个小时但是分片没有重定位到正确的节点......我的节点中出现了以下异常。

恢复过程试图将碎片放在其他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) 

任何人都可以帮助我克服这个问题,如果我在这些过程中犯了任何错误,请纠正我......

仅供参考我使用主节点传递卷曲请求

1 个答案:

答案 0 :(得分:0)

我们需要提供一个共享文件系统位置,所有 elasticsearch节点都应具有read & write权限。