自动备份状态

开启自动备份功能后,可以在阿里云ES集成的Kibana控制台中的Dev Tools中通过ElasticsearchsnapshotAPI查看自动备份的快照状态。

查看所有快照

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

GET _snapshot/aliyun_auto_snapshot/_all

返回内容如下:

{
  "snapshots": [
    {
      "snapshot": "es-cn-abcdefghijklmn_20180628092236",
      "uuid": "n7YIayyZTm2hwg8BeWbydA",
      "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-abcdefghijklmn_20180628092500",
      "uuid": "frdl1YFzQ5Cn5xN9ZWuKLA",
      "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-abcdefghijklmn_20180628092236
返回内容如下:
{
  "snapshots": [
    {
      "snapshot": "es-cn-abcdefghijklmn_20180628092236",
      "repository": "aliyun_auto_snapshot",
      "uuid": "n7YIayyZTm2hwg8BeWbydA",
      "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
              }
            }
          }
        }
      }
    }
  ]
}