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

版本: 6.8-8.9

简而言之,当您尝试使用已被用作别名的名称创建 Elasticsearch 索引时,会出现此错误。Elasticsearch 别名用于引用一个或多个索引。要解决此问题,您可以为新索引选择不同的名称,或者删除现有别名然后创建索引。另外,如果别名旨在替换旧索引,您可以将别名重新分配指向新索引。

日志上下文 #

日志 “already exists as alias” 的类名是 MetadataCreateIndexService.java。我们从 Elasticsearch 源代码中提取了以下内容,供那些寻求深入上下文的人使用:

if (state.metadata().hasIndex(index)) {
    throw new ResourceAlreadyExistsException(state.metadata().index(index).getIndex());
}
if (state.metadata().hasAlias(index)) {
    throw new InvalidIndexNameException(index; "already exists as alias");
}