3.5 Upgrading MySQL Cluster Manager

This section discusses upgrading MySQL Cluster Manager from a previous release to the latest release (currently 8.0.27), as well as providing basic guidance on upgrading the bundled MySQL NDB Cluster software.

Note

Only upgrades from release 1.4.0 and later are supported.

The basic steps for upgrading a MySQL Cluster Manager installation are listed here:

  1. Install the new version of the MySQL Cluster Manager software in the desired location.

  2. Create a configuration for the new installation such that it uses the previous installation's data.

  3. Stop all running MySQL Cluster Manager agent processes on all hosts.

  4. Start the new agent processes, ensuring that they use the new configuration just created.

A more detailed explanation is provided of each of these steps in the next few paragraphs. For purposes of example, we assume an upgrade from an existing installation of MySQL Cluster Manager 1.4.8 to a new installation of MySQL Cluster Manager 8.0.27. For a Linux or a Unix-like system, we assume that the installation directories are /opt/mcm-1.4.8 and /opt/mcm-8.0.27, respectively; on Windows, we assume the installation directories are C:\Program Files\MySQL\MySQL Cluster Manager 1.4.8\ and C:\Program Files\MySQL\MySQL Cluster Manager 8.0.27\, respectively.

Step 1: Install new MySQL Cluster Manager version.  You can obtain and install a new version of MySQL Cluster Manager in the same way as for a new installation (see Section 3.1, “Obtaining MySQL Cluster Manager”, and Section 3.3, “MySQL Cluster Manager Installation”), with the additional requirement that you should not attempt to install the new version in the same location as the version that you are currently using.

Step 2: Configure new installation.  In order for the new MySQL Cluster Manager agent binaries to manage the same MySQL NDB Cluster instances, they must be able to find the data contained in the agent repository used by the old installation's binaries, which is mcm_data in the parent directory of the MySQL Cluster Manager installation directory by default, but can be set using the data_folder option in the agent configuration file.

It is simplest for MySQL Cluster Manager software upgrades if the agent repository and the agent configuration file are located outside of the agent installation directory. Suppose the old version of the agent is installed to /opt/mcm-1.4.8, and that it uses the directory /var/opt/mcm for its agent repository and /etc/mcm/mcmd.ini for its configuration file. In this case, to make the new binaries use the same configuration and repository, create first the new configuration file (in the format for MySQL Cluster Manager 8.0 format), at a desired location. You can do this by making a copy of the sample configuration file to the described location.

cp /mcm-install-dir/doc/sample_mcmd.conf /etc/mcm/mcmd.conf

