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

相关推荐
AI智图坊3 分钟前
电商详情页转化率提升实战:基于AI的“卖点-视觉”转化链路设计与自动化实现
大数据·运维·人工智能·gpt·ai作画·自动化·aigc
chushiyunen6 分钟前
elasticsearch查询相关
大数据·elasticsearch·搜索引擎
段一凡-华北理工大学19 分钟前
工业领域的Hadoop架构学习~系列文章16:实时流处理架构 - 工业数据的实时动脉
大数据·数据仓库·hadoop·分布式·学习·架构·高炉炼铁
yyuuuzz25 分钟前
aws亚马逊云服务的基础认知与常见场景
大数据·运维·服务器·网络·云计算·aws
Data-Miner28 分钟前
休闲食品数据分析平台建设方案,70页ppt全解析
大数据·人工智能·数据分析
河北清兮网络科技30 分钟前
2026石家庄广告联盟APP开发成本明细|不同开发模式费用拆解
大数据·小程序·app·短剧app·广告联盟
Aloudata33 分钟前
宽表 vs 语义层:论 AI 时代语义编织对智能数据分析的重要性
大数据·人工智能·数据挖掘·数据分析·agent·语义层·语义编织
工业胶粘剂技术40 分钟前
工业胶粘剂选型指南:东莞科耀26款TDS型号与应用场景整理
大数据
老H科研技术1 小时前
第 02 篇:5 分钟搭建第一个 MCP 服务器
大数据·运维·服务器·人工智能·学习·aigc·ai编程
商业模式源码开发1 小时前
餐饮实体商业模式拆解:推三享一与异业联盟的合规落地架构
大数据·架构·异业联盟·私域流量·推三返一·商业观察