Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to upgrade a running Elasticsearch older instance to a newer version?

Essentially I cannot find documents or resources that explains the procedure of upgrading a running Elasticsearch instance into the current version.

Please help me out in a few scenarios:

  1. If I am running an Elasticsearch instance in a single server, how do I upgrade the instance and not lose data?

  2. If I am running multiple Elasticsearch instances in a number of servers, how do I keep my operations running, while I upgrade my Elasticsearch instances without losing data?

If there are proper procedures or explanations on this it will greatly help my understanding and work. Thanks!

like image 834
Jonathan Moo Avatar asked Feb 29 '12 10:02

Jonathan Moo


People also ask

How do I update my Elastic version?

To upgrade to 8.3. 3 from 7.16 or an earlier version, you must first upgrade to 7.17, even if you opt to do a full-cluster restart instead of a rolling upgrade. This enables you to use the Upgrade Assistant to identify and resolve issues, reindex indices created before 7.0, and then perform a rolling upgrade.

What is rolling upgrade in Elasticsearch?

A rolling upgrade allows an Elasticsearch cluster to be upgraded one node at a time so upgrading does not interrupt service.


1 Answers

  1. All node data is stored in elasticsearch data directory. It's data/cluster_name/nodes by default in elasticsearch home. So, in general, as long as data directory is preserved and config files in the new version are compatible with the old version, the new instance should have the same data as the old one. Please note that some releases have special additional requirements outlined in release notes. For example, upgrade to 0.19 from 0.18 requires issuing a full flush of all the indices in the cluster.

  2. There is really no good way to accomplish this. Nodes are communicating using binary protocol that is not backward compatible. So, if protocol in the new version changes, old nodes and new nodes are unable to understand each other. Sometimes it's possible to mix nodes with different minor versions within the same cluster and do rolling upgrade. However, as far as I understand, there is no explicit guarantee on compatibility between nodes even within minor releases and major releases always require require full cluster restart. If downtime during full cluster restart is not an option, a nice technique by DrTech might be a solution.

like image 123
imotov Avatar answered Sep 20 '22 18:09

imotov