For this tutorial, it is assumed that MariaDB repositories are active in the nodes. This will update MariaDB minor versions that should always be compatible between them. eg 10.5.6 and 10.5.7, where 10.5 is the Major version and .6 and .7 are the minor.
This was written based on a Centos8/Redhat8 cluster, but for other Linux flavors, it should be the same, replacing the update method from yum to apt or other appropriate to the Linux distribution.
In order to keep an eye on what is happening in the cluster during the update, open a shell in every node and run tail -f /var/log/messages
Here you will see messages relates with node departure, node joining and syncing, etc.
To upgrade the nodes, for each node, do the following steps:
- Stop mariadb
# systemctl stop mariadb
At this point there should be some messages on other nodes about this node leaving. - Run
yum update
ordnf update
- When the update it complete, reboot the server.
- After the node is back up, start MariaDB
systemctl start mariadb
New messages on other nodes inside messages log should show this node joining and requesting a DONOR. - Now, we have to adjust mysql tables to the new version, if needed, and mark them as compatible with the new version. To do this, run:
mysql_upgrade --skip-write-binlog
Repeat this process for all the nodes. mysql_upgrade will act on local mysql database, so this has to be done on all nodes.
If the service was stopped for a long time, nodes can take several minutes, if not hours, to sync back, depending on the amount of data and how much out of sync the node is.
On a 3 nodes cluster, there should be a node available all the time while the other two are syncing, as one will be flagged as DONOR and the other will be out of sync.
More info: https://mariadb.com/kb/en/upgrading-between-minor-versions-with-galera-cluster/