首页 > 解决方案 > Elasticsearch index_not_found_exception

问题描述

由于我的错误,我删除了活动索引,现在 Elasticsearch 的 cronjob 引发错误:

Current write index for app-write:
Checking results from _rollover call
Calculating next write index based on current write index...
Next write index for app-write: -000001
Checking if -000001 exists
{"error":{"root_cause":[{"type":"index_not_found_exception","reason":"no such index","index_uuid":"_na_","resource.type":"index_or_alias","resource.id":"-000001","index":"-000001"}],"type":"index_not_found_exception","reason":"no such index","index_uuid":"_na_","resource.type":"index_or_alias","resource.id":"-000001","index":"-000001"},"status":404}

您知道如何解决此问题的任何解决方法吗?

标签: elasticsearchopenshift

解决方案


如果您错误地删除了活动索引并且没有任何快照或备份,那么您将无法恢复您的数据。

但是,您可以通过使用以下命令重新创建活动索引来再次运行该过程(确保正确替换whatever_name_your_index_had为您意外删除的索引的实际名称):

PUT whatever_name_your_index_had-000001
{
  "aliases": {
    "app-write": {
      "is_write_index": true
    }
  }
}

推荐阅读