【Elasticsearch】cannot allocate because allocation is not permitted to any of the nodes

Insert picture description here

1 Overview

Reprinted: https://www.cnblogs.com/gqdw/p/12632585.html

0. Phenomenon

es cluster reported red, there are unassigned shared,
with the command curl localhost:9200/_cat/shards |grep UNASSIGNEDcan be viewed.
Even if you add nodes right away, there is still no improvement. The new node will not work normally, it may be related to the cluster red.

1. Root cause

Insufficient node disks cause some shards to be unallocated. In general, clusters will have a water level setting. For example, you can set 50G or not write data to it when it reaches 85%,
but a previous failure caused it to Let go of this restriction and not add it afterwards.

You can use the command:

GET /_cluster/allocation/explain

View detailed reasons.

2. Solution

POST /_cluster/reroute?retry_failed=true

The mechanism of es seems to stop after trying 5 times. Restarting the master or node is invalid. You can retry by executing the above command.

3. Postscript

The thing of es is still complicated and heavy. It is difficult to maintain the large amount of data without professional team maintenance.

Guess you like

Origin blog.csdn.net/qq_21383435/article/details/109136021