shard_lock_obtain_failed_exception: Obtaining shard lock timed out(获取分片锁超时)
Elasticsearch含义
Elasticsearch 未能在超时时间内获取操作分片所需的本地目录锁(shard lock)。分片无法启动或重新分配。
原因
同一分片的先前副本(关闭/迁移之后)尚未释放锁;I/O 缓慢/挂起;磁盘问题;或节点快速重启后未清理过期的分片状态。通常是暂时性的,但如果持续存在,分片会一直处于 UNASSIGNED 状态。
解决方法
检查分片未分配的原因:GET _cluster/allocation/explain。大多数情况下锁会很快释放,集群会自行重试;必要时用 POST _cluster/reroute?retry_failed=true 触发重新分配。如果问题持续,检查受影响节点日志中的 I/O/磁盘错误并确认磁盘健康状况。干净地重启有问题的节点可以清除该锁。
同一数据库的其他条目
- receive_timeout_transport_exceptionRequest timed out waiting for a response from another node(等待另一节点响应时请求超时)
- routing_missing_exceptionRouting value is required for this document(此文档需要 routing 值)
- too_many_buckets_exceptionTrying to create too many buckets(试图创建过多的桶)
- parsing_exceptionFailed to parse the search request / query DSL(无法解析搜索请求/query DSL)
- max_bytes_length_exceeded_exceptionDocument contains at least one immense term that is too long(文档中至少包含一个过长的超大词项)
- illegal_argument_exception_total_fieldsLimit of total fields has been exceeded(已超出字段总数限制)
- verification_exceptionverification_exception: Found N problem(s) — Unknown column / Unknown index (ES|QL, SQL, EQL)(验证异常:发现 N 个问题 —— 未知列/未知索引)