Upgrade Galera manually

Upgrade Galera manuallyΒΆ

This section instructs you on how to manually upgrade the Galera cluster. Only the MySQL and Galera packages will be upgraded. The upgrade of an underlying operating system is out of scope.

During the upgrade, the Galera cluster remains alive while you shut down each MySQL service on the node one by one to upgrade its packages and then restart the service. When the node reconnects, it synchronizes with the cluster as in case of any other outage. The upgrade of an underlying operating system is out of scope.

Warning

Before performing the upgrade on a production environment:

  • Accomplish the procedure on a staging environment to determine the required maintenance window duration.

  • Schedule an appropriate maintenance window to reduce the load on the cluster.

  • Do not shut down the VMs or workloads as networking and storage functions are not affected.

To upgrade the Galera cluster:

  1. Prepare the Galera cluster for the upgrade:

    1. Verify that you have added the required repositories on the Galera nodes to download the updated MySQL and Galera packages.

    2. Verify that your Galera cluster is up and running as described in Verify a Galera cluster status.

    3. Create an instant backup of the MySQL database as described in Back up and restore a MySQL database.

  2. Log in to the Salt Master node.

  3. Obtain the new packages on all Galera nodes:

    salt -C 'I@galera:*' cmd.run 'apt-get clean; apt-get update'
    
  4. Verify that the MySQL and Galera packages are available on all Galera nodes:

    salt -C 'I@galera:*' cmd.run "apt-cache policy mysql-wsrep-5.6 |egrep -i 'installed|candidate'"
    salt -C 'I@galera:*' cmd.run "apt-cache policy galera-3 |egrep -i 'installed|candidate'"
    

    Example of system response:

    dbs02.openstack-ovs-core-ssl-pike-8602.local:
          Installed: 5.6.35-0.1~u16.04+mcp2
          Candidate: 5.6.41-1~u16.04+mcp1
    dbs01.openstack-ovs-core-ssl-pike-8602.local:
          Installed: 5.6.35-0.1~u16.04+mcp2
          Candidate: 5.6.41-1~u16.04+mcp1
    dbs03.openstack-ovs-core-ssl-pike-8602.local:
          Installed: 5.6.35-0.1~u16.04+mcp2
          Candidate: 5.6.41-1~u16.04+mcp1
    
  5. Verify the runtime versions of the MySQL nodes of the Galera cluster:

    salt -C 'I@galera:*' mysql.version
    

    Example of system response:

    dbs02.openstack-ovs-core-ssl-pike-8602.local:
        5.6.35-0.1~u16.04+mcp2
    dbs01.openstack-ovs-core-ssl-pike-8602.local:
        5.6.35-0.1~u16.04+mcp2
    dbs03.openstack-ovs-core-ssl-pike-8602.local:
        5.6.35-0.1~u16.04+mcp2
    
  6. Perform the following steps on one of the Galera slave nodes, for example, on the third instance:

    1. Stop the MySQL service:

      salt -C 'I@galera:* and *03*' service.stop mysql
      
    2. Upgrade the packages:

      salt -C 'I@galera:* and *03*' cmd.run "apt-get -y install --reinstall -o \
      DPkg::Options::=--force-confold -o Dpkg::Options::=--force-confdef mysql-wsrep-5.6 \
      mysql-wsrep-common-5.6 mysql-wsrep-libmysqlclient18 galera-3"
      
    3. Apply the galera Salt state:

      salt -C 'I@galera:* and *03*' state.apply galera
      
    4. Verify that your Galera cluster is up and running as described in Verify a Galera cluster status.

  7. Perform the step 6 on the remaining Galera nodes one by one.

  8. Verify the cluster status after upgrade:

    1. Verify the versions of the installed packages:

      salt -C 'I@galera:*' mysql.version
      
    2. Verify that your Galera cluster is up and running as described in Verify a Galera cluster status.