Remember once elasticsearch delete dangling index (Dangling indices) operation

服务器运行环境信息: filebeat->kafka->logstash->es

软件版本: es:6.6.1;3个master+node;1个协调节点,共4个节点

background:

朋友公司因为es集群因为之前升级的原因,集群成red状态,找我帮忙看下,和他沟通后,可以把变红的索引都删了,然后重启了下集群,分片分到8000多的时候,就不往下分了,查看了下未分配的索引都是之前删除过的,再一次删除red索引后,发现过会儿又会出现,而且通过_cat/indices查不到该索引,但是查看未分配的分片中又可以看到改索引的名字,协调节点一直在报can not be imported as a dangling index, as an index with the same name and UUID exist in the index tombstones. This situation is likely caused by copying over the data directory for an index that was previously deleted

Solution

在硬盘上面找到无法删除的索引对应的data目录下面存放的内容。把他删除了。然后再用脚本跑了一遍删除未分配的索引,之前时删不掉,现在是可以删掉了,过了半小时集群状态变为green,es日志也未见异常

Guess you like

Origin www.cnblogs.com/uglyliu/p/12626475.html