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:
Verify that you have performed a backup of your database as described in Back up and restore a MySQL database.
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
Log in to the Salt Master node.
Open the cluster level of your deployment model.
Specify the new version for Galera packages:
In <cluster_name>/openstack/database/mysql_version.yml
, create a new
YAML file with the following content:
parameters:
_param:
galera_mysql_version: "5.7"
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
Refresh pillars on the database nodes:
salt -C "I@galera:master or I@galera:slave" saltutil.refresh_pillar
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.
Add repositories with new Galera packages:
Apply the linux.system.repo state on the database nodes:
salt -C "I@galera:master or I@galera:slave" state.sls linux.system.repo
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'
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'
Verify that the salt-formula-galera
version is
1.0+202202111257.6945afc
or later:
dpkg -l |grep salt-formula-galera
Log in to the Jenkins web UI.
Open the Deploy - upgrade Galera cluster pipeline.
Specify the following parameters as required:
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.
Click Deploy.
To monitor the deployment process, follow the instructions in MCP Deployment Guide: View the deployment details.
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 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 . |