In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-02 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/02 Report--
This article introduces the knowledge about "how to solve the shard unassigned problem after ElasticSearch restart". In the actual case operation process, many people will encounter such difficulties. Next, let Xiaobian lead you to learn how to deal with these situations! I hope you can read carefully and learn something!
Environment:
Ubuntu16.04
elasticsearch 6.2.3
3 master nodes, 10 data nodes
Each shard has one copy
Faults:
Replace elasticsearch for a data node with docker elasticsearch, and the word segmenter is not added to the plugins. After adding the word segmenter to the plugins, it was found that some fragments were not allocated, but the ES cluster started normally, but it was always in yellow state. And unassigned shards have not been assigned.
solutions
Start with GET user/_recovery? active_only=true Cluster was found and no replica recovery was performed.
Click on the unallocated shard and find allocation_status: "no_attempt"
The reason is that the shard automatic allocation has reached the maximum number of retries 5 times and still fails, so it leads to "shard allocation status is already: no_attempt". At this point in Kibana Dev Tools, execute the command POST /_cluster/reroute? retry_failed=true. The maximum number of retries is controlled by the index.allocation.max_retries parameter.
The cluster will attempt to allocate a shard a maximum of index.allocation.max_retries times in a row (defaults to 5), before giving up and leaving the shard unallocated.
ElasticSearch automatically performs Load Balancer after reroute is executed. The Load Balancer parameter cluster.routing.rebalance.enable defaults to true.
It is important to note that after processing any reroute commands Elasticsearch will perform rebalancing as normal (respecting the values of settings such as cluster.routing.rebalance.enable) in order to remain in a balanced state.
summary
In general, ElasticSearch automatically assigns those unassigned shards, and when it finds that some shards have not been assigned for a long time, first look at whether it is because: too many primary shards and replicas are specified for the index, and then there are not enough machines in the cluster. Another reason is mentioned in this article: due to a failure, the shard auto-allocation has reached the maximum number of retries, and reroute can be executed.
"How to solve the shard unassigned problem after ElasticSearch restart" is introduced here. Thank you for reading. If you want to know more about industry-related knowledge, you can pay attention to the website. Xiaobian will output more high-quality practical articles for everyone!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.