elasticsearch 索引write.lock报错解决 —— 筑梦之路

ES报错:

Caused by: org.apache.lucene.store.LockObtainFailedException: Lock held by another xxx write.lock

这是ES异常关闭导致索引的写锁未释放,索引一直处于red状态

解决方法:

  1. 停掉ES服务

  2. 找到相应的数据目录,找到对应的索引写锁文件write.lock所在位置,删除该文件

  3. 启动ES服务

如果有很多个索引都是该报错,可以使用批量处理的方法

批量处理方法:

  1. 停掉ES服务

  2. 进入数据目录:cd nodes/0/

  3. 查看写锁:find . -name write.lock > lock_list.txt

  4. 批量删除写锁

bash 复制代码
#!/bin/bash
# delete write.lock

for i in `cat lock_list.txt`
do
    rm -f $i
done
相关推荐
Elasticsearch15 小时前
Kibana 中的 SNMP 拓扑数据:从采集到 Canvas
elasticsearch
大大大大晴天1 天前
Hudi技术内幕:RecordPayload到RecordMerger
大数据
SelectDB2 天前
秒级弹性、最高降本 70%:SelectDB Serverless 如何重塑云数仓资源效率
大数据·后端·云原生
WhoAmI2 天前
MapReduce框架原理解析一:InputFormat
大数据·hadoop
WhoAmI2 天前
MapReduce框架原理解析三:OutputFormat
大数据·hadoop
WhoAmI2 天前
MapReduce框架原理解析二:Shuffle
大数据·hadoop
大大大大晴天3 天前
Hudi技术内幕:Key Generation原理与实践
大数据
Elasticsearch3 天前
3个信号、2个环境变量、0个采集器:使用 Python 和 Elastic 的托管 OTLP 端点实现 OpenTelemetry
elasticsearch
Elasticsearch5 天前
如何通过 Claude Code 来写入 CSV 数据到 Elasticsearch
elasticsearch