Upgrading Galera Cluster from MariaDB 10.1 to 10.2
Beginning in MariaDB 10.1, Galera Cluster ships with the MariaDB Server. Upgrading a Galera Cluster node is very similar to upgrading a server from MariaDB 10.1 to MariaDB 10.2. For more information on that process as well as incompatibilities between versions, see the Upgrade Guide.
Upgrading the Node
Galera Cluster supports rolling updates by design. By updating one node at a time, then waiting for it to sync back up with the cluster, you can bring all nodes to the latest version without the penalty of any downtime.
Preparing the Server
When using the official repositories for your Linux distribution or FreeBSD operating system, you can upgrade the node by running the update command on your package manager.
MariaDB also hosts repositories for several Linux distributions, which you can add to your system using the Repository Configuration Tool. When the server was installed using these repositories, you need to edit the .repo
or .list
file and increment the version number in the repository URL.
For instance, on CentOS, this would involve changing 10.1 to 10.2 in the baseurl
field.
# vi /etc/yum.repos.d/mariadb.repo [mariadb] name = MariaDB baseurl = http://yum.mariadb.org/10.1/centos7-amd64 gpgkey = https://yum.mariadb.org/RPM-GPG-KEY-MariaDB gpgcheck = 1
Note, if you use Percona XtraBackup for your State Snapshot Transfers in Galera Cluster, in upgrading from MariaDB 10.1 to MariaDB 10.2, you need to also update XtraBackup to at least version 2.4. For instance,
# yum install percona-xtrabackup-24
This uninstalls the old version and replaces it with the newer release.
Upgrade MariaDB
With the repository prepared, you can update the server. First, stop MariaDB as you normally would using systemctl
, service
or the initscript as you would normally. Then run the package manager to upgrade to the new version.
For instance,
# yum upgrade MariaDB-server
Rolling Upgrade
Once you've upgraded to MariaDB 10.2, start the server as you normally would. As the server starts, it runs through the normal Galera Cluster process, attempting to connect to cluster and bring itself into sync with any changes that have occurred while it was down.
Connect to the server through mysql
client, then check the wsrep_local_state_uuid
and wsrep_cluster_state_uuid
status variables. When they equal each other, the node is in sync with the cluster.
SELECT IF(cluster.uuid = local.uuid, "Synced", "Not Synced") AS "Cluster Status" FROM (SELECT VARIABLE_VALUE AS "uuid" FROM information_schema.GLOBAL_STATUS WHERE VARIABLE_NAME = "wsrep_cluster_state_uuid") AS "cluster" INNER JOIN (SELECT VARIABLE_VALUE AS "uuid" FROM information_schema.GLOBAL_STATUS WHERE VARIABLE_NAME = "wsrep_local_state_uuid") AS "local"; +----------------+ | Cluster Status | +----------------+ | Synced | +----------------+
When the local and cluster UUID's come into sync, the node is again online and functioning as a part of the cluster. You can now move onto the next node in the cluster, repeating the above process to upgrade it to MariaDB 10.2. Continue until all of the nodes are running the latest version of MariaDB.