resource_already_exists_exception: resource_already_exists_exception: index [index_name/uuid] already exists (HTTP 400)(索引已存在)
Elasticsearch含义
要创建的索引(或资源)已经存在。由于存在同名索引,创建请求被拒绝。在旧版本中也表现为 index_already_exists_exception。
原因
尝试两次创建同一索引、非幂等的部署脚本、并发创建请求,或尝试以不同设置重新创建同名索引。
解决方法
如果索引已存在,无需创建;继续即可。如果必须重新创建,先删除(DELETE /index-name)再创建(注意:会丢失数据)。使部署脚本幂等:先用 GET _cat/indices 检查是否存在。通过 index template 或 ILM/rollover 进行 schema 管理以避免冲突。
同一数据库的其他条目
- version_conflict_engine_exceptionversion_conflict_engine_exception: [_doc][id]: version conflict, current version [x] is different than the one provided [y] (HTTP 409)(版本冲突,当前版本与提供的版本不同)
- document_missing_exceptiondocument_missing_exception: [_doc][id]: document missing(文档不存在)
- index_not_found_exceptionindex_not_found_exception: no such index [index_name] (HTTP 404)(索引不存在)
- cluster_health_redcluster health status: RED / unassigned shards(集群健康状态:RED / 未分配的分片)
- no_shard_available_action_exceptionno_shard_available_action_exception: No shard available for [...](没有可用的分片)
- es_rejected_execution_exceptiones_rejected_execution_exception: rejected execution of ... on ... (queue capacity ...) (HTTP 429)(线程池队列已满,执行被拒绝)
- master_not_discovered_exceptionmaster_not_discovered_exception / MasterNotDiscoveredException(未发现 master 节点)