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博客21 小时前
智能情感分析与品牌策略优化:如何通过AI洞察提升企业市场响应力
大数据·数据库·人工智能
亚古数据21 小时前
法国公司的类型:探索法国企业的多样形态
大数据·人工智能·亚古数据·法国公司
金融小师妹1 天前
3月美联储货币政策决策的动态博弈——基于就业市场数据与通胀预测的AI模型分析
大数据·人工智能·深度学习·机器学习
冯RI375II694871 天前
办理电池UN38.3认证:如何准备申请材料?
大数据
工具人55551 天前
EEA是什么?—— 汽车的“神经系统”与“组织结构”
大数据
你有医保你先上1 天前
go-es:一个优雅的 Elasticsearch Go 客户端
后端·elasticsearch
物联网软硬件开发-轨物科技1 天前
【技术白皮书】光伏电站数智化技改技术白皮书:从老旧场站到高收益智能资产的演进路径
大数据·运维·服务器
2501_946490381 天前
Hirender MTC时间码技术实操——PH®CLUB激光投影声光电精准同步实现方案
大数据·运维·人工智能·hirender·hecoos
诚思报告YH1 天前
半导体石英制品市场洞察:2026-2032年复合增长率(CAGR)达9.2%
大数据·人工智能
云器科技1 天前
从“数据中台“到“数智基建“:一树药业的湖仓架构升级实践
大数据·架构·湖仓平台