Chapter 2 MySQL Cluster Manager Installation, Configuration, Cluster Setup

Table of Contents

2.1 Obtaining MySQL Cluster Manager
2.2 Supported Platforms and MySQL Cluster Versions
2.3 MySQL Cluster Manager Installation
2.3.1 Installing MySQL Cluster Manager on Unix Platforms
2.3.2 Installing MySQL Cluster Manager on Windows Platforms
2.3.3 Setting the MySQL Cluster Manager Agent User Name and Password
2.4 MySQL Cluster Manager Configuration File
2.5 Upgrading MySQL Cluster Manager

This chapter discusses basic installation and configuration of the MySQL Cluster Manager Management Agent, connecting to the agent with the MySQL Cluster Manager client, and the basics of creating or importing a cluster using MySQL Cluster Manager.

2.1 Obtaining MySQL Cluster Manager

MySQL Cluster Manager is available only through commercial license. To learn more about licensing terms, and to obtain information about where and how to download MySQL Cluster Manager, visit http://www.mysql.com/products/cluster/mcm/, or contact your Oracle representative.

2.2 Supported Platforms and MySQL Cluster Versions

For a list of platforms supported by MySQL Cluster Manager 1.4.1, see Supported Platforms: MySQL Cluster Manager at http://www.mysql.com/support/supportedplatforms/cluster-manager.html, or contact your Oracle representative.

MySQL Cluster Manager 1.4.1 supports the following MySQL Cluster release versions:

Prior to installation, you must obtain the correct build of MySQL Cluster Manager for your operating system and hardware platform. For Unix platforms, MySQL Cluster Manager is delivered as a Unix .tar.gz archive, whose name is in the format of mcm-1.4.1-cluster-7.5.4-linux-distro-arch.tar.gz. For Windows platforms, an MSI installer file is provided. All MySQL Cluster Manager 1.4.1 packages include MySQL Cluster NDB 7.5.4.

When selecting the appropriate installer for your operating system and hardware, keep in mind that 32-bit programs can normally be run on 64-bit platforms, but that the reverse is not true.

2.3 MySQL Cluster Manager Installation

Installation of the MySQL Cluster Manager agent and client programs varies according to platform. On Unix platforms, you must extract the binaries and other files from a .tar.gz archive and copy them to the correct locations manually. For Windows platforms, an MSI installer is provided which largely automates this process. Installation of MySQL Cluster Manager using each of these methods is covered in the next two sections.

Note

License keys were required in order to use some very early releases of MySQL Cluster Manager. They are not needed in order to use recent versions, including MySQL Cluster Manager 1.4.1.

2.3.1 Installing MySQL Cluster Manager on Unix Platforms

Install the MySQL Cluster Manager agent on Linux and similar platforms by following the instructions below.

Extract the MySQL Cluster Manager 1.4.1 program and other files from the distribution archive.  You must install a copy of MySQL Cluster Manager on each computer that you intend to use as a MySQL Cluster host. In other words, you need to install MySQL Cluster Manager on each host that is a member of a MySQL Cluster Manager management site. For each host, you should use the MySQL Cluster Manager build that matches that computer's operating system and processor architecture.

On Linux systems, you can unpack the archive using the following command, using mcm-1.4.1-cluster-7.5.4-linux-sles11-x86-64bit.tar.gz as an example (the actual filename will vary according to the MySQL Cluster Manager build that you intend to deploy):

shell> tar -zxvf mcm-1.4.1-cluster-7.5.4-linux-sles11-x86-64bit.tar.gz

This command unpacks the archive into a directory having the same name as the archive, less the .tar.gz extension. The top-level directory within the archive is named mcm-1.4.1.

Important

Because the Solaris version of tar cannot handle long filenames correctly, the MySQL Cluster Manager program files may be corrupted if you try to use it to unpack the MySQL Cluster Manager archive. To get around this issue on Solaris operating systems, you should use GNU tar (gtar) rather than the default tar supplied with Solaris. On Solaris 10, gtar is often already installed in the /usr/sfw/bin directory, although the gtar executable may not be included in your path. If gtar is not present on your system, please consult the Solaris 10 system documentation for information on how to obtain and install it.

In general, the location where you place the unpacked MySQL Cluster Manager directory and the name of this directory can be arbitrary. However, we recommend that you use a standard location for optional software, such as /opt on Linux systems, and that you name the directory using the 1.4.1 version number. (This facilitates subsequent upgrades.) On a typical Linux system you can accomplish this task like this:

