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

相关推荐
fqrj20261 分钟前
网站建设公司怎么选?国内口碑网站建设公司推荐哪家?
大数据·人工智能·html·网站开发
newsxun11 分钟前
布局大湾区“黄金内湾”,HECHTER CAFE亚洲首店落子万象滨海购物村
大数据·人工智能
源码之家13 分钟前
计算机毕业设计:Python股票数据可视化与LSTM股价预测系统 Flask框架 LSTM Keras 数据分析 可视化 深度学习 大数据 爬虫(建议收藏)✅
大数据·python·深度学习·信息可视化·django·lstm·课程设计
juniperhan14 分钟前
Flink 系列第14篇:Flink Metrics 监控指标详解(生产环境版)
大数据·数据仓库·分布式·flink
国产化创客20 分钟前
RuView开源项目Rust构建部署
大数据·物联网·嵌入式·信息与通信·智能硬件·wifi csi
InfiniSynapse35 分钟前
打工人ai效率工具:一键修改excel
大数据·人工智能·数据分析·excel·ai编程
m0_5649149237 分钟前
AI科技应用课
大数据·人工智能·机器学习
oort12338 分钟前
奥尔特云智慧园林融合物联网、大数据、地理信息系统与人工智能技术,构建数字化管理平台,推动园林养护从传统经验模式升级为智能化决策模式,为创建达标园林提供科技支撑
大数据·用户运营
Elastic 中国社区官方博客1 小时前
自动化可靠性:自愈型企业的架构
运维·elasticsearch·搜索引擎·云原生·架构·自动化·serverless
ldj20201 小时前
Filebeat 采集数据到Elasticsearch
elasticsearch·filebeat