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"
   }
 }
相关推荐
workflower1 小时前
FDD(Feature Driven Development)特征驱动开发
大数据·数据库·驱动开发·需求分析·个人开发
小雨的光1 小时前
QuickEsView
spring boot·elasticsearch·es可视化
xiaobangsky3 小时前
Elasticsearch安装使用
elasticsearch·jenkins
熙客3 小时前
Elasticsearch:分布式搜索引擎数据库
分布式·elasticsearch·搜索引擎
YangYang9YangYan4 小时前
高职新能源汽车技术专业职业发展指南
大数据·人工智能·数据分析·汽车
河南博为智能科技有限公司4 小时前
RS485转以太网串口服务器-串口设备联网的理想选择
大数据·服务器·人工智能·单片机·嵌入式硬件·物联网
Hello.Reader5 小时前
Spark RDD 编程从驱动程序到共享变量、Shuffle 与持久化
大数据·分布式·spark
VXHAruanjian8885 小时前
以智促效,释放创新力量,RPA助力企业全面自动化变革
大数据·人工智能
哦你看看7 小时前
Elasticsearch+Logstash+Filebeat+Kibana部署[7.17.3版本]
大数据·elasticsearch·搜索引擎
小鹿学程序8 小时前
搭建hadoop集群
大数据·hadoop·分布式