碰到问题:Bulk write of deprecation logs encountered some failures

因为手贱删了es下的data目录,通过以下命令查看有哪些未分配的分片,

10.5.5.17:9200/_cat/shards?h=index,shard,prirep,state,unassigned.reason

大部分的unassigned的分片都可以通过删除索引,或者设置副本数未0来解决,除了一个.ds-.logs-deprecation.开头的索引,就是删不掉

报的错是

{"error":{"root_cause":[{"type":"illegal_argument_exception","reason":"index [.ds-.logs-deprecation.elasticsearch-default-2025.08.04-000001] is the write index for data stream [.logs-deprecation.elasticsearch-default] and cannot be deleted"}],"type":"illegal_argument_exception","reason":"index [.ds-.logs-deprecation.elasticsearch-default-2025.08.04-000001] is the write index for data stream [.logs-deprecation.elasticsearch-default] and cannot be deleted"}

后来发现这个不是一般的index,是关联了什么data stream, 于是尝试把 data stream删除

curl -X DELETE 10.5.5.17:9200/_data_stream/.logs-deprecation.elasticsearch-default,居然可以删掉,再看那些unassigned的分片,发现之前那个索引已经消失了,这就终于把这个棘手的问题搞定了。。

 

posted on 2025-08-19 00:10  Urenus  阅读(13)  评论(0)    收藏  举报

导航