elasticsearch 中的错误:无效的快照名称 snapshot with same name already in progress

Error in elasticsearch: Invalid snapshot name snapshot with the same name already in-progress

我有问题。 我想存储一个位于 elasticsearch 中的索引。我为此创建了一个新存储库,这个存储库没有任何快照。但是当我 运行 下面的代码博客时,它返回错误消息“无效的快照名称快照,同名快照已经在进行中”。我该如何解决这个问题?

我使用以下代码块创建了一个新存储库:

PUT /_snapshot/backup_repository
{
  "type": "fs",
  "settings": {
    "compress" : "true",
    "location": "C:/backups/backup_my_index"
  }
}

只是为了确保我使用了下面的代码块并且查询返回了这个结果:

GET /_snapshot/backup_repository/_status

result:
{
  "snapshots" : [ ]
}

我想使用以下代码块进行备份:

PUT /_snapshot/backup_repository/my_snapshot?wait_for_completion=true
{
  "indices": "my_index",
  "ignore_unavailable": true,
  "include_global_state": false,
  "metadata": {
    "taken_by": "busra duygu",
    "taken_because": "backup for my_index"
  }
}

错误:

{
  "error" : {
    "root_cause" : [
      {
        "type" : "invalid_snapshot_name_exception",
        "reason" : "[backup_repository:my_snapshot] Invalid snapshot name [my_snapshot], snapshot with the same name is already in-progress"
      }
    ],
    "type" : "invalid_snapshot_name_exception",
    "reason" : "[backup_repository:my_snapshot] Invalid snapshot name [my_snapshot], snapshot with the same name is already in-progress"
  },
  "status" : 400
}

如果你能帮助我,我会很高兴。

查看是否已存在同名快照

GET /_snapshot/backup_repository/_all

你也会得到它的状态(SUCCESS/FAILED,...)

@ExploZe 正如您所说,我 运行 这个查询返回了以下结果。

查询:

GET /_snapshot/backup_repository/_all

结果:

{
  "snapshots" : [
    {
      "snapshot" : "my_snapshot",
      "uuid" : "4Sv055VjQDSZvpBqSvCxpg",
      "version_id" : 7100199,
      "version" : "7.10.1",
      "indices" : [
        "my_index"
      ],
      "data_streams" : [ ],
      "include_global_state" : false,
      "metadata" : {
        "taken_by" : "busra duygu",
        "taken_because" : "backup for my_index"
      },
      "state" : "IN_PROGRESS",
      "start_time" : "2021-09-09T06:22:16.414Z",
      "start_time_in_millis" : 1631168536414,
      "end_time" : "1970-01-01T00:00:00.000Z",
      "end_time_in_millis" : 0,
      "duration_in_millis" : 0,
      "failures" : [ ],
      "shards" : {
        "total" : 0,
        "failed" : 0,
        "successful" : 0
      }
    }
  ]
}