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"
   }
 }
相关推荐
萌吖LOVETurtle~8 小时前
阿里云部署微调chatglm3
elasticsearch·阿里云·云计算
Elastic 中国社区官方博客8 小时前
Elastic 9.1/8.19:默认启用 BBQ,ES|QL 支持跨集群搜索(CCS)正式版,JOINS 正式版,集成 Azure AI Foundry
大数据·elasticsearch·搜索引擎·全文检索·azure·elastic
哈__8 小时前
PromptPilot搭配Doubao-seed-1.6:定制你需要的AI提示prompt
大数据·人工智能·promptpilot
鸿乃江边鸟9 小时前
Starrocks中的 Query Profile以及explain analyze及trace命令中的区别
大数据·starrocks·sql
SamtecChina202311 小时前
应用科普 | 漫谈6G通信的未来
大数据·网络·人工智能·科技
找不到、了11 小时前
Mysql使用Canal服务同步数据->ElasticSearch
数据库·mysql·elasticsearch
Adorable老犀牛12 小时前
Exporters | 安装elasticsearch_exporter
elasticsearch·prometheus·exporter
lingling00913 小时前
光伏清洗机器人是什么?艾利特协作机器人如何重塑新能源运维效率
大数据·运维·人工智能
干了这杯柠檬多14 小时前
使用maven-shade-plugin解决es跨版本冲突
java·elasticsearch·maven