ElasticSearch 7.x现网运行问题汇集3

问题描述

某现网ElasticSearch 故障,很长时间unassgined_shards的数量都不减少。

原因分析与解决方案:

先了解整体状态,使用Postman请求,如下几个请求命令:

  1. GET /_cat/indices

  2. GET /_cat/shards

  3. GET /_cluster/health

  4. GET /_cat/nodes?v

  5. GET /_cat/health?v

  6. GET /_cluster/allocation/explain

  7. POST /_cluster/reroute?retry_failed=true

    恢复了部分,但是还是有shards没恢复,取回/_cluster/allocation/expain的response,才发现日志显示:

    "disk_threshold","the node is above the low watermark cluster setting [cluster.routing.allocation.disk.watermark.low=85%], using more disk space than the maximum allowed [85.0%], actual free: [12.239612269812415%]"

确认了分片无法指向的原因是节点磁盘使用率超过85%,即安排磁盘扩容,然后再重启ES集群解决。具体操作重启步骤:

第一步PUT /_cluster/settings

Body里的内容:

json 复制代码
{
  "transient": {
    "cluster.routing.allocation.enable": "none"
  }
}

第二步
systemctl stop elasticsearchkill {es的pid},注意不是kill -9

这时候要等,通过ps -ef | grep elasticsearch看进程结束没。

进程结束后,再进入第三步。

第三步
systemctl start elasticsearchsu - esuser进入elasticsearch的bin目录,执行./elasticsearch -d命令

观察es的日志,直到它加入集群,再重启下一台。

重复2、3两步,全部节点重启完成后执行
第四步

json 复制代码
PUT  /_cluster/settings
{
   "transient" : {
       "cluster.routing.allocation.enable" : "all"
   }
 }
相关推荐
大大大大晴天3 天前
Hudi Metadata Table 与 Hive Sync (HMS)怎么选?
大数据
手可摘星辰7773 天前
一次线上FlinkCDC异常排查复盘
大数据·flink
大大大大晴天3 天前
Hudi技术内幕:Metadata Table原理与实践
大数据
武子康4 天前
调查研究-197 FAISS vs Elasticsearch 全面对比:从向量检索、全文搜索到 RAG 选型指南
人工智能·elasticsearch·agent
大大大大晴天4 天前
Hudi技术内幕:深入解析Index索引机制
大数据
阿里云大数据AI技术4 天前
Flink Forward Asia 2026 深圳启幕:Agentic Streaming for AI,开启实时智能新范式
大数据·flink
SelectDB4 天前
阶跃星辰基于 SelectDB 构建 PB 级 Agent 可观测平台
大数据·数据库·aigc
Elasticsearch5 天前
Elasticsearch ES|QL:现已支持视图、子查询和读取时模式定义
elasticsearch
Elasticsearch8 天前
Kibana 中的 SNMP 拓扑数据:从采集到 Canvas
elasticsearch
大大大大晴天8 天前
Hudi技术内幕:RecordPayload到RecordMerger
大数据