本文档为您介绍查看阿里云Elasticsearch(简称ES)实例自动备份的快照状态,帮助您实时了解快照的进度。

自动备份指南后,您可以登录该ES的Kibana控制台,在Dev Tools页面的Console中,通过snapshot API查看自动备份的快照状态。

查看所有快照

通过以下命令查看aliyun_auto_snapshot仓库中所有快照信息。

GET _snapshot/aliyun_auto_snapshot/_all

返回内容如下:

{
  "snapshots": [
    {
      "snapshot": "es-cn-abxxxxxxxxxlmn_20180628092236",
      "uuid": "n7YxxxxxxxxxxxxdA",
      "version_id": 5050399,
      "version": "5.5.3",
      "indices": [
        ".kibana"
      ],
      "state": "SUCCESS",
      "start_time": "2018-06-28T01:22:39.609Z",
      "start_time_in_millis": 1530148959609,
      "end_time": "2018-06-28T01:22:39.923Z",
      "end_time_in_millis": 1530148959923,
      "duration_in_millis": 314,
      "failures": [],
      "shards": {
        "total": 1,
        "failed": 0,
        "successful": 1
      }
    },
    {
      "snapshot": "es-cn-abxxxxxxxxxmn_20180628092500",
      "uuid": "frdxxxxxxxxxxxxKLA",
      "version_id": 5050399,
      "version": "5.5.3",
      "indices": [
        ".kibana"
      ],
      "state": "SUCCESS",
      "start_time": "2018-06-28T01:25:00.764Z",
      "start_time_in_millis": 1530149100764,
      "end_time": "2018-06-28T01:25:01.482Z",
      "end_time_in_millis": 1530149101482,
      "duration_in_millis": 718,
      "failures": [],
      "shards": {
        "total": 1,
        "failed": 0,
        "successful": 1
      }
    }
  ]
}
state:显示快照状态,Elasticsearch快照共有5种状态。
快照状态 说明
IN_PROGRESS 快照正在执行。
SUCCESS 快照执行结束,且所有shards都存储成功。
FAILED 快照执行结束,但有数据存储不成功。
PARTIAL Cluster级别的数据存储成功,但至少有1个shard的数据没有存储成功。
INCOMPATIBLE 快照与阿里云ES实例版本不兼容。

查看指定快照

通过以下命令查看aliyun_auto_snapshot仓库中指定快照的详细信息。

GET _snapshot/aliyun_auto_snapshot/<snapshot>/_status

<snapshot>:替换为自动备份快照名称,可通过查看所有快照命令获取,例如es-cn-abxxxxxxxxxxlmn_20180628092236

返回内容如下:
{
  "snapshots": [
    {
      "snapshot": "es-cn-abxxxxxxxxxxlmn_20180628092236",
      "repository": "aliyun_auto_snapshot",
      "uuid": "n7YxxxxxxxxxxxxydA",
      "state": "SUCCESS",
      "shards_stats": {
        "initializing": 0,
        "started": 0,
        "finalizing": 0,
        "done": 1,
        "failed": 0,
        "total": 1
      },
      "stats": {
        "number_of_files": 4,
        "processed_files": 4,
        "total_size_in_bytes": 3296,
        "processed_size_in_bytes": 3296,
        "start_time_in_millis": 1530148959688,
        "time_in_millis": 77
      },
      "indices": {
        ".kibana": {
          "shards_stats": {
            "initializing": 0,
            "started": 0,
            "finalizing": 0,
            "done": 1,
            "failed": 0,
            "total": 1
          },
          "stats": {
            "number_of_files": 4,
            "processed_files": 4,
            "total_size_in_bytes": 3296,
            "processed_size_in_bytes": 3296,
            "start_time_in_millis": 1530148959688,
            "time_in_millis": 77
          },
          "shards": {
            "0": {
              "stage": "DONE",
              "stats": {
                "number_of_files": 4,
                "processed_files": 4,
                "total_size_in_bytes": 3296,
                "processed_size_in_bytes": 3296,
                "start_time_in_millis": 1530148959688,
                "time_in_millis": 77
              }
            }
          }
        }
      }
    }
  ]
}