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
    }
    }
    ]
    }

相关推荐
媒介发稿小能手2 分钟前
合规优化与API接口协同:2026年靠谱GEO媒介资源平台推荐清单
大数据·人工智能
知识分享小能手8 分钟前
Hadoop学习教程,从入门到精通, 部署Hadoop 3.x — 知识点详解(2)
大数据·hadoop·学习
涛思数据(TDengine)30 分钟前
从时序数据库到工业AI:涛思数据参编“人工智能+工业软件”评价规范,推动工业数据标准
大数据·数据库·人工智能·时序数据库·tdengine·涛思数据·工业数据库
CyberwayTech38 分钟前
赛博威线上营销费用管理咨询:重构企业电商费用管理体系
大数据·人工智能·it·赛博威·营销费用管理·营销费用管理咨询
五度易链-区域产业数字化管理平台1 小时前
产业大脑技术架构拆解:从多源数据治理到产业链断点识别的全链路实现逻辑
大数据
大大大大晴天️1 小时前
Flink-HBase生产问题排查:NoClassDefFoundError
大数据·flink·hbase
财经资讯数据_灵砚智能1 小时前
基于全球经济类多源新闻的NLP情感分析与数据可视化(日间)2026年6月8日
大数据·人工智能·python·ai·信息可视化·自然语言处理·灵砚智能
计算机安禾1 小时前
【数据库系统原理】第10篇:SQL高级查询机制:嵌套子查询与相关子查询的执行窥探
大数据·数据库·sql
数据分析能量站1 小时前
Anthropic关于AI的看法:人类研发正在快速边缘化
大数据·人工智能
鼎讯信通1 小时前
从“盲挖”到“精准敲击”:能源管网维护的一种新思路
大数据·网络·能源