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

相关推荐
释厄6235 分钟前
短漫同体律——智能体生成真人与动漫无差·短剧漫剧即宣告宣传
大数据·人工智能
redsea_HR3 小时前
三类核心人才一体化管理选型:如何评估平台化能力与模块协同水平?
大数据·人工智能
岳涛_daemon4 小时前
什么都没配,ES 的 HNSW 早停在 9.3 前后创建的索引默认值不一样,按创建版本算
elasticsearch
Elastic 中国社区官方博客5 小时前
从 137,306 行日志定位到一个故障副本:在 Kibana 中排查错误激增
大数据·运维·人工智能·安全·elasticsearch·搜索引擎
Francek Chen5 小时前
【大数据处理与分析】Spark:03 Spark运行架构
大数据·hadoop·分布式·架构·spark
要吃这碗饭5 小时前
甲骨文云(Oracle Cloud)注册教程:免费套餐、账号申请与常见问题解决
大数据·数据库·oracle
阿明副业观察5 小时前
首尾帧AI视频:零基础快速上手指南
大数据·人工智能·ai作画·aigc·音视频·ai写作
涛思数据(TDengine)6 小时前
TDengine 查询引擎 3.4:概念、功能、性能、维护四维升级全解
大数据·人工智能·tdengine·工业ai
国际学术会议-杨老师7 小时前
2027年统计学、大数据与数据分析国际会议(ICSBDDA 2027)
大数据·数据分析·统计学
Elasticsearch7 小时前
无需改动一行代码:在 Java 应用中使用 OpenTelemetry 的四种方式
elasticsearch