Hi ssablan! That’s a great question.
You might find the upgrade even easier when using RPM versus Docker because you don’t have to spin up a new environment, having to worry about mappings and such.
You can take either of two approaches:
This is the “cluster restart” method:
- Shut down the service on all nodes in the cluster:
sudo systemctl stop opensearch
2).For each node, download the new package and install it. It will use your old configuration. I would still recommend that you back up the config files remotely just to be safe.
sudo rpm -ivh opensearch-2.5.0-linux-x64.rpm
- Then start up the service and the cluster should bootstrap to 2.5.0
sudo systemctl start opensearch
This is the “rolling upgrade” method:
- Pick a node you want to upgrade first. Save a master-eligible node to upgrade last, because it will continue to be the cluster manager until you take it offline, then the cluster bootstraps to the new version.
- Shut down OpenSearch on only the node you want to upgrade first:
sudo systemctl stop opensearch
- Upgrade it using the new package:
sudo rpm -ivh opensearch-2.5.0-linux-x64.rpm
- Then start the service:
sudo systemctl start opensearch
- Repeat those steps for each of the other 2 nodes. As they come back online they’ll join the cluster again, and if you run the following query you can see how the leader hat gets passed as versions get moved:
curl -s "https://localhost:9201/_cat/nodes?v&h=name,version,node.role,master" \
-ku admin:admin | column -t
Something I like to do when I upgrade nodes in a cluster is open a few terminal windows with tmux
so I can run looping queries in windows to give me an idea of what’s happening with the cluster while I work. I like to use variations of this:
while true; do echo 'os-node-01 _cat/nodes'; \
curl -s "https://localhost:9201/_cat/nodes?v&h=name,version,node.role,master" -ku admin:admin | column -t; echo ''; \
echo 'os-node-01 _cat/shards'; curl -s "https://localhost:9201/_cat/shards" -ku admin:admin; echo ''; \
echo 'os-node-01 _cluster/health'; curl -s "https://localhost:9201/_cluster/health?pretty" -ku admin:admin; \
sleep 5; clear; done
Let us know if you have any questions about the upgrade!