shell> cd mcm-1.4.1-cluster-7.5.4-linux-sles11-x86-64bit
shell> mv mcm-1.4.1 /opt/mcm-1.4.1

For ease of use, we recommend that you put the MySQL Cluster Manager files in the same directory on each host where you intend to run it.

Contents of the MySQL Cluster Manager Unix Distribution Archive.  If you change to the directory where you placed the extracted MySQL Cluster Manager archive and list the contents, you should see something similar to what is shown here:

shell> cd /opt/mcm-1.4.1
shell> ls
bin  cluster  etc  lib  libexec  licenses  share  var

These directories are described in the following table:

DirectoryContents
binMySQL Cluster Manager agent startup scripts
clusterContains the MySQL Cluster NDB 7.5.4 binary distribution
etcContains the agent configuration file (mcmd.ini)
etc/init.dInit scripts
lib and subdirectoriesLibraries needed to run the MySQL Cluster Manager agent
libexecMySQL Cluster Manager agent and client executables
licenses/lgplAn archive containing source code (including licensing and documentation), for glib 2.1
share/doc/mcmdREADME.txt file
varXML files containing information needed by MySQL Cluster Manager about processes, attributes, and command syntax

Normally, the only directories of those shown in the preceding table that you need be concerned with are the bin and etc directories.

For MySQL Cluster Manager 1.4.1 distributions that include MySQL Cluster, the complete MySQL Cluster NDB 7.5.4 binary distribution is included in the cluster directory. Within this directory, the layout of the MySQL Cluster distribution is the same as that of the standalone MySQL Cluster binary distribution. For example, MySQL Cluster binary programs such as ndb_mgmd, ndbd, ndbmtd, and ndb_mgm can be found in cluster/bin. For more information, see MySQL Installation Layout for Generic Unix/Linux Binary Package, and Installing an NDB Cluster Binary Release on Linux, in the MySQL Manual.

If you wish to use the included MySQL Cluster software, it is recommended that you move the cluster directory and all its contents to a location outside the MySQL Cluster Manager installation directory, such as /opt/ndb-version. For example, on a Linux system, you can move the MySQL Cluster NDB 7.5.4 software that is bundled with MySQL Cluster Manager 1.4.1 to a suitable location by first navigating to the MySQL Cluster Manager installation directory and then using a shell command similar to what is shown here:

shell> mv cluster /opt/ndb-7.5.4
Note

The mcmd --bootstrap option uses the included MySQL Cluster binaries in the installation directory's cluster directory and does not work if they cannot be found there. To work around this issue, create a symbolic link to the correct directory in its place, like this:

shell> ln -s /opt/ndb-7.5.4 cluster

After doing this, you can use the mcm client commands add package and upgrade cluster to upgrade any desired cluster or clusters to the new MySQL Cluster software version.

Important

On Linux platforms, do not attempt to install the MySQL Cluster software by the RPM, Debian, or other installation packages for any package management systems. They install MySQL Cluster differently than the binary distribution that comes with the MySQL Cluster Manager archive, and that will cause issue in the future when you try to upgrade your cluster with MySQL Cluster Manager.

The MySQL Cluster Manager agent by default writes its log file as mcmd.log in the installation directory. When the agent runs for the first time, it creates a directory where the agent stores its own configuration data; by default, this is /opt/mcm_data. The configuration data, log files, and data node file systems for a given MySQL Cluster under MySQL Cluster Manager control, and named cluster_name, can be found in clusters/cluster_name under this data directory (sometimes also known as the MySQL Cluster Manager data repository).

The location of the MySQL Cluster Manager agent configuration file, log file, and data directory can be controlled with mcmd startup options or by making changes in the agent configuration file. To simplify upgrades of MySQL Cluster Manager, we recommend that you change the data repository to a directory outside the MySQL Cluster Manager installation directory, such as /var/opt/mcm. See Section 2.4, “MySQL Cluster Manager Configuration File”, and Section 3.2, “Starting and Stopping the MySQL Cluster Manager Agent”, for more information.

