4.4.9 The upgrade cluster Command

upgrade cluster {--package=|-P }package_name cluster_name

This command upgrades the cluster named cluster_name to the software package package_name. It accomplishes this by performing a rolling restart of the cluster.

The new package must be registered using add package before you can use it for an upgrade; otherwise, upgrade cluster fails with an error.

To use the command to perform an upgrade, the cluster must be in the fully operational status (you can check that using the show status --cluster cluster_name command). A cluster created for import cannot be upgraded until the import has been completed. See Section 4.4.1, “The create cluster Command”, and Section 3.5, “Importing MySQL Clusters into MySQL Cluster Manager”, for more information.

Suppose mycluster is using MySQL Cluster NDB 7.1.17, and the binaries are registered with a package named 7.1.17, as shown by this list clusters command:

mcm> list clusters mysite;
+-----------+---------+
| Cluster   | Package |
+-----------+---------+
| mycluster | 7.1.17  |
+-----------+---------+
1 row in set (1.80 sec)

Now you wish to upgrade mycluster to MySQL Cluster NDB 7.1.19. Assuming that you have placed the NDB 7.1.19 binaries in the same directory on each host, the add package command to create a new package named 7.1.19 that contains these binaries might look something like this:

mcm> add package --basedir=/usr/local/ndb-7.1.19 7.1.19;
+----------------------------+
| Command result             |
+----------------------------+
| Package added successfully |
+----------------------------+
1 row in set (0.88 sec)
Note

On Windows, you must replace any backslash (\) characters in the path used for the add package command's --basedir option with forward slashes (/). See Section 4.3.1, “The add package Command”, for additional information and examples.

Both packages should now be listed in the output of the command list packages mysite. To perform the upgrade to the 7.1.19 package, use the upgrade cluster command as shown here:

mcm> upgrade cluster --package=7.1.19 mycluster;
+-------------------------------+
| Command result                |
+-------------------------------+
| Cluster upgraded successfully |
+-------------------------------+
1 row in set (3 min 17.00 sec)

Once the upgrade cluster command has been successfully executed, you can verify that mycluster is now using the 7.1.19 package from the output of the appropriate list clusters command:

mcm> list clusters mysite;
+-----------+---------+
| Cluster   | Package |
+-----------+---------+
| mycluster | 7.1.19  |
+-----------+---------+
1 row in set (1.80 sec)

The command can perform major as well as minor series upgrades. Despite the name of this command, upgrade cluster can also be used to perform MySQL Cluster downgrades.

Not all upgrades and downgrades between different versions of MySQL Cluster are supported by the command. Two criteria must be met: