-
Notifications
You must be signed in to change notification settings - Fork 13
Upgrading Elasticsearch 2.x to 5.y
The procedure of upgrading the existing instance of Elasticsearch should be relatively straightforward with limited downtime of the service.
I am writing this in perspective of upgrading our single-node instance, however, in case of multi-node setup the procedure should be nearly identical.
We already had indexed data inside our cluster before commencing the upgrade and did not lose or damage any of it after completing the procedure. However, as always in such case, full cluster backup is recommended. This is described in details on the Elasticsearch website: https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-snapshots.html
Since the upgrade was between major release versions, we required a full cluster restart what is described in details in https://www.elastic.co/guide/en/elasticsearch/reference/current/restart-upgrade.html.
However, in our case there was an additional change required to bring back the service.
We had our heap size set as an environmental variable, ES_HEAP_SIZE
, declared in /etc/default/elasticsearch
file. While this was a valid way of setting it in 2.X, it would not work on 5.Y and different approach had to be taken. That particular setting had to be removed from the file and /etc/elasticsearch/jvm.options
had to be modified instead. Assuming our heap was originally set to 30g, the following had to be added:
-Xms30g
-Xmx30g
After that the service could have been started as normal.