Documentation Home
MySQL Cluster Manager 8.4 User Manual
Related Documentation Download this Manual
PDF (US Ltr) - 1.4Mb
PDF (A4) - 1.4Mb


MySQL Cluster Manager 8.4 User Manual  / Using MySQL Cluster Manager  /  mcmd, the MySQL Cluster Manager Agent

4.1 mcmd, the MySQL Cluster Manager Agent

mcmd is the MySQL Cluster Manager agent program. Invoking this executable starts the MySQL Cluster Manager Agent, to which you can connect using themcm client (seeSection 4.3, “Starting the MySQL Cluster Manager Client” andChapter 5,MySQL Cluster Manager Client Commands for more information).

You can modify the behavior of the agent by specifying one or more of the options discussed in this section. Depending on the option of interest, there are up to three ways to set it:

  1. Include the option directly on the command line when invokingmcmd. This can be done for all options that hasYes under theCmd-Line column inTable 4.1 MySQL Cluster Manager Agent (mcmd) Option Summary. Some options can only be specified by this method on the command line (for example,--config and--bootstrap).

    When specifying an agent configuration option on the command line using this method, the name of the option is prefixed with two leading dash characters (--); for example,--mcmd-user=johndoe. See theCommand-Line Format for each option given in the option description table.

  2. Include the option in theagent configuration file. This can be done for all options that hasYes under theOption File column inTable 4.1 MySQL Cluster Manager Agent (mcmd) Option Summary. These rules apply:

    • The name of the option shouldnot be prefixed with dashes, or any other characters.

    • Any hyphens in the option names should be changed to underscores.

    • The format of the configuration file follows that of the MySQL Router configuration file; seeConfiguration File Syntax for an explanation of the file format. An option must be specified in the correct section in the configuration file; seeTable 4.1, “MySQL Cluster Manager Agent (mcmd) Option Summary” for which section each option belongs to.

    • Each option must be specified on a separate line. You can comment out a line by inserting a leading hash character (#).

  3. Any options configurable in the configuration file (i.e., by method 2 above), with the exception ofmcmd_password, can be set or overridden at themcmd command line by specifying the option in the format of--section_name.option=value, wheresection_name is name of the section in the configuration file that the option belongs to. For example,--mcmd.bind_port=12345 and--logger.level=DEBUG.

The following table contains a summary of agent options that are read on startup bymcmd. More detailed information about each of these options can be found in the option descriptions.

Table 4.1 MySQL Cluster Manager Agent (mcmd) Option Summary

NameCmd-LineOption FileConfiguration File Section
bind_address-Yesmcmd
bind-port-Yesmcmd
bootstrapYes--
configYes--
copy-port-Yesmcmd
core-fileYes--
data-folderYesYesDEFAULT
extra-configYes--
filename-Yeslogger,syslog,filelog,eventlog
helpYes--
initialYes--
level-Yeslogger
logging_folder-YesDEFAULT
max_total_connections-YesDEFAULT
mcmd_password-Yesmcmd
mcmd-user-Yesmcmd
pid-fileYesYesDEFAULT
sinks-YesDEFAULT
ssl_ca-Yesmcmd
ssl_cert-Yesmcmd
ssl_cipher-Yesmcmd
ssl_key-Yesmcmd
ssl_mode-Yesmcmd
unknown_config_option-YesDEFAULT
versionYes--
xcom-port-Yesmcmd

MySQL Cluster Manager Agent (mcmd) Option Descriptions

The following list contains descriptions of each configuration option available for use withmcmd, including allowed and default values. Options with theirType unmentioned need only be specified in order to take effect— you should not try to set a value for them.

  • bind_address

    TypeString
    Default Value127.0.0.1

    Specify the address for MySQL Cluster Manager client connections. Binding to a specific IPv4 or IPv6 address ensures thatmcmd is not starting on a network interface controller (NIC) on which nothing is allowed to execute.

    It is not possible to specify more than one bind address. Using:: binds all network interfaces (IPs) on the host.

    When set in the configuration file, the option should be put inside the[mcmd] section.

  • bind-port=#

    TypeNumeric
    Default Value1862
    Minimum Value1
    Maximum Value65535

    Specify the port used by MySQL Cluster Manager client connections. Any valid TC/IP port number can be used. Normally, there is no need to change it from the default value (1862).

  • --bootstrap,-B

    Command-Line Format--bootstrap

    Start the agent with default configuration values, create a default one-machine cluster namedmycluster in a site namedmysite, and start it. This option works only if no sites have been created yet.

  • --config=filename,-c

    Command-Line Format--config=file_name
    TypeFile name
    Default Valuemcmd.conf, in the MCM installation directory

    Set the file from which to read configuration options.mcmd.conf in the installation directory of MySQL Cluster Manager is the first default locationmcmd looks for the file. SeeSection 3.4, “MySQL Cluster Manager Configuration File” for more information.

  • copy-port

    TypeNumeric
    Default Value0
    Minimum Value0
    Maximum Value65535

    Allows you to specify the port for file copy operations. The default is 0.

  • --core-file

    Command-Line Format--core-file[=value]
    TypeBoolean
    Default Value1
    Valid Values

    1 (Write a core file)

    0 (Do not write a core file)

    Write a core file to the location wheremcmd was started (or to another core dump location as specified by the operating system) whenmcmd quits unexpectedly. The default value is 1.

  • --data-folder=dir_name,-ddir_name

    Command-Line Format--data-folder=dir_name
    TypeDirectory name
    Default Valuemcm_data in the parent directory of the MCM installation directory

    Set the location of the agent repository, which contains collections of MySQL Cluster Manager data files and MySQL NDB Cluster configuration and data files. The value must be a valid absolute path.

    The default location ismcm_data in the parent directory of the MySQL Cluster Manager installation directory. If you change the default, you should use a standard location external to the MySQL Cluster Manager installation directory, such as/var/opt/mcm on Linux.

    In addition to the data files for all the clusters under the control of MySQL Cluster Manager, the data-folder also contains arep directory in whichmcmd configuration and metadata are kept. Normally, there is no need to interact with these directories beyond specifying the--data-folder option; see exceptions in, for example,Section 4.8, “Restoring a MySQL Cluster Manager Agent with Data from Other Agents” andSection 4.7, “Backing Up and Restoring MySQL Cluster Manager Agents”.

  • --extra-config=filename ,-a

    Command-Line Format--extra-config=file_name
    TypeFile name

    Read this file after configuration files are read from either default locations or from the location specified by the--config option. Multiple--extra-config options can be passed, and the files are loaded in the order they are specified.

  • filename=filename

    TypeFile name
    Default Valuemcmd.log

    Set the name of the file to write the log to. The default ismcmd.log, located in the same directory where the MySQL Cluster Manager installation directory is found. The location of this file can be overridden with thelogging_folder option.

  • --help,-?

    Command-Line Format--help

    mcmd help output provides information on some file paths and all the program options; it also provides some usage examples of themcmd command:

    $> mcmd --helpMySQL Cluster Manager  v8.4.6 on linux-glibc2.17 (64-bit) (MySQL Enterprise - Commercial)Copyright (c) 2007, 2025, Oracle and/or its affiliates.Oracle is a registered trademark of Oracle Corporation and/or itsaffiliates. Other names may be trademarks of their respectiveowners.Configuration read from the following files in the given order (enclosedin parentheses means not available for reading):  (/opt/mcm8.4.6/bin/.././mcmd.conf)  (/opt/mcm8.4.6/bin/.././mcmd.ini)  (/home/johndoe/.mcmd.conf)  (/home/johndoe/.mcmd.ini)Plugins Path:  /opt/mcm8.4.6/lib/mysqlrouterDefault Log Directory:  /optDefault Persistent Data Directory:  /opt/mcm_dataDefault Runtime State Directory:  /opt# Usagemcmd (-?|--help)mcmd (-V|--version)mcmd [-B|--bootstrap] [-c|--config=<path>] [--core-file=[<0|1>]]     [-d|--data-folder=<directory>] [-a|--extra-config=<path>]     [-i|--initial] [--pid-file=<pidfile>]mcmd [--bind-port=<portnumber>] [--copy-port=<portnumber>]     [--mcmd-user=<username>] [--xcom-port=<portnumber>]# Options  -B, --bootstrap        Bootstrap a MySQL Cluster using MySQL Cluster Manager  -c <path>, --config <path>        Only read configuration from given file.  --core-file [ <0|1>]        Write a core file if mcmd dies.  -d <directory>, --data-folder <directory>        Data directory for MySQL Cluster Manager.  -a <path>, --extra-config <path>        Read this file after configuration files are read from either        default locations or from files specified by the --config        option.  -?, --help        Display this help and exit.  -i, --initial        Reinitialize configuration metadata directory  --pid-file <pidfile>        Path and filename of pid file  -V, --version        Display version information and exit.  --bind-port <portnumber>        Portnumber to use for mcmd. [DEPRECATED]  --copy-port <portnumber>        Portnumber to use for file copying. [DEPRECATED]  --mcmd-user <username>        The username used to access MySQL Cluster Manager [DEPRECATED]  --xcom-port <portnumber>        Portnumber to use for XCOM. [DEPRECATED]# ExamplesBootstrap a NDB cluster on localhost    mcmd --bootstrap Bootstrap a NDB cluster with a specified mcm_data directory    mcmd --bootstrap -d my_mcm_dataStart mcmd with additional config file options on cmdline    mcmd --logger.level=NOTE --mcmd.copy_port=12345
  • --initial,-i

    Command-Line Format--initial

    After making a backup of the agent's configuration store (mcm_data/rep/) like thebackup agents command would do for the local host, wipe the configuration store's contents before startingmcmd. The agent's configuration is then recovered from other agents. This is useful when an agent has fallen into an inconsistent state and cannot be properly restarted.

  • level=level

    TypeEnumeration
    Default Valueinfo
    Valid Values

    fatal

    system

    error

    warning

    info

    note

    debug

    Sets themcmd log severity level. Possible values for this option and their descriptions are listed inTable 4.2, “MySQL Cluster Manager Agent Log Levels” in descending level of severity. When the option is set to a certain severity level, all events of that or higher levels are logged.info is the default log level, and is the recommended setting for a production environment; running on a more severe log level produces fewer messages and makes it harder to trace a problem when it occurs.

    Table 4.2 MySQL Cluster Manager Agent Log Levels

    Level of SeverityDescription
    fatalConditions that should be corrected immediately, such as a corrupted MySQL Cluster Manager data repository
    systemInformational messages about the product
    errorConditions that should be corrected, such as configuration errors
    warningConditions that do not fail executions, but may require user attention
    infoMessages on main events of the site and from command execution (default)
    noteInformational messages to provide users with some execution details
    debugDebugging messages that give execution details useful for developers. This causes large log files if used over a long period of time.

    While the setting of thelevel option is applied only to the host whosemcmd agent uses the option, thechange log-level client command can be used to apply the logging level to an entire management site or to specific hosts.

  • logging_folder=dir_name

    TypeDirectory name
    Default ValueThe parent directory of the MCM installation directory

    Path to themcmd log file directory. The default is the parent directory of the MySQL Cluster Manager installation directory.

  • max_total_connections

    TypeInteger
    Default Value512
    Minimum Value1
    Maximum Value9223372036854775807

    The maximum number of client connections tomcmd. Setting this option helps preventmcmd from running out of file descriptors. This is similar toMySQL Server's max_connections system variable.

    The default value is 512, and the option is set in the[DEFAULT] section of the configuration file.

  • mcmd_password=password

    The option serves the following two purposes:

    • Sets the user password for anmcm client to connect to themcmd agent with the user name set by--mcmd-user. If the option is not specified, the default value ofsuper is used. If the option is specified with another value, the client must supply it using the--password client option when trying to connect to the agent.

    • Sets a password for the MySQL account to be used by themcmd agent to access the SQL nodes. When an SQL node is initialized, themcmd agent creates a new MySQL user account on it using the user name set by the--mcmd-user option and the password set by this option. See descriptions of--mcmd-user for more details about the account.

      If the option is not specified, the default value ofsuper is used.

    • Whenusing TLS connections for NDB clusters, the password is also used as the certificate passphrase. If you changed the password, you must also update manually the certificate passphrase, or the TLS connections will fail. Alternatively, if the situation allows, you can disable TLS connections for the cluster, recreate the certificates, and then reanable TLS connections.

    The option can only be set in the[mcmd] section of configuration file, not on the command line.

  • mcmd-user=user_name

    The option serves the following two purposes:

    • Sets the user name for anmcm client to connect to themcmd agent. If the option is not specified, the default value ofmcmd is used. If the option is specified with another value, the client must supply it using the--user client option when trying to connect to the agent.

      The password for using this user name to connect to the agent is set with themcmd_password option.

    • Sets a user name for the MySQL account to be used by themcmd agent to access the SQL nodes. When an SQL node is initialized, themcmd agent creates a new MySQL user account on it using the user name set by the option and the password set by themcmd_password option.This account is created with all privileges on the MySQL server including the granting of privileges. In other words, it is created as if you had executedGRANT ALL PRIVILEGES ON *.* ... WITH GRANT OPTION in themysql client. The existing MySQLroot account is not altered in such cases, and the defaulttest database is preserved.

    If the option is not specified, the default value ofmcmd is used.

  • --pid-file=file

    Command-Line Format--pid-file=file_name
    TypeFile name
    Default Valuemcmd.pid

    Set the name and path to a process ID (.pid) file. Not normally used or needed. This option is not supported on Windows systems.

  • sinks

    TypeString
    Valid Values (Windows)

    consolelog

    filelog

    eventlog

    Valid Values (Other)

    consolelog

    filelog

    syslog

    The different logging methods used bymcmd.

    Supported sink values are:consolelog,filelog,eventlog (on Windows only), andsyslog (on Unix-based systems only). Use a comma-separated list to define multiple values. If you have multiple sinks defined, they can be customized under the corresponding sections of [syslog],[filelog], and[eventlog] in the configuration file using the filename andlevel options.

    Default value:filelog if thelogging_folder option is not empty in the[DEFAULT] section, andconsolelog otherwise.

  • ssl_ca

    TypeFile name
    Default ValueNULL

    The path name of the Certificate Authority (CA) certificate file in PEM format. The file contains a list of trusted SSL Certificate Authorities.

  • ssl_cert

    TypeFile name
    Default ValueNULL

    The path name of the SSL public key certificate file in PEM format.

    Ifssl_cert is set to a certificate that uses any restricted cipher or cipher category,mcmd starts with support for encrypted connections disabled. For information about cipher restrictions, seeConnection Cipher Configuration.

  • ssl_cipher

    TypeString
    Default ValueNULL

    The list of permissible encryption ciphers for connections that use TLS protocol TLSv1.2. If no cipher in the list is supported, encrypted connections that use these TLS protocols do not work.

    For greatest portability, the cipher list should be a list of one or more cipher names, separated by colons. The following example shows two cipher names separated by a colon:

    [mcmd]ssl_cipher="DHE-RSA-AES128-GCM-SHA256:AES128-SHA"

    OpenSSL supports the syntax for specifying ciphers described in the OpenSSL documentation athttps://www.openssl.org/docs/manmaster/man1/ciphers.html.

    For information about which encryption ciphers MySQL supports, seeEncrypted Connection TLS Protocols and Ciphers.

  • ssl_key

    TypeFile name
    Default ValueNULL

    The path name of the server SSL private key file in PEM format. For better security, use a certificate with an RSA key size of at least 2048 bits.

  • ssl_mode

    TypeEnumeration
    Default ValuePREFERRED
    Valid Values

    DISABLED

    REQUIRED

    PREFERRED

    ssl_mode sets the security state of the connections. The possible values are as follows:

    DISABLED

    Establish an unencrypted connection (the default if certificate and key have not been set).

    REQUIRED

    Establish a secure connection if the secure connections are supported by the target of connection.

    PREFERRED

    Establish an encrypted connection if the target of connection supports encrypted connections, falling back to an unencrypted connection if an encrypted connection cannot be established. This is the default ifssl_mode is not specified.

  • unknown_config_option=string

    TypeString
    Default Valueerror
    Valid Values

    error

    warning

    Determines the behavior for handling unknown configuration options, such as those containing typos. Here are the values this option takes:

    • error (default):mcmd returns an error when an unknown option is encountered

    • warning:mcmd prints a warning when an unknown option is encountered and continues with starting

    MySQL Cluster Manager versions before 8.0.29 ignore any unknown configuration options.

  • --version,-V

    Command-Line Format--version

    Display version information and exit. Output may vary according to the MySQL Cluster Manager software version, operating platform, and versions of libraries used on your system, but should closely resemble what is shown here, with the first line of output containing the MySQL Cluster Manager release number:

    $> mcmd  --versionMySQL Cluster Manager  v8.4.6 on linux-glibc2.17 (64-bit) (MySQL Enterprise - Commercial)
  • xcom-port

    TypeNumeric
    Default Value18620
    Minimum Value1
    Maximum Value65535

    Specify the XCOM port. The default in 18620.