2.5.2. Starting and Stopping the MySQL Cluster Manager Agent on Windows

To start the MySQL Cluster Manager agent manually on a Windows host, you should invoke mcmd.exe, found in the bin directory under the manager installation directory on that host. By default, the agent uses etc/mcmd.ini in the MySQL Cluster Manager installation directory as its configuration file; this can be overridden by passing the desired file's location as the value of the --defaults-file option.

The complete syntax for mcmd is shown here:

mcmd[.exe] [--defaults-file | --bootstrap] [--log-file] [--log-level]

By default, the agent assumes that the agent configuration file is etc/mcmd.ini, in the MySQL Cluster Manager installation directory. You can tell the agent to use a different configuration file by passing the path to this file to the --defaults-file option, as shown here:

C:\Program Files (x86)\MySQL\MySQL Cluster Manager 1.1.4\bin> 
  mcmd --defaults-file="C:\Program Files (x86)\MySQL\MySQL Cluster 
  Manager 1.1.4\etc\mcmd.ini"

The --bootstrap option causes the agent to start with default configuration values, create a default one-machine cluster named mycluster, and start it. The use of this option with mcmd is shown here on a system having the host name torsk, where MySQL Cluster Manager has been installed to the default location:

C:\Program Files (x86)\MySQL\MySQL Cluster Manager 1.1.4\bin>mcmd --bootstrap
MySQL Cluster Manager 1.1.4 started
Connect to MySQL Cluster Manager by running "C:\Program Files (x86)\MySQL\MySQL 
Cluster Manager 1.1.4\bin\mcm" -a TORSK:1862
Configuring default cluster 'mycluster'...
Starting default cluster 'mycluster'...
Cluster 'mycluster' started successfully
        ndb_mgmd        TORSK:1186
        ndbd            TORSK
        ndbd            TORSK
        mysqld          TORSK:3306
        mysqld          TORSK:3307
        ndbapi          *
Connect to the database by running "C:\Program Files (x86)\MySQL\MySQL Cluster 
Manager 1.1.4\cluster\bin\mysql" -h TORSK -P 3306 -u root

You can then connect to the agent using the mcm client (see Section 2.6, “Starting the MySQL Cluster Manager Client”), and to either of the MySQL Servers running on ports 3306 and 3307 using mysql or another MySQL client application.

When starting the MySQL Cluster Manager agent for the first time, you may see one or more Windows Security Alert dialogs, such as the one shown here:

Security Warning dialog, Windows Firewall

You should grant permission to connect to private networks for any of the programs mcmd.exe, ndb_mgmd.exe, ndbd.exe, ndbmtd.exe, or mysqld.exe. To do so, check the Private Networks... box and then click the Allow access button. It is generally not necessary to grant MySQL Cluster Manager or MySQL Cluster access to public networks such as the Internet.

Note

The --defaults-file and --bootstrap options are mutually exclusive.

The --log-file option allows you to override the default location for the agent log file (normally mcmd.log, in the MySQL Cluster Manager installation directory).

You can use --log-level option to override the log-level set in the agent configuration file. See Section 2.4, “MySQL Cluster Manager Configuration File”, for information about possible values and their effects on logging.

The MySQL Cluster Manager agent must be started on each host in the MySQL Cluster to be managed.

It is possible to install MySQL Cluster Manager as a Windows service, so that it is started automatically each time Windows starts. See Section 2.5.3, “Installing the MySQL Cluster Manager Agent as a Windows Service”.

To stop one or more instances of the MySQL Cluster Manager agent, use the stop agents command in the MySQL Cluster Manager client (see Section 3.7, “The stop agents Command”, for more information and examples). You can also stop an agent process using the Windows Task Manager. In addition, if you have installed MySQL Cluster Manager as a Windows service, you can stop (and start) the agent using the Windows Service Manager, CTRL-C, or the appropriate NET STOP (or NET START) command, as discussed in the next section.