W3cubDocs

/MariaDB

Upgrading from MariaDB Galera Cluster 10.0 to MariaDB 10.1 with Galera Cluster

MariaDB starting with 10.1

Since MariaDB 10.1, the MySQL-wsrep patch has been merged into MariaDB Server. Therefore, in MariaDB 10.1 and above, the functionality of MariaDB Galera Cluster can be obtained by installing the standard MariaDB Server packages and the Galera wsrep provider library package.

Performing a Rolling Upgrade

The following steps can be used to perform a rolling upgrade from MariaDB Galera Cluster 10.0 to MariaDB 10.1. In a rolling upgrade, each node is upgraded individually, so the cluster is always operational. There is no downtime from the application's perspective.

First, before you get started:

  1. First, take a look at Upgrading from MariaDB 10.0 to MariaDB 10.1 to see what has changed between the major versions.
    1. Check whether any system variables or options have been changed or removed. Make sure that your server's configuration is compatible with the new MariaDB version before upgrading.
    2. Check whether replication has changed in the new MariaDB version in any way that could cause issues while the cluster contains upgraded and non-upgraded nodes.
    3. Check whether any new features have been added to the new MariaDB version. If a new feature in the new MariaDB version cannot be replicated to the old MariaDB version, then do not use that feature until all cluster nodes have been upgrades to the new MariaDB version.
  2. Next, make sure that the Galera version numbers are compatible.
    1. If you are upgrading from the most recent MariaDB Galera Cluster 10.0 release to MariaDB 10.1, then the versions will be compatible. The latest releases of MariaDB Galera Cluster 10.0 and all releases of MariaDB 10.1 use Galera 3 (i.e. Galera wsrep provider versions 25.3.x), so they should be compatible.
    2. If you are running an older MariaDB Galera Cluster 10.0 release that still uses Galera 2 (i.e. Galera wsrep provider versions 25.2.x), then it is recommended to first upgrade to the latest MariaDB Galera Cluster 10.0 release that uses Galera 3 (i.e. Galera wsrep provider versions 25.3.x).
    3. See What is MariaDB Galera Cluster?: Galera wsrep provider Versions for information on which MariaDB releases uses which Galera wsrep provider versions.
  3. Ideally, you want to have a large enough gcache to avoid a State Snapshot Transfer (SST) during the rolling upgrade. The gcache size can be configured by setting gcache.size For example:
    wsrep_provider_options="gcache.size=2G"

Before you upgrade, it would be best to take a backup of your database. This is always a good idea to do before an upgrade. We would recommend Percona XtraBackup.

Then, for each node, perform the following steps:

  1. Modify the repository configuration, so the system's package manager installs MariaDB 10.1. For example,
  2. If you use a load balancing proxy such as MaxScale or HAProxy, make sure to drain the server from the pool so it does not receive any new connections.
  3. Set innodb_fast_shutdown to 0. It can be changed dynamically with SET GLOBAL. For example:
    SET GLOBAL innodb_fast_shutdown=0;
  4. Stop MariaDB.
  5. Uninstall the old version of MariaDB and the Galera wsrep provider.
    • On Debian, Ubuntu, and other similar Linux distributions, execute the following:
      sudo apt-get remove mariadb-galera-server galera
    • On RHEL, CentOS, Fedora, and other similar Linux distributions, execute the following:
      sudo yum remove MariaDB-Galera-server galera
    • On SLES, OpenSUSE, and other similar Linux distributions, execute the following:
      sudo zypper remove MariaDB-Galera-server galera
  6. Install the new version of MariaDB and the Galera wsrep provider.
  7. Make any desired changes to configuration options in option files, such as my.cnf. This includes removing any system variables or options that are no longer supported.
    • It is important to note that a new option is needed for Galera to be active in MariaDB 10.1: you must set wsrep_on=ON.
  8. On Linux distributions that use systemd you may need to increase the service startup timeout as the default timeout of 90 seconds may not be sufficient. See Systemd: Configuring the Systemd Service Timeout for more information.
  9. Start MariaDB.
  10. Run mysql_upgrade with the --skip-write-binlog option.
    • mysql_upgrade does two things:
      1. Ensures that the system tables in the mysql database are fully compatible with the new version.
      2. Does a very quick check of all tables and marks them as compatible with the new version of MariaDB .

When this process is done for one node, move onto the next node.

Note that when upgrading the Galera wsrep provider, sometimes the Galera protocol version can change. The Galera wsrep provider should not start using the new protocol version until all cluster nodes have been upgraded to the new version, so this is not generally an issue during a rolling upgrade. However, this can cause issues if you restart a non-upgraded node in a cluster where the rest of the nodes have been upgraded.

Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.

© 2019 MariaDB
Licensed under the Creative Commons Attribution 3.0 Unported License and the GNU Free Documentation License.
https://mariadb.com/kb/en/upgrading-galera-cluster-upgrading-from-mariadb-galera-cluster-100-to-maria/