1. 程式人生 > >ES shard unassigned的解決方法匯總

ES shard unassigned的解決方法匯總

hat call index 由於 can its resid add pre

說下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/

ES shard unassigned的解決方法匯總