In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)05/31 Report--
This article is to share with you about the Elasticsearch cluster version upgrade steps and points for attention, the editor feels very practical, so share with you to learn, I hope you can get something after reading this article, say no more, follow the editor to have a look.
1. Preparatory work before upgrading
Download the latest version of Elasticsearch from Elasticsearch's official website, https://www.elastic.co/downloads/elasticsearch, and choose a .gz.tar or .zip file for online management of packets.
Extract the latest version of the file archive to the specified directory and back up the elasticsearch.yml file in the config directory (you can simply rename it to elasticsearch.yml.bak). Then copy the contents of the configuration file elasticsearch.yml file in the current version of Elasticsearch to the latest version of the config directory.
Check whether the Java environment in the system is normal. The current version of Elasticsearch must use Java 1.7.0 or above to start Elasticsearch normally.
Modify the elasticsearch.in.sh file in the bin directory about the Elasticsearch JVM memory configuration size:
This value can be adjusted to a larger value as needed. In this way, the error of Too many open files will not occur when there are many index in Elasticsearch:
If you see the above, it indicates that the new version of Elasticsearch is working properly. Next, you are ready to change the node ES version.
2. Rolling upgrade of cluster
Rolling upgrade (Rolling upgrade)
Rolling upgrade's backup process allows users to upgrade only a specific node in the cluster at a time. Because the Elasticsearch cluster has a very good disaster recovery mechanism, when a node in the cluster is deleted, the data is not lost, but can be restored by the copies on the other nodes.
It is not recommended to run multiple versions of Elasticsearch instances in a cluster for a long time, because when deleted nodes are restored, aggregating data from multiple versions of instances to the same node may cause the node to fail to work.
Next, let's describe the steps of Rolling upgrade upgrade:
Turn off the real-time allocation option for shard so that it can be started quickly after the cluster shutdown. This parameter is enabled by default. By default, when the instance starts, it attempts to copy the relevant shard copies from other node instances locally, which will waste a lot of time and IO resources. If the real-time allocation option is turned off, when a new instance starts and tries to join the cluster, it does not copy shard copies from other instances. When the instance is fully started, you should turn this option on again to provide long-term disaster recovery.
Curl-XPUT localhost:9200/_cluster/settings-d'{"transient": {"cluster.routing.allocation.enable": "none"}'
Close the node instance that you want to upgrade and remove it from the cluster
Curl-XPOST 'http://localhost:9200/_cluster/nodes/_local/_shutdown'
After removing the node, wait for the remaining node data transfer to complete until it is determined that all shard are allocated correctly.
Upgrade the Elasticsearch version of the node, the simplest and safest way is to download a new Elasticsearch version to the local, and copy the original Elasticsearch configuration file to the new version, it is best to establish an Elasticsearch soft connection to the directory where the latest version of the file is located, which can be used conveniently in the future.
Start the upgraded node ES instance and check that it has been correctly added to the cluster.
Reopen the shard reallocation option (real-time allocation option)
Curl-XPUT localhost:9200/_cluster/settings-d'{"transient": {"cluster.routing.allocation.enable": "all"}'
Check that all shard are allocated correctly and observe that the cluster is performing load balancing (that is, each node is assigned an equal number of shard)
Repeat the above process to each node in the cluster until all nodes in the cluster have completed the version upgrade.
These are the steps and precautions for upgrading the Elasticsearch cluster version. The editor believes that there are some knowledge points that we may see or use in our daily work. I hope you can learn more from this article. For more details, please follow the industry information channel.
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: 259
*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.