📣 极限科技诚招搜索运维工程师(Elasticsearch/Easysearch)- 全职/北京 👉 : 立即申请加入

版本: 7.1-7.15

简而言之,当您尝试在Elasticsearch中创建数据流时,如果同名的支持索引已经存在,就会出现此错误。Elasticsearch使用支持索引来存储数据流数据,每个支持索引必须具有唯一的名称。要解决此问题,您可以删除不再需要的现有索引,或重命名您尝试创建的数据流。或者,如果现有索引仍在使用中,可以重命名它,但这可能需要更改引用它的任何应用程序或脚本。

日志上下文 #

日志 “data stream could not be created because backing index [{}] already exists” 的类名是 MetadataCreateDataStreamService.java。我们从Elasticsearch源代码中提取了以下内容,供那些寻求深入上下文的人使用:

currentState = metadataCreateIndexService.applyCreateIndexRequest(currentState, createIndexRequest, false);
 } catch (ResourceAlreadyExistsException e) {
 // Rethrow as ElasticsearchStatusException, so that bulk transport action doesn't ignore it during
 // auto index/data stream creation.
 // (otherwise bulk execution fails later, because data stream will also not have been created)
 throw new ElasticsearchStatusException("data stream could not be created because backing index [{}] already exists",
 RestStatus.BAD_REQUEST, e, firstBackingIndexName);
 }
 writeIndex = currentState.metadata().index(firstBackingIndexName);
 }
 assert writeIndex != null;