ElasticSearch 7.x现网运行问题汇集1

问题描述:

现网ElasticSearch health状态变为red,有分片无法assign。如下摘录explain的结果部分:

复制代码
    "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": "demo-2022.02.06",
    "shard": 3,
    "primary": true,
    "current_state": "unassigned",
    "unassigned_info": {
        "reason": "CLUSTER_RECOVERED",
        "at": "2023-05-29T08:08:22.697Z",
        "last_allocation_status": "no_valid_shard_copy"
    },
    "can_allocate": "no_valid_shard_copy",
    "allocate_explanation": "cannot allocate because all found copies of the shard are either stale or corrupt",
。。。
"store": {
                "in_sync": true,
                "allocation_id": "82iRvG0KTTm9NT_5Fx8BRA",
                "store_exception": {
                    "type": "corrupt_index_exception",
                    "reason": "failed engine (reason: [corrupt file (source: [start])]) (resource=preexisting_corruption)",
                    "caused_by": {
                        "type": "i_o_exception",
                        "reason": "failed engine (reason: [corrupt file (source: [start])])",
                        "caused_by": {
                            "type": "corrupt_index_exception",
                            "reason": "checksum passed (d87020fd). possibly transient resource issue, or a Lucene or JVM bug (resource=BufferedChecksumIndexInput(NIOFSIndexInput(path=\"/data/es/data/nodes/0/indices/dzcoAoZjSzGus0qj1sKTFg/3/index/segments_6\")))"
                        }
                    }
                }
            }

解决方案:

  1. 步骤1: 检查shard stores

GET /_shard_stores?pretty ,得到分片损坏的明细,以便进行修复,得到如图:

  1. 步骤2: reroute index

    POST /_cluster/reroute?master_timeout=5m
    {
    "commands": [
    {
    "allocate_empty_primary": {
    "index": "demo-2023.04.04",
    "shard": 2 ,
    "node": "{nodename}",
    "accept_data_loss": true
    }
    }
    ]
    }

相关推荐
yyuuuzz3 分钟前
独立站运营的几个技术层面常见问题
大数据·运维·服务器·网络·数据库·aws
XIAOYU6720136 分钟前
高中物理成绩优异,适合报考大数据哪个细分专业数学成绩偏弱,还适合填报大数据相关专业吗
大数据
2601_954971137 分钟前
大数据需要掌握哪些主流大数据工具框架
大数据
Urbano41 分钟前
工装标准缝纫流程及自动化升级提质增产方案
大数据·人工智能·算法
wanghowie1 小时前
35. 从AI客服到AI运营助手:Workflow、Single Agent、Multi-Agent、Agent Native 的架构选型实践
大数据·人工智能·架构
湘美书院--湘美谈教育1 小时前
湘美谈教育湘美书院考古教育系列:湖湘一万年序列整理研究
大数据·人工智能·深度学习·神经网络·机器学习
财经资讯数据_灵砚智能1 小时前
基于全球经济类多源新闻的NLP情感分析与数据可视化(日间)2026年6月10日
大数据·人工智能·python·ai·信息可视化·自然语言处理·灵砚智能
万岳科技程序员小金1 小时前
SaaS还是源码部署?网校教育平台开发方案对比
大数据·在线教育系统源码·教育软件开发·教育小程序开发·教育网校平台搭建
yyuuuzz1 小时前
游戏云服务器推荐的技术选择思路
大数据·运维·服务器·游戏·云计算·aws
阳明山水1 小时前
自下而上 vs 自上而下 vs 最优组合预测策略解析
大数据·人工智能·深度学习·算法·机器学习