Upgrade Galera to v5.7 automatically

Upgrade Galera to v5.7 automatically

Note

This feature is available starting from the MCP 2019.2.18 maintenance update. Before using the feature, follow the steps described in Apply maintenance updates.

This section instructs you on how to automatically upgrade the Galera cluster to version 5.7 using the Deploy - upgrade Galera cluster Jenkins pipeline job.

To upgrade Galera to v5.7 automatically:

  1. Verify that you have performed a backup of your database as described in Back up and restore a MySQL database.

  2. Perform a MySQL dump to a file that can later be used as data source for manual restoration. Verify that the node has enough free space to make a dump file. Run the following command on a database server node (dbs):

    mysqldump --defaults-file=/etc/mysql/debian.cnf -AR > %dump_file
    
  3. Log in to the Salt Master node.

  4. Open the cluster level of your deployment model.

  5. Specify the new version for Galera packages:

    1. In <cluster_name>/openstack/database/mysql_version.yml, create a new YAML file with the following content:

      parameters:
        _param:
          galera_mysql_version: "5.7"
      
    2. In <cluster_name>/openstack/database/master.yml and <cluster_name>/openstack/database/slave.yml, add the created file:

      classes:
      ...
      - cluster.<cluster_name>.openstack.database.mysql_version
      
    3. Refresh pillars on the database nodes:

      salt -C "I@galera:master or I@galera:slave" saltutil.refresh_pillar
      
    4. Verify that the pillars of the database nodes have Galera version 5.7:

      salt -C "I@galera:master or I@galera:slave" pillar.get galera:version:mysql
      

      Warning

      If the Galera version is not 5.7, resolve the issue before proceeding with the upgrade.

  6. Add repositories with new Galera packages:

    1. Apply the linux.system.repo state on the database nodes:

      salt -C "I@galera:master or I@galera:slave" state.sls linux.system.repo
      
    2. Verify the availability of the new MySQL packages:

      salt -C "I@galera:master or I@galera:slave" cmd.run 'apt-cache policy mysql-wsrep-server-5.7 mysql-wsrep-5.7'
      
    3. Verify the availability of the new percona-xtrabackup-24 packages:

      salt -C "I@galera:master or I@galera:slave" cmd.run 'apt-cache policy percona-xtrabackup-24'
      
    4. Verify that the salt-formula-galera version is 1.0+202202111257.6945afc or later:

      dpkg -l |grep salt-formula-galera
      
  7. Log in to the Jenkins web UI.

  8. Open the Deploy - upgrade Galera cluster pipeline.

  9. Specify the following parameters as required:

    Deploy - upgrade Galera cluster pipeline parameters
    Parameter Description
    INTERACTIVE Specifies the mode to get the detailed description of the pipeline job flow through the stages.
    UPDATE_TO_MYSQL57 Set this flag if you are upgrading MySQL from version 5.6 to 5.7.
    SHUTDOWN_CLUSTER Shuts down all MySQL instances on the target nodes during upgrade.
    OS_DIST_UPGRADE Optional. Upgrades system packages including kernel using apt-get dist-upgrade.
    OS_UPGRADE Optional. Upgrades all installed applications using apt-get upgrade.
    SALT_MASTER_CREDENTIALS Defines the Salt Master node credentials to use for connection, defaults to salt.
    SALT_MASTER_URL Defines the Salt Master node host URL with the salt-api port, defaults to the jenkins_salt_api_url parameter. For example, http://172.18.170.27:6969.
    TARGET_SERVERS Adds the target database server nodes. Defaults to dbs*.

    Warning

    Verify that you have selected the UPDATE_TO_MYSQL57 and SHUTDOWN_CLUSTER check boxes.

  10. Click Deploy.

    To monitor the deployment process, follow the instructions in MCP Deployment Guide: View the deployment details.

    The Deploy - upgrade Galera cluster pipeline workflow
    Stage Description
    Pre-upgrade Only non-destructive actions are applied during this phase. Basic service verification is performed. The job is launched on all target servers before moving to the next stage.
    Stop the Galera cluster

    All Galera clusters are stopped on the TARGET_SERVERS nodes in the reverse order. For example, dbs03, dbs02, and then dbs01.

    OpenStack APIs are not accessible starting from this point. This does not affect the data plane services such as OVS or KVM nodes.

    Upgrade Galera The Galera code is upgraded. No workload downtime is expected.
    Upgrade OS Optional. Launches only if OS_UPGRADE or OS_DIST_UPGRADE is selected. A reboot can be performed if required. When the node is back online, the basic service checks are performed.
    Start the Galera cluster The Galera cluster is being started on the TARGET_SERVERS nodes starting with the last instance stooped. For example, the nodes are started in the following order: dbs01, dbs02, and dbs03.