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"
   }
 }
相关推荐
石像鬼₧魂石2 小时前
22端口(OpenSSH 4.7p1)渗透测试完整复习流程(含实战排错)
大数据·网络·学习·安全·ubuntu
f***28142 小时前
Springboot中使用Elasticsearch(部署+使用+讲解 最完整)
spring boot·elasticsearch·jenkins
TDengine (老段)2 小时前
TDengine Python 连接器进阶指南
大数据·数据库·python·物联网·时序数据库·tdengine·涛思数据
数据猿4 小时前
【金猿CIO展】如康集团CIO 赵鋆洲:数智重塑“顶牛”——如康集团如何用大数据烹饪万亿肉食产业的未来
大数据
zxsz_com_cn6 小时前
设备预测性维护的意义 工业设备预测性维护是什么
大数据
samLi06207 小时前
【数据集】中国杰出青年名单数据集(1994-2024年)
大数据
成长之路5147 小时前
【数据集】分地市旅游收入数据集(2000-2024年)
大数据·旅游
Elasticsearch8 小时前
使用 Elastic Agent 混合摄取加速 Otel 采用
elasticsearch
大厂技术总监下海8 小时前
用户行为分析怎么做?ClickHouse + 嵌套数据结构,轻松处理复杂事件
大数据·数据结构·数据库
大厂技术总监下海8 小时前
大数据生态的“主动脉”:RocketMQ 如何无缝桥接 Flink、Spark 与业务系统?
大数据·开源·rocketmq