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里的内容:

{
   
  "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两步,全部节点重启完成后执行
第四步

PUT  /_cluster/settings
{
   
   "transient" : {
   
       "cluster.routing.allocation.enable" : "all"
   }
 }

相关推荐

  1. ElasticSearch 7.x运行问题汇集2

    2024-01-22 09:06:03       32 阅读
  2. ElasticSearch7.x版本更新映射字段

    2024-01-22 09:06:03       14 阅读
  3. 14.Spring2.7.x 整合 Elasticsearch7.17

    2024-01-22 09:06:03       36 阅读
  4. 使用Tensorflow2.xuxnet3D

    2024-01-22 09:06:03       27 阅读

最近更新

  1. TCP协议是安全的吗?

    2024-01-22 09:06:03       18 阅读
  2. 阿里云服务器执行yum,一直下载docker-ce-stable失败

    2024-01-22 09:06:03       19 阅读
  3. 【Python教程】压缩PDF文件大小

    2024-01-22 09:06:03       19 阅读
  4. 通过文章id递归查询所有评论(xml)

    2024-01-22 09:06:03       20 阅读

热门阅读

  1. 20.包装类

    2024-01-22 09:06:03       26 阅读
  2. 计算矩阵边缘元素之和(c++)

    2024-01-22 09:06:03       36 阅读
  3. 泛型..

    泛型..

    2024-01-22 09:06:03      33 阅读
  4. 编程羔才生-前端访问后端出现read ECONNRESET

    2024-01-22 09:06:03       38 阅读
  5. Oracle pagesize 和 linesize区别

    2024-01-22 09:06:03       31 阅读
  6. kafka入门(十):副本数据同步

    2024-01-22 09:06:03       38 阅读
  7. 聊聊PowerJob的UserService

    2024-01-22 09:06:03       39 阅读
  8. 微信小程序中使用自定义 icon 图标

    2024-01-22 09:06:03       36 阅读
  9. 三、安全工程—安全架构(CISSP)

    2024-01-22 09:06:03       37 阅读
  10. 《繁花》中服饰公司的股票开盘价如何涨到了18.8

    2024-01-22 09:06:03       37 阅读