首页 > 其他分享 >Consider using `allow_partial_search_results` setting to by

Consider using `allow_partial_search_results` setting to by

时间:2023-09-25 11:11:26浏览次数:38  
标签:node index search partial Consider 這個 shards unassigned data

Elasticsearch data node 重啟導致 sharding 找不到家

 

今天遇到單位同仁重啟 Elasticsearch data node 後發現 Cluster 狀態變成 Red 的狀況,這篇記錄遇到這個問題時該怎麼處理

 

會遇到這個問題通常是「遺失的 Data node」大於「index.number_of_replicas」,Elasticsearch replication 預設為 1 也就是只有 1 個備份,而 Data node 最大只能消失 1 台,不然就會少掉 index sharing 無法拼湊完整的 index。

 

在這個案例是不小心操作錯誤將 Data node 下線,但是 index data 仍存在,將 Data node 重新加入 Cluster 後仍然會出現 index shards 缺少的狀況。

Search rejected due to missing shards [[.kibana_task_manager_1][0]]. Consider using `allow_partial_search_results`

 

從 localhost:9200/_cluster/health 看目前 Cluster 狀況:

{
  "cluster_name":"xxx",
  "status":"red",
  ... 
  "initializing_shards":20,
  "unassigned_shards":13983,
  "delayed_unassigned_shards":0,
  "number_of_pending_tasks":28,
  ...
}

其中會發現 unassigned_shards 這個數字有點異常,這個參數是代表目前有 13983 個 index shard 找不到家 (data node),意味著

  1. index shard 資料仍然存在
  2. 要替這些 unassigned shards 找到適合的 data node 分配
 

遇到 unassigned_shards 可以透過 Elasticsearch transient update 一次性讓 shard 找到 data node

curl -X PUT "localhost:9200/_cluster/settings?pretty" -H 'Content-Type: application/json' -d'
{
    "transient" : {
        "cluster.routing.allocation.enable" : "all"
    }
}'
 

再從 localhost:9200/cluster/health 查看 unassigned_shards 應該要陸續下降,狀態也應該會從 red -> yellow -> green 恢復正常

标签:node,index,search,partial,Consider,這個,shards,unassigned,data
From: https://www.cnblogs.com/iancloud/p/17727487.html

相关文章

  • Logstash报错: Could not index event to Elasticsearch
    Logstash报错:CouldnotindexeventtoElasticsearch 一、环境说明Logstash7.3ElasticSearch7.3二、现象logstash/logs/logstash-plain.log大量警告:ValidationFailed:1:thisactionwouldadd[1]totalshards,butthisclustercurrentlyhas[1000]/[1000]maximum......
  • Easysearch 压缩功能的显著提升:从 8.7GB 到 1.4GB
    引言在海量数据的存储和处理中,索引膨胀率是一个不可忽视的关键指标。它直接影响了存储成本和查询性能。近期,Easysearch在这方面取得了显著的进展,其压缩功能的效果远超过了之前的版本。本文将详细介绍这一进展。Easysearch各版本压缩性能对比根据之前文章的数据,Easysearchv1.1在......
  • elasticsearch 基础知识
    正向索引和倒排索引环境下载windows版本HTTPS报错elasticsearch报错[2023-09-24T21:04:50,988][WARN][o.e.h.n.Netty4HttpServerTransport][HOMEDESKTOP-TG]receivedplaintexthttptrafficonanhttpschannel,closingconnectionNetty4HttpChannel于Windows版......
  • C - 321-like Searcher
    题意:给定一个数K,问第K小的数是多少,数字严格按照按321式递减可知,数最大为987654321,可以暴力枚举点击查看代码#include<bits/stdc++.h>usingnamespacestd;#defineLLlonglongvector<LL>ans;LLs;voiddfs(intx){ s=s*10+x; ans.push_back(s); for(inti......
  • Docker 部署 Elasticsearch 8.6.2
    Docker部署Elasticsearch8.6.2dockerpullelasticsearch:8.6.2mkdir-pv/home/zonglin/elasticsearch/pluginssudodockerrun--nameelasticsearch-p9200:9200-p9300:9300\--restart=always\-e"discovery.type=single-node"\-eES_JAVA_......
  • Elasticsearch 常用指令
    Elasticsearch常用指令查询所有节点$curl'http://127.0.0.1:9200/_cat/nodes'192.168.31.127496102.162.112.03dilmrt*node-1查询集群状态$curl-k'http://127.0.0.1:9200/_cluster/health?pretty'{"cluster_name":"docker-clus......
  • ElasticSearch 查询练习
    ......
  • Elasticsearch 配置参数
    Elasticsearch配置参数1.elasticsearch配置文件说明:elasticsearch: bin: lib: modules: logs: plugins: config: elasticsearch.yml#elasticsearch配置文件 jvm.options#jvm配置文件 log4j2.properties#......
  • elasticsearch 集群搭建
    elasticsearch集群搭建elasticsearch.ymlcluster.name:bigdatanode.name:node-1path.data:/usr/local/las/data/elasticsearchpath.logs:/usr/local/las/log/elasticsearchbootstrap.memory_lock:falsebootstrap.system_call_filter:falsenetwork.host:0.0.0.0ne......
  • ElasticSearch RestFul 风格
    ......