On Linux and other Unix-like systems, you can set up the MySQL Cluster Manager agent to run as a daemon, using the init script that is supplied with the MySQL Cluster Manager distribution. To do this, follow the steps listed here:

  1. Copy the file /etc/init.d/mcmd under the MySQL Cluster Manager installation directory to your system's /etc/init.d/ directory (or equivalent). On a typical Linux system, you can do this using the following command in the system shell, where mcmdir is the MySQL Cluster Manager installation directory:

    shell> cd mcmdir/etc/init.d
    shell> cp mcmd /etc/init.d/mcmd
    
  2. Make sure that this file has appropriate permissions and is executable by the user account that runs MySQL Cluster Manager. On a typical Linux system, this can be done by executing commands in your system shell similar to those shown here:

    shell> chown mcmuser /etc/init.d/mcmd
    shell> chmod 755 /etc/init.d/mcmd
    

    Be sure to refer to your operating system documentation for exact information concerning the commands needed to perform these operations, as they may vary between platforms.

  3. Open the file /etc/init.d/mcmd in a text editor. Here, we show a portion of this file, in which we have highlighted the two lines that need to be updated:

      MCMD_SERVICE="mcmd"
      MCMD_PSERVICE="MySQL Cluster Manager"
      MCMD_ROOTDIR=@@MCMD_ROOTDIR@@
      MCMD_BIN="$MCMD_ROOTDIR/bin/mcmd"
      MCMD_CONFIG="$MCMD_ROOTDIR/etc/mcmd.ini"
    
      # Run service as non-root user
      MCMD_USER=@@MCMD_USER@@
      SU="su --login $MCMD_USER --command"
    

    In the first of these lines, replace the placeholder @@MCMD_ROOTDIR@@ with the complete path to the MySQL Cluster Manager installation directory. In the second of these lines, replace the placeholder @@MCMD_USER@@ with the name of the system user that runs the MySQL Cluster Manager agent (note that this must not be the system root account). Save the edited file.

The MySQL Cluster Manager agent should now be started automatically whenever the system is restarted.

When the agent is configured as a daemon, cluster processes are started automatically when the agent is restarted, as long as the cluster was running when the agent shut down. Note that StopOnError must be disabled (set to 0) for all data nodes in order for this to work. If the cluster was stopped when the agent shut down, it is necessary to supply a script which waits for the agent to complete its startup and recovery phases, and then, when the agent is ready, starts the cluster using a command such as mcmdir/bin/mcm -e 'start cluster --background cluster_name;'.

2.3.2 Installing MySQL Cluster Manager on Windows Platforms

To install MySQL Cluster Manager 1.4.1 on Windows platforms, you should first have downloaded the MSI installer file mcm-1.4.1-win32-cluster-7.5.4-winx64-x86.msi (see Section 2.1, “Obtaining MySQL Cluster Manager”). MySQL Cluster Manager 1.4.1 for Windows is 32-bit, as is the bundled MySQL Cluster NDB 7.5.4; these run on both 32-bit and 64-bit versions of Windows.

As mentioned elsewhere (see, for example, Section 3.4.1, “Creating a MySQL Cluster with MySQL Cluster Manager”), you must install a copy of MySQL Cluster Manager on each computer where you intend to host a MySQL Cluster node. Therefore, the following procedure must be performed separately on each host computer. For ease of installations and upgrades on multiple machines, it is recommended that you install MySQL Cluster Manager to the same location on each host. This is C:\Program Files\MySQL\MySQL Cluster Manager\ or C:\Program Files (x86)\MySQL\MySQL Cluster Manager\ by default, but it is possible to install MySQL Cluster Manager to an alternate location such as C:\mcm\.

In the discussion that follows, we assume that you have downloaded the MySQL Cluster Manager 1.4.0 MSI installer as user Daniel to a directory under this user's Downloads directory (C:\Users\Daniel\Downloads\MCM) on a 64-bit Windows system. Navigate to this directory in Windows Explorer, as shown here:

MySQL Cluster Manager.MSI installer file after downloading (in Windows Explorer)

To run the installer, double-click on the icon of the MSI installer file in Windows Explorer. Some versions of Windows also provide an Install item in the Windows Explorer menu that can be used to run the installer. When you start the installer, you may see a Windows Security Warning screen. If you obtained the installer from a trusted source and know that it has not been tampered with, choose Run from the dialog, which allows the installer to continue to the Welcome screen, as shown here:

MySQL Cluster Manager.MSI installer, Welcome screen

