This topic explains how to run a rolling schema upgrade (RSU) in MySQL for VMware Tanzu. More specifically, it covers how to check the ephemeral disk size, retrieve a node ID, and apply a new schema.
Before you run an RSU, you must have the following:
Running an RSU on a large table can fill up your ephemeral disk. MySQL for VMware Tanzu cannot function properly if there is not sufficient free space on file systems. Before running an RSU, confirm that your ephemeral disk is large enough to run the upgrade.
To check the size of your ephemeral disk, tell your operator to do the following:
To view your data directory, run the following command:
/var/vcap/store/pxc-mysql
To retrieve the size of your largest IDB file, run the following command and record the size of the largest IDB file:
ls -l -ahS
To retrieve your ephemeral disk usage, do the procedure in Run mysql-diag Using the BOSH Command Line Interface (CLI) and record the size of the ephemeral disk being used.
If there is not enough free space to add the largest IBD file to the ephemeral disk, update your service plan to one with a larger ephemeral disk.
To run an RSU, ask your operator to do the following:
You need the ID for each of your nodes to run an RSU.
To retrieve the IDs for your nodes, do the following:
To retrieve your service instance GUID, run the following command:
cf service MY-INSTANCE --guid
Where YOUR-INSTANCE
is the name of your MySQL for VMware Tanzu service instance. Record the guid returned in the output.
To identify the nodes in your HA cluster, run the following command:
bosh -d service-instance_GUID vms
Where GUID
is the guid you recorded in the previous step.
To run an RSU to apply a new schema on each node in your deployment, do the following:
To set enable global read_only as an admin user, run the following command:
mysql --defaults-file=/var/vcap/jobs/pxc-mysql/config/mylogin.cnf -e "set global read_only=on;"
To verify that the node is unhealthy, do the procedure described here: Monitoring Node Health.
Add the following to the SQL file you generated:
For example:
set wsrep_osu_method=rsu;
set global wsrep_desync=on;
...
set global wsrep_desync=off;
To execute the SQL file, run the following command:
mysql --defaults-file=/var/vcap/jobs/pxc-mysql/config/mylogin.cnf -e -D DATABASE-NAME < SQL-FILE-PATH
Where:
To disable global read_only
, run the following command:
$ mysql --defaults-file=/var/vcap/jobs/pxc-mysql/config/mylogin.cnf -e "set global read_only=off;""
To verify that the node is healthy, do the procedure here: Monitoring Node Health.
Repeat the above procedure for your next node.