快照还原失败

时间:2018-12-12 12:41:12

标签: elasticsearch

我正在尝试创建和还原快照,以创建庞大的数据集以进行测试。最初,我创建了一些快照并成功还原了它们。但是突然我无法恢复新创建的索引。我尚未对系统进行任何更改,唯一的区别是数据量现在更大了。

Elasticsearch版本:6.3.0,单节点设置

快照已创建

Lazy<_>

输出

 PUT /_snapshot/nuwan-backup2/snapshot_transactions-cl2-2018.11.27-reindexed-x3?wait_for_completion=true
    {
      "indices": "transactions-2018.11.27-reindexed-1543757375.64",
      "ignore_unavailable": true,
      "include_global_state": false
    }

快照状态

{
  "snapshot": {
    "snapshot": "snapshot_transactions-cl2-2018.11.27-reindexed-x3",
    "uuid": "JhsmFXmVR12OR-65fCtFXw",
    "version_id": 6030099,
    "version": "6.3.0",
    "indices": [
      "transactions-2018.11.27-reindexed-1543757375.64"
    ],
    "include_global_state": false,
    "state": "SUCCESS",
    "start_time": "2018-12-12T12:32:26.645Z",
    "start_time_in_millis": 1544617946645,
    "end_time": "2018-12-12T12:32:26.750Z",
    "end_time_in_millis": 1544617946750,
    "duration_in_millis": 105,
    "failures": [],
    "shards": {
      "total": 5,
      "failed": 0,
      "successful": 5
    }
  }
}

输出

GET /_snapshot/nuwan-backup2/snapshot_transactions-cl2-2018.11.27-reindexed-x3/_status  

快照还原

{
  "snapshots": [
    {
      "snapshot": "snapshot_transactions-cl2-2018.11.27-reindexed-x3",
      "repository": "nuwan-backup2",
      "uuid": "JhsmFXmVR12OR-65fCtFXw",
      "state": "SUCCESS",
      "include_global_state": false,
      "shards_stats": {
        "initializing": 0,
        "started": 0,
        "finalizing": 0,
        "done": 5,
        "failed": 0,
        "total": 5
      },
      "stats": {
        "number_of_files": 0,
        "processed_files": 0,
        "total_size_in_bytes": 0,
        "processed_size_in_bytes": 0,
        "start_time_in_millis": 1544617946662,
        "time_in_millis": 78
      },
      "indices": {
        "transactions-2018.11.27-reindexed-1543757375.64": {
          "shards_stats": {
            "initializing": 0,
            "started": 0,
            "finalizing": 0,
            "done": 5,
            "failed": 0,
            "total": 5
          },
          "stats": {
            "number_of_files": 0,
            "processed_files": 0,
            "total_size_in_bytes": 0,
            "processed_size_in_bytes": 0,
            "start_time_in_millis": 1544617946662,
            "time_in_millis": 78
          },
          "shards": {
            "0": {
              "stage": "DONE",
              "stats": {
                "number_of_files": 0,
                "processed_files": 0,
                "total_size_in_bytes": 0,
                "processed_size_in_bytes": 0,
                "start_time_in_millis": 1544617946696,
                "time_in_millis": 17
              }
            },
            "1": {
              "stage": "DONE",
              "stats": {
                "number_of_files": 0,
                "processed_files": 0,
                "total_size_in_bytes": 0,
                "processed_size_in_bytes": 0,
                "start_time_in_millis": 1544617946722,
                "time_in_millis": 18
              }
            },
            "2": {
              "stage": "DONE",
              "stats": {
                "number_of_files": 0,
                "processed_files": 0,
                "total_size_in_bytes": 0,
                "processed_size_in_bytes": 0,
                "start_time_in_millis": 1544617946662,
                "time_in_millis": 18
              }
            },
            "3": {
              "stage": "DONE",
              "stats": {
                "number_of_files": 0,
                "processed_files": 0,
                "total_size_in_bytes": 0,
                "processed_size_in_bytes": 0,
                "start_time_in_millis": 1544617946662,
                "time_in_millis": 18
              }
            },
            "4": {
              "stage": "DONE",
              "stats": {
                "number_of_files": 0,
                "processed_files": 0,
                "total_size_in_bytes": 0,
                "processed_size_in_bytes": 0,
                "start_time_in_millis": 1544617946696,
                "time_in_millis": 20
              }
            }
          }
        }
      }
    }
  ]
}

输出

POST /_snapshot/nuwan-backup2/snapshot_transactions-cl2-2018.11.27-reindexed-x3/_restore
    {
      "indices": "snapshot-x2",
      "ignore_unavailable": true,
      "include_global_state": true,
      "rename_pattern": "s(.+)",
      "rename_replacement": "s$1"
    }   

结果 没有新的索引生成!

1 个答案:

答案 0 :(得分:0)

我配置的还原请求不正确,应该是

POST /_snapshot/nuwan-backup2/snapshot_transactions-cl2-2018.11.27-reindexed-x3/_restore
    {
      "indices": "transactions-2018.11.27-reindexed-1543757375.64",
      "ignore_unavailable": true,
      "include_global_state": true,
      "rename_pattern": "transactions-2018.11.27-reindexed-1543757375.64",
      "rename_replacement": "snapshot-x2"
    }