Click the Next button to continue to the License Agreement screen, as shown in the next figure:

MySQL Cluster Manager.MSI installer License Agreement screen, initial

You should read the license text in the text area, and when you have done so, check the box labelled I accept the terms in the License Agreement. Until you have checked the box, you cannot complete the MySQL Cluster Manager installation; it is possible only to go back to the previous screen, print the license, or cancel the installation (using the buttons labelled Back, Print, and Cancel, respectively). Checking the box enables the Next button, as shown here:

MySQL Cluster Manager.MSI installer License Agreement screen, acceptance checked

Click the Next button to continue to the Destination Folder screen, where you can choose the installation directory. The next figure shows the Destination Folder screen with the default location. On English-language 32-bit Windows systems, this is C:\Program Files\MySQL\MySQL Cluster Manager\); on English 64-bit Windows systems, the default is C:\Program Files (x86)\MySQL\MySQL Cluster Manager\. (In this example, we are installing MySQL Cluster Manager 1.4.0 on a 64-bit system, so the default is C:\Program Files (x86)\MySQL\MySQL Cluster Manager\.) You can click the Change button to change the directory where MySQL Cluster Manager should be installed; the default directory is adequate for most cases.

MySQL Cluster Manager MSI installer Destination screen, showing default location

Once you have selected the destination directory, the installer has gathered all the information that it requires to perform the installation. Click Next to continue to the Ready screen, shown here:

MySQL Cluster Manager.MSI installer, Ready screen

Click the Install button to install MySQL Cluster Manager. As the installer begins to copy files and perform other tasks affecting the system, you may see a warning dialog from Windows User Access Control. If this occurs, click the Yes button to allow the installation to continue. A Setup Wizard screen with a progress bar is displayed while the installer runs, as shown in the next figure:

MySQL Cluster Manager MSI installer, Setup Wizard screen

The Setup Wizard may require several minutes to copy all of the necessary files for MySQL Cluster Manager and MySQL Cluster NDB to the installation directory and to perform other required changes.

Note

The MySQL Cluster Manager installer places MySQL Cluster NDB in the cluster directory under the installation directory. (By default, this is C:\Program Files\MySQL\MySQL Cluster Manager\cluster or C:\Program Files (x86)\MySQL\MySQL Cluster Manager\cluster.) The location of the MySQL Cluster binaries is not separately configurable using the MySQL Cluster Manager installer.

When the Setup Wizard finishes, the installer displays the Installation Completed screen, as shown here:

MySQL Cluster Manager MSI installer, Installation Completed screen

MySQL Cluster Manager 1.4.1 has now been installed to the destination directory; click the Finish button to exit the installer.

2.3.2.1 Installing the MySQL Cluster Manager Agent as a Windows Service

After installing the MySQL Cluster Manager Agent as a Windows service, you can start and stop the agent using the Windows Service Manager. The installation also configures the agent to start automatically whenever Windows starts, and to shut down safely whenever Windows shuts down.

Note

The Windows service can be used to control the running of MySQL Cluster Manager agents on a single host only. To shut down agents on multiple hosts, you can use the stop agents command in the MySQL Cluster Manager client.

The installation is performed using the command prompt (cmd.exe); as with installing or removing any Windows service, it must also be done as a user having sufficient permissions, such the system Administrator account.

If the account you are currently using has Administrator privileges, you can simply start cmd.exe. Otherwise, you must run the command prompt program as the Administrator. To do this, first locate a shortcut to the command prompt. On most Windows systems, you can do this using the Start Menu. Find Programs (or All Programs, in some Windows versions), then navigate to Accessories. Under Accessories, right-click on the Command Prompt menu item. From the context menu that appears, select Run as Administrator. You can see how this looks on a typical Windows system in the next figure.

Starting the command prompt as Administrator

If a Windows UAC dialog referring to cmd.exe appears, click Yes to allow the command prompt to run as Administrator and thus to continue. You should now have a command prompt window open on your desktop, running a session with Administrator privileges.

To install the MySQL Cluster Manager agent as a service, we use the SC CREATE command. This command allows us to specify a name for the service (for use in NET START and NET STOP commands), a display name (to be shown in the Service Manager), a startup mode (automatic or manual start), and a path to the executable to be run as a service. (Use mcmd-svc.exe rather than mcmd.exe as the executable.) The path must also include any arguments needed by the program; in the case of MySQL Cluster Manager, mcmd-svc.exe must be told where to find its configuration file using the --defaults-file option. Both of these paths must be absolute.

