upgrade cluster {--package=|-P }package_name
[--set=attribute_assignment_list] cluster_name
attribute_assignment_list:
attribute_assignment[,attribute_assignment][,...]
attribute_assignment:
attribute_name:process_name[=value]
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 command show
status
--cluster
). A
cluster created for import cannot be upgraded until the import
has been completed. See Section 4.4.1, “The cluster_name
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)
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. Three criteria must be met:
The upgrade or downgrade must be supported by the MySQL Cluster versions involved. See the following sections in the MySQL Cluster manuals for lists of allowed upgrades and downgrades:
For MySQL Cluster 7.1: See the MySQL 5.1 Reference Manual.
For MySQL Cluster 7.2: See the MySQL 5.5 Reference Manual.
For MySQL Cluster 7.3 and 7.4: See Upgrading and Downgrading NDB Cluster.
Both the versions you upgrade or downgrade to and from must be supported by the version of MySQL Cluster Manager you are using (for example, upgrade from MySQL Cluster 6.3.8 to 7.3.8 must be performed manually, because MySQL Cluster Manager no longer supports MySQL Cluster 6.3).
For MySQL Cluster 7.2.13 and before, the Cluster must NOT have user privileges distributed across its SQL nodes, or the upgrade will have to be performed manually.
Starting from MySQL Cluster Manager 1.3.5, when using the
upgrade cluster
command, you
can use the --set
option to reconfigure your
MySQL Cluster at the same time. This is particularly helpful
when the upgrade requires configuration changes to your cluster.
This option takes as its argument an attribute assignment list
similar in format to that used with the
get
and
set
commands; see description
of the set
command on the
proper way to formulate an attribute assignment list. For
example: if you want to change the memory assigned to each data
node for storing database records to 750M, specify that with the
--set
option in your
upgrade cluster
command:
mcm> upgrade cluster --package=7.1.19 --set=DataMemory:ndbd=750M mycluster;
+-------------------------------+
| Command result |
+-------------------------------+
| Cluster upgraded successfully |
+-------------------------------+
1 row in set (3 min 17.04 sec)
Unlike the way you use the
set
command, an equal sign
(=
) immediately following the
--set
option is required.