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

相关推荐
ACP广源盛1392462567337 分钟前
IX8024@ACP# 搭配此芯 AI 服务器 + 爱芯元智产品完整方案
大数据·运维·服务器·人工智能·分布式·嵌入式硬件
天行健,君子而铎1 小时前
2026年中国API安全产品综合排名:选型指南与技术趋势解析
大数据
李昊哲小课1 小时前
phoenix5.3.1整合hbase2.6.6
大数据·hbase·phoenix
qyr67891 小时前
全球新能源汽车电机驱动器市场深度调研报告
大数据·网络·人工智能·自动化·汽车
科技圈观察2 小时前
适合长期挂OpenClaw不关机的电脑有哪些?7×24小时稳定运行主机推荐
大数据·人工智能·科技
数字化老赵3 小时前
设备管理三好、四会、五律、五定,都是啥?
大数据·设备管理
智讯天下5 小时前
垂类数据基础设施:骨码智元GOMAX LAB如何重塑AI后训练数据供给体系
大数据·人工智能
麒麟信安5 小时前
第三届行业数智化发展峰会召开,麒麟信安核心内网虚拟化方案备受关注
大数据·麒麟信安·企业资讯
Elasticsearch5 小时前
从课程表到 AI 岗位:我如何用 Elastic Agent Builder 构建 SkillGap Radar
elasticsearch
延凡科技5 小时前
延凡科技IoT设备管理监控系统:赋能工业智能制造
大数据·科技·物联网·制造