当前位置: 首页 > news >正文

ES集群-提高分片恢复的速度

文章目录

  • 前言
  • 一、查看集群当前状态
  • 二、解决步骤
  • 总结

前言

有个集群的ES卡住了,查询后发现是分片恢复太慢导致的。这里记录一下处理方法。


一、查看集群当前状态

curl-XGET"localhost:9200/_cluster/allocation/explain?pretty"# 核心提示{"note":"No shard was specified in the explain API request, so this response explains a randomly chosen unassigned shard. There may be other unassigned shards in this cluster which cannot be assigned for different reasons. It may not be possible to assign this shard until one of the other shards is assigned correctly. To explain the allocation of other shards (whether assigned or unassigned) you must specify the target shard in the request to this API.","index":"node.k8s.kube-apiserver-2025.11.26","shard":0,"primary":true,"current_state":"unassigned","unassigned_info":{"reason":"CLUSTER_RECOVERED","at":"2026-04-09T06:30:40.318Z","last_allocation_status":"throttled"},"can_allocate":"yes","allocate_explanation":"Elasticsearch can allocate the shard.",

集群属于拥堵状态,分片在排队。

二、解决步骤

解决限流,加速恢复

curl-XPUT"localhost:9200/_cluster/settings"-H'Content-Type: application/json'-d' { "persistent": { "cluster.routing.allocation.node_concurrent_incoming_recoveries": 4, "cluster.routing.allocation.node_concurrent_outgoing_recoveries": 4, "cluster.routing.allocation.node_concurrent_recoveries": 4, "cluster.routing.allocation.cluster_concurrent_rebalance": 4 } }'

触发重试

curl-XPOST"localhost:9200/_cluster/reroute?retry_failed=true"

观察恢复状态

[root@a es]# curl -s "localhost:9200/_cluster/health?pretty" | grep unassigned_shards"unassigned_shards":1553,"delayed_unassigned_shards":0,[root@a2 es]# curl -s "localhost:9200/_cluster/health?pretty" | grep unassigned_shards"unassigned_shards":1215,"delayed_unassigned_shards":0,[root@a es]# curl -s "localhost:9200/_cluster/health?pretty" | grep unassigned_shards"unassigned_shards":1179,"delayed_unassigned_shards":0,[root@a es]# curl -s "localhost:9200/_cluster/health?pretty" | grep unassigned_shards"unassigned_shards":822,"delayed_unassigned_shards":0,[root@a es]# curl -s "localhost:9200/_cluster/health?pretty" | grep unassigned_shards"unassigned_shards":335,"delayed_unassigned_shards":0,

数量逐渐减少,说明好使

总结

记录一下ES提高分片恢复速度的处理方法

http://www.jsqmd.com/news/620005/

相关文章:

  • FlashAttention实战:如何在A100上实现3倍加速的Transformer训练(附代码)
  • 企业必看!私有化即时通讯的核心优势
  • 2026年200元内蓝牙耳机推荐:入耳降噪半入耳开放式怎么选?
  • Intellij怎么打jar包
  • 将盾CDN:备份与灾备建设的企业级实践
  • CSS如何监控样式表的加载状态_通过JS监听onload与onerror事件
  • 南开计算机复试C/C++编程能力测试怎么考?手把手教你用Code::Blocks/Dev-C++准备(附真题思路)
  • 机器人流程自动化(RPA)与AI结合,会取代哪些岗位?
  • 2026奇点大会闭门报告首度流出(仅限前500名开发者):AI原生移动端的LLM轻量化部署、实时推理压缩与端侧Agent编排全栈实践
  • 保姆级教程:用ROS 2 Humble + Python搞定CiA 402伺服电机的速度控制(附完整代码)
  • 将盾CDN:安全自动化响应的工作流设计
  • 小程序开发失败的常见原因有哪些?
  • 从金融交易到工业控制:NTP和PTP到底该怎么选?一张图看懂时间同步协议选型
  • 双膜储气柜的选择指南建议
  • 模糊综合评价法:如何量化那些“说不清”的复杂决策问题
  • AzurLaneAutoScript技术架构解析:游戏自动化脚本的模块化设计与计算机视觉实现
  • 别再手动点鼠标了!用Ansible批量管理Windows服务器,这10个运维场景我帮你整理好了
  • 收藏必备!小白程序员必看:Olmo Hybrid如何用混合架构超越纯Transformer模型,实现大模型性能飞跃!
  • ClearerVoice-Studio实操手册:WAV/AVI/MP4多格式输入与WAV标准输出规范
  • 基于STM32LXXX的数字电位器(CAT5171TBI-00GT3)驱动应用程序设计
  • 终极指南:如何高效使用ControlNet-v1-1_fp16_safetensors实现精准图像控制
  • 分布式拉曼散射光纤探测:技术原理、应用全景与未来趋势
  • 安防人脸识别场景下AR 眼镜接入公安网络合规实现方案全解析
  • 如何通过ctfileGet技术方案实现城通网盘直连下载效率提升300%
  • Python 连接 MySQL 数据库
  • 技术评审
  • RISC-V内存模型实战:如何用RVWMO规则优化你的多线程代码
  • 晶晨A311D开发板:从零构建Ubuntu/Debian固件的完整指南
  • 地缘下加密避风港,宝藏交易所 SUNX
  • 【linux不同版本】