Important

Installation of the MySQL Cluster Manager agent as a service is recommended. However, you should not install MySQL Cluster processes (ndb_mgmd.exe, ndbd.exe, ndbmtd.exe, mysqld.exe) as services on Windows hosts to be used as MySQL Cluster nodes under management by MySQL Cluster Manager, since the MySQL Cluster Manager agent itself controls MySQL Cluster nodes independently of the Windows Service Manager.

Assume that you have installed MySQL Cluster Manager to the default location for 64-bit Windows systems C:\Program Files (x86)\MySQL\MySQL Cluster Manager 1.4.1\ (C:\Program Files\MySQL\MySQL Cluster Manager 1.4.1\ on 32-bit Windows systems), and that its configuration file is located in C:\Program Files (x86)\MySQL\MySQL Cluster Manager 1.4.1\etc. Then the following command installs MySQL Cluster Manager as a service named mcm, with the display name MySQL Cluster Manager 1.4.1:

C:\> SC CREATE
  "MCM" DisplayName= "MySQL Cluster Manager 1.4.1" Start= "auto"
  BinPath= "C:\Program Files (x86)\MySQL\MySQL Cluster Manager 1.4.1\bin\mcmd-svc.exe
  --defaults-file=\"C:\Program Files (x86)\MySQL\MySQL Cluster Manager 1.4.1\etc\mcmd.ini\""
[SC] CreateService SUCCESS
C:\>

This command can be quite long. For enhanced legibility, we have broken it across several lines, but you should always enter it on a single line, allowing it to wrap naturally, similar to what is shown here:

Creating the MCM service, using the Windows command prompt

In addition, you should keep in mind that the spaces after the equals signs following the DisplayName, Start, and BinPath arguments are required.

Starting and stopping the MySQL Cluster Manager agent Windows service.  After installing the service successfully, you can start and stop the service manually, if the need arises, with the NET START and NET STOP commands, as shown here:

Starting and stopping the MCM Windows service

Once the service is installed, the MySQL Cluster Manager agent starts automatically whenever Windows is started. You can verify that the service is running with the Windows Task Manager. Open the Task Manager, and switch to the Services tab if it is not already displayed. If the MySQL Cluster Manager agent is running, you can find it in the list of services under MCM in the Name, column and MySQL Cluster Manager 1.4.1 in the Description column, as shown here:

The 1.4.1 service, seen running in the Windows Task Manager

You can also verify if the service is running using the Windows Service Manager, as shown here:

The 1.4.1 service, seen running in the Windows Service Manager

The Service Manager also allows you to start, stop, or pause the MySQL Cluster Manager agent service manually using a GUI.

Note

When first installing the MySQL Cluster Manager agent as a service, the service is not started automatically until Windows is started. If you do not wish to restart Windows, then you must start the service manually using either NET START on the command line or the graphical control provided in the Windows Service Manager.

You can remove the service using the SC DELETE command and the name of the service—in this case MCM—that was used in the SC CREATE command, as shown here:

Removing the MySQL Cluster Manager service (Windows command prompt)

If the service is running at the time that SC DELETE is executed, the removal of the service takes effect the next time the service is stopped. In such a case, you must stop the previous instance of the service manually, and allow it to be removed, before you can reinstall the service.

Once you have installed the MySQL Cluster Manager agent and the service is running correctly, you are ready to connect to it using the MySQL Cluster Manager client. See Section 3.3, “Starting the MySQL Cluster Manager Client”, for information about how to do this.

2.3.3 Setting the MySQL Cluster Manager Agent User Name and Password

