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

相关推荐
南棱笑笑生4 分钟前
20260127让天启AIO-3576Q38开发板跑Rockchip瑞芯微原厂的Buildroot【linux-6.1内核】【使用天启Firefly的DTS】
linux·运维·elasticsearch·rockchip
CHrisFC8 分钟前
江苏硕晟 LIMS 系统:加速环境检测机构合规化进程的利器
大数据·人工智能
智能相对论15 分钟前
Hilight开启公测:营销视频的“DeepSeek时刻”,来了
大数据·人工智能·音视频
计算机毕业编程指导师17 分钟前
【Python大数据选题】基于Hadoop+Spark奥运会金牌榜可视化分析系统源码 毕业设计 选题推荐 毕设选题 数据分析 机器学习 数据挖掘
大数据·hadoop·python·计算机·spark·毕业设计·奥运会金牌
袋鼠云数栈18 分钟前
袋鼠云产品功能更新报告(第16期)|离线开发新进化:AI辅助与架构升级
大数据·人工智能·架构
TTBIGDATA24 分钟前
【Hue】Hue 访问 Hadoop 权限问题出现 403 的解决办法
大数据·hadoop·分布式·ambari·hdp·hue·bigtop
【赫兹威客】浩哥28 分钟前
【赫兹威客】伪分布式ZooKeeper测试教程
大数据·分布式·zookeeper
小北方城市网34 分钟前
Elasticsearch 分布式检索生产级优化:从索引设计到查询性能
java·大数据·运维·redis·分布式·elasticsearch·搜索引擎
大志哥12336 分钟前
使用logstash和elasticsearch实现日志链路(一)
大数据·elasticsearch·搜索引擎
2401_8353024844 分钟前
击穿测试护航,解锁薄膜聚合物的安全密码
大数据·人工智能·功能测试·安全·制造·材料工程