ES shard unassigned的解决方法汇总

本文涉及的产品
检索分析服务 Elasticsearch 版,2核4GB开发者规格 1个月
简介:

说下shard出现的几个状态说明:

  • relocating_shards shows the number of shards that are currently moving from one node to another node(现网中遇到,因为kill -9重启es的方法不对,导致node下线,集群重新分配shard). This number is often zero, but can increase when Elasticsearch decides a cluster is not properly balanced, a new node is added, or a node is taken down, for example(我们的ES集群没有副本,很可能由于网络不稳定导致单个节点下线,从而重新分配shard).
  • initializing_shards is a count of shards that are being freshly created. For example, when you first create an index, the shards will all briefly reside in initializing state. This is typically a transient event, and shards shouldn’t linger in initializing too long. You may also see initializing shards when a node is first restarted: as shards are loaded from disk, they start as initializing.(现网遇到过)
  • unassigned_shards are shards that exist in the cluster state, but cannot be found in the cluster itself. A common source of unassigned shards are unassigned replicas. For example, an index with five shards and one replica will have five unassigned replicas in a single-node cluster. Unassigned shards will also be present if your cluster is red (since primaries are missing).

其中unassigned_shards的问题是比较头痛的,我汇总了网上的解决方法,大家后面遇到可以参阅:

 

总结得最整的是 https://www.datadoghq.com/blog/elasticsearch-unassigned-shards/

单独针对主shard出现unassigned的解决可以看 http://blog.kiyanpro.com/2016/03/06/elasticsearch/reroute-unassigned-shards/ https://t37.net/how-to-fix-your-elasticsearch-cluster-stuck-in-initializing-shards-mode.html http://www.wklken.me/posts/2015/05/23/elasticsearch-issues.html

单独针对副本shard出现unassigned的解决可以看 https://z0z0.me/recovering-unassigned-shards-on-elasticsearch/  https://dpatil1410.wordpress.com/2016/09/24/its-red-how-do-i-recover-unassigned-elasticsearch-shards/

 


















本文转自张昺华-sky博客园博客,原文链接:http://www.cnblogs.com/bonelee/p/7459509.html,如需转载请自行联系原作者


相关实践学习
使用阿里云Elasticsearch体验信息检索加速
通过创建登录阿里云Elasticsearch集群,使用DataWorks将MySQL数据同步至Elasticsearch,体验多条件检索效果,简单展示数据同步和信息检索加速的过程和操作。
ElasticSearch 入门精讲
ElasticSearch是一个开源的、基于Lucene的、分布式、高扩展、高实时的搜索与数据分析引擎。根据DB-Engines的排名显示,Elasticsearch是最受欢迎的企业搜索引擎,其次是Apache Solr(也是基于Lucene)。 ElasticSearch的实现原理主要分为以下几个步骤: 用户将数据提交到Elastic Search 数据库中 通过分词控制器去将对应的语句分词,将其权重和分词结果一并存入数据 当用户搜索数据时候,再根据权重将结果排名、打分 将返回结果呈现给用户 Elasticsearch可以用于搜索各种文档。它提供可扩展的搜索,具有接近实时的搜索,并支持多租户。
相关文章
|
3月前
|
存储 安全 文件存储
【elasticsearch】es6重启服务后数据消失,es6如何配置数据持久化储存
【elasticsearch】es6重启服务后数据消失,es6如何配置数据持久化储存
38 1
|
3月前
|
NoSQL Redis C++
c++开发redis module问题之对于写命令,进行主备复制和写AOF,如何解决
c++开发redis module问题之对于写命令,进行主备复制和写AOF,如何解决
|
5月前
|
API 索引
Elasticsearch Index Shard Allocation 索引分片分配策略
Elasticsearch Index Shard Allocation 索引分片分配策略
128 1
|
11月前
Kibana配置ES集群(6.x版本之前和7.x版本两种写法)
Kibana配置ES集群(6.x版本之前和7.x版本两种写法)
66 0
|
12月前
|
索引
如何在已创建的 es 索引中增加分片
如何在已创建的 es 索引中增加分片
|
存储 分布式计算 安全
ES索引备份还原
es数据出于线上数据安全考虑,对于es已有的索引数据可以进行安全备份,通常可以将es备份到共享文件目录或者一些其它的数据存储的文件系统eg:HDFS、Amazon S3、Azure Cloud。备份会生成索引的快照存储到指定的仓库路径下,当需要进行数据还原的时候,就可以通过访问备份还原的接口快速实现数据还原。
237 0
ES索引备份还原
|
索引
ES recovery、主副分片复制会有一段时间block写入?
ES在主副本分片复制时候不会block写入(version > 2.x) ES在recovery主分片时候会有一段时间block写入
476 0
ES recovery、主副分片复制会有一段时间block写入?
|
存储 索引
elasticsearch(es) 集群恢复触发配置(Local Gateway参数)
elasticsearch(es) 集群恢复触发配置(Local Gateway) 当你集群重启时,几个配置项影响你的分片恢复的表现。 首先,我们需要明白如果什么也没配置将会发生什么。 想象一下假设你有 10 个节点,每个节点只保存一个分片,这个分片是一个主分片或者是一个副本分片,或者说有一个有 5 个主分片/1 个副本分片的索引。
1763 0
|
SQL Go 数据库
SQL Server 批量主分区备份(Multiple Jobs)
原文:SQL Server 批量主分区备份(Multiple Jobs) 一.本文所涉及的内容(Contents) 本文所涉及的内容(Contents) 背景(Contexts) 案例分析(Case) 方案一(Solution One) 方案二(Solution Two) 方案三(So...
1171 0