This article is a mirror article of machine translation, please click here to jump to the original article.

View: 7623|Reply: 0

Causes and solutions for unassigned_shards single-node Elasticsearch

[Copy link]
Posted on 12/13/2018 3:07:56 PM | | | |
View the health status of a single-node Elasticsearch



Use the head plugin to view the cluster status



From the above screenshot, it can be seen that there are 5 unassigned shards, when the index blog5 is created, the number of shards is 5, the number of replicas is 1, and the cluster status becomes yellow after the new creation, the root cause is that the cluster has not enabled replica shards, let's take a look at the introduction of replica shards given on the official website:

The main purpose of replica sharding is for failover, as discussed in Principles within a cluster: if the node holding the primary shard hangs up, a replica shard is promoted to the role of the primary shard.

Then it can be seen that replica shards and primary shards cannot be placed on one node, but in a cluster with only one node, replica shards cannot be assigned to other nodes, so all replica shards are unassigned. Because there is only one node, if there is a primary shard node hanged, then the entire cluster should be hung up, and there is no case where the replica shard is upgraded to the primary shard.

The solution is to delete the index with replica shards in the single-node elasticsearch cluster, and set the replicas of the new index to 0. Then check the cluster status



The number of copies of the new index is set to 0



The cluster is healthy







Previous:NetEase News APP, Himalayan APP data interface
Next:Windows Server 2008 Add Auto-Startup Program [Turn]
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com