Normally it is not necessary to alter the user name or password used by the user agent to administer mysqld processes. However, if you should wish to do so, you can change either or both of these, using the procedure outlined here:

  1. Stop all agents. (You can use stop agents for this purpose.)

  2. Update the etc/mcmd.ini agent configuration file. Set a new password by uncommenting the line containing manager-password= and adding the new password as this value; set a new administrative user account name by uncommenting the line containing manager-username= and setting this to the new user name. See Section 3.1, “mcmd, the MySQL Cluster Manager Agent”, for more information about these options.

  3. For each mysqld do the following:

    1. Log in (using the mysql client) as the MySQL root user

    2. If you are changing the user name, do this first, using the following statement, where olduser is the current user name and newuser is the new manager-user that you set previously in etc/mcmd.ini:

      RENAME USER 'olduser'@'127.0.0.1' TO 'newuser'@'127.0.0.1';
      

      If you are changing the user name for the first time, use mcmd for olduser. In addition, you should use 127.0.0.1 for the host name (and not localhost).

    3. Execute the following statement, where newuser is the new user name, and newpass is the new password:

      SET PASSWORD FOR 'newuser'@'127.0.0.1' = PASSWORD('newpass');
      

      Use mcmd for the user name if you have not changed it—that is, if manager-user has been left unset in mcmd.ini. Use 127.0.0.1 for the host name (and not localhost).

    4. Issue a FLUSH PRIVILEGES statement.

  4. Restart the agents. All agents should now be using the new password for the mcmd accounts on the MySQL servers (mysqld processes).

2.4 MySQL Cluster Manager Configuration File

Before starting the MySQL Cluster Manager agent, you should make any necessary changes to the [mcmd] section of the agent configuration file, supplied with MySQL Cluster Manager as etc/mcmd.ini in the installation directory. On Linux and similar operating systems, you can edit this file in place; on Windows, it is recommended that you save a copy of this file to a convenient location for which the path does not contain any spaces, such as C:\mcm\data.

A # character in the MySQL Cluster Manager configuration file indicates the beginning of a comment; the comment continues to the end of the line.

The version of this file that is supplied with MySQL Cluster Manager reads similarly to what is shown here:

[mcmd]

plugins=manager

##manager-port=1862

##agent-uuid=
log-file=mcmd.log
log-level=message
##pid-file=

## Username and password for manager plugin
##manager-username=
##manager-password=

## Top-level directory for manager plugins information stored on disk
##manager-directory=

A minimal agent configuration file as used in production might look like this:

[mcmd]

plugins=manager

manager-port=1862

manager-directory=/var/opt/mcm-1.4.1

log-file=/var/opt/mcm/mcmd.log

log-level=warning

For more information about these and other options which can be set in the agent configuration file, see Section 3.1, “mcmd, the MySQL Cluster Manager Agent”.

2.5 Upgrading MySQL Cluster Manager

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

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 created previously.

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.2.4 to a new installation of MySQL Cluster Manager 1.4.1. For a Linux or other Unix-like system, we assume that these are installed in /opt/mcm-1.2.4 and /opt/mcm-1.4.1, respectively; on Windows, we assume the default directories C:\Program Files\MySQL\MySQL Cluster Manager 1.2.4\ and C:\Program Files\MySQL\MySQL Cluster Manager 1.4.1\.

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 2.1, “Obtaining MySQL Cluster Manager”, and Section 2.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 which you are currently using.

Step 2: Configure new installation.  In order for the new MySQL Cluster Manager agent binaries to manage the same MySQL Cluster instances, they must be able to find the data contained in the agent repository used by the old installation's binaries. This is /opt/mcm_data by default, but can be set using the manager-directory directive in mcmd.ini.

It is simplest for MySQL Cluster Manager software upgrades if the agent repository and the agent configuration file are located externally to the agent installation directory. Suppose the old version of the agent is installed to /opt/mcm-1.2.4, 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, it is necessary only to start the new mcmd processes such that they use the same configuration file (see Step 4). Otherwise, you should copy the default configuration file to a location outside the installation directory, such as /etc/mcm/mcmd.ini, as shown here:

shell> cp -r /opt/mcm-1.2.4/etc/mcmd.ini /etc/mcm/mcmd.ini

Then, add the following line to the new copy of the mcmd.ini file:

manager-directory=/var/opt/mcm

After this, you can save and close the file. See also Section 2.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 --defaults-file option so that it uses the correct configuration file, like this:

shell> mcmd --defaults-file=/etc/mcm/mcmd.ini &
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 1.4.1 |
+-----------------------------+
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 | 1.4.1   |
| flundra   | Available | 1.4.1   |
| alpha     | Available | 1.4.1   |
| beta      | Available | 1.4.1   |
| gamma     | Available | 1.4.1   |
+-----------+-----------+---------+

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 3, Using MySQL Cluster Manager, for more information about performing common cluster management tasks with the mcm client.

Upgrading MySQL Cluster.  Although the MySQL 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 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 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 Cluster software.