You should then copy over the old configuration settings from the 1.4 configuration file to the new configuration file, paying special attention to the differences in the configuration file format and the agent options for MySQL Cluster Manager 8.0 (see Chapter 2, What's New in MySQL Cluster Manager 8.0? and Section 3.4, “MySQL Cluster Manager Configuration File” for details. (For upgrade within the 8.0 series, you can just reuse the old configuration file, making adjustments only for options that have changed from version to version.)

To use the old data repository, add the following line to the new copy of the mcmd.conf file:

data_folder=/var/opt/mcm

After this, you can save and close the file. See also Section 3.4, “MySQL Cluster Manager Configuration File”.

Step 3: Stop all agents.  Stop the agent processes using the old binaries on all hosts making up the management installation. You can stop all agents for a given site, for example mysite, using the stop agents command in the MySQL Cluster Manager client, as shown here:

mcm> stop agents mysite;

You should execute a stop agents command, similar to the one just shown, for each site listed in the output of list sites.

Step 4: Start new MySQL Cluster Manager binaries.  Start the new mcmd agent binaries with the --config option so that it uses the correct configuration file, like this:

$> mcmd --config=/etc/mcm/mcmd.conf &
Note

A majority of the agents (i.e., at least half of the total number plus one) should be started within a period of 10 seconds; otherwise, the lack of a quorum of nodes for decision making might cause the communication among the nodes to break down.

You should now be able to start the mcm client from the new installation and perform management tasks as usual. Once the client successfully starts and connects to the agent, you can verify that it is running the correct version of the MySQL Cluster Manager software using the version command, as shown here:

mcm> version;
+------------------------------+
| Version                      |
+------------------------------+
| MySQL Cluster Manager 8.0.27 |
+------------------------------+
1 row in set (0.00 sec)

Next, check that all hosts, clusters, and processes on all sites are visible to the new mcm client, and are operational; for example:

mcm> list hosts mysite;
+-----------+-----------+----------+
| Host      | Status    | Version  |
+-----------+-----------+----------+
| tonfisk   | Available | 8.0.27   |
| flundra   | Available | 8.0.27   |
| alpha     | Available | 8.0.27   |
| beta      | Available | 8.0.27   |
| gamma     | Available | 8.0.27   |
+-----------+-----------+----------+

5 rows in set (0.16 sec)

mcmc> list clusters mysite;
+------------------+-----------+
| Cluster          | Package   |
+------------------+-----------+
| mycluster        | mypackage |
| yourcluster      | mypackage |
+------------------+-----------+
2 rows in set (2.07 sec)

mcm> show status --cluster mycluster;
+-----------+-------------------+---------+
| Cluster   | Status            | Comment |
+-----------+-------------------+---------+
| mycluster | fully operational |         |
+-----------+-------------------+---------+
1 row in set (0.01 sec)

mcm> show status --cluster yourcluster;
+-------------+-------------------+---------+
| Cluster     | Status            | Comment |
+-------------+-------------------+---------+
| yourcluster | fully operational |         |
+-------------+-------------------+---------+
1 row in set (0.01 sec)

mcm> show status -r mycluster;
+--------+----------+----------+---------+-----------+-----------+
| NodeId | Process  | Host     | Status  | Nodegroup | Package   |
+--------+----------+----------+---------+-----------+-----------+
| 49     | ndb_mgmd | tonfisk  | running |           | mypackage |
| 1      | ndbd     | tonfisk  | running | 0         | mypackage |
| 2      | ndbd     | flundra  | running | 0         | mypackage |
| 50     | mysqld   | tonfisk  | running |           | mypackage |
| 51     | mysqld   | flundra  | running |           | mypackage |
| 52     | ndbapi   | *tonfisk | added   |           |           |
| 53     | ndbapi   | *flundra | added   |           |           |
+--------+----------+----------+---------+-----------+-----------+
7 rows in set (0.08 sec)

mcm> show status -r yourcluster;
+--------+----------+-------+---------+-----------+-----------+
| NodeId | Process  | Host  | Status  | Nodegroup | Package   |
+--------+----------+-------+---------+-----------+-----------+
| 50     | ndb_mgmd | alpha | running |           | mypackage |
| 5      | ndbd     | beta  | running | n/a       | mypackage |
| 6      | ndbd     | gamma | running | n/a       | mypackage |
+--------+----------+-------+---------+-----------+-----------+
3 rows in set (0.01 sec)

See Chapter 4, Using MySQL Cluster Manager, for more information about performing common cluster management tasks with the mcm client.

Upgrading MySQL NDB Cluster.  Although the MySQL NDB Cluster software typically comes bundled with the MySQL Cluster Manager distribution, it is important to keep in mind that upgrading the MySQL Cluster Manager software does not upgrade any existing MySQL NDB Cluster installations. Since the new MySQL Cluster Manager installation uses the same configuration as the old one, the clusters under its control remain unchanged. If you wish to upgrade a cluster using the bundled MySQL NDB Cluster software, you should move the cluster directory (see Contents of the MySQL Cluster Manager Unix Distribution Archive) and all of its contents to a location outside the MySQL Cluster Manager installation directory. After this, you can use add package and upgrade cluster to upgrade one or more clusters to the new version of the MySQL NDB Cluster software.