In both cases, to upgrade a node, the following are the easiest steps to upgrade a version node by node:
Disable the routing allocation, as discussed in the previous section.
Stop the node.
Take a backup of the data.
Take a backup of the configuration files.
Remove Elasticsearch (you can simply purge it to complete the uninstallation of Elasticsearch from the server by running this command: sudo apt-get purge Elasticsearch)
Install Elasticsearch with the latest release.
Change the configuration files according to the previous settings.