25.5.4 ndb_mgmd — The NDB Cluster Management Server Daemon (original) (raw)

25.5.4 ndb_mgmd — The NDB Cluster Management Server Daemon

The management server is the process that reads the cluster configuration file and distributes this information to all nodes in the cluster that request it. It also maintains a log of cluster activities. Management clients can connect to the management server and check the cluster's status.

All options that can be used with ndb_mgmd are shown in the following table. Additional descriptions follow the table.

Table 25.26 Command-line options used with the program ndb_mgmd

Format Description Added, Deprecated, or Removed
--bind-address=host Local bind address (Supported in all NDB releases based on MySQL 8.0)
--character-sets-dir=path Directory containing character sets REMOVED: 8.0.31
--cluster-config-suffix=name Override defaults group suffix when reading cluster_config sections in my.cnf file; used in testing ADDED: 8.0.24
--config-cache[=TRUE|FALSE] Enable management server configuration cache; true by default (Supported in all NDB releases based on MySQL 8.0)
--config-file=file, -f file Specify cluster configuration file; also specify --reload or --initial to override configuration cache if present (Supported in all NDB releases based on MySQL 8.0)
--configdir=directory, --config-dir=directory Specify cluster management server configuration cache directory (Supported in all NDB releases based on MySQL 8.0)
--connect-retries=# Number of times to retry connection before giving up REMOVED: 8.0.31
--connect-retry-delay=# Number of seconds to wait between attempts to contact management server REMOVED: 8.0.31
--connect-string=connection_string, -c connection_string Same as --ndb-connectstring (Supported in all NDB releases based on MySQL 8.0)
--core-file Write core file on error; used in debugging REMOVED: 8.0.31
--daemon, -d Run ndb_mgmd in daemon mode (default) (Supported in all NDB releases based on MySQL 8.0)
--defaults-extra-file=path Read given file after global files are read (Supported in all NDB releases based on MySQL 8.0)
--defaults-file=path Read default options from given file only (Supported in all NDB releases based on MySQL 8.0)
--defaults-group-suffix=string Also read groups with concat(group, suffix) (Supported in all NDB releases based on MySQL 8.0)
--help, -? Display help text and exit (Supported in all NDB releases based on MySQL 8.0)
--initial Causes management server to reload configuration data from configuration file, bypassing configuration cache (Supported in all NDB releases based on MySQL 8.0)
--install[=name] Used to install management server process as Windows service; does not apply on other platforms (Supported in all NDB releases based on MySQL 8.0)
--interactive Run ndb_mgmd in interactive mode (not officially supported in production; for testing purposes only) (Supported in all NDB releases based on MySQL 8.0)
--log-name=name Name to use when writing cluster log messages applying to this node (Supported in all NDB releases based on MySQL 8.0)
--login-path=path Read given path from login file (Supported in all NDB releases based on MySQL 8.0)
--mycnf Read cluster configuration data from my.cnf file (Supported in all NDB releases based on MySQL 8.0)
--ndb-connectstring=connection_string, -c connection_string Set connect string for connecting to ndb_mgmd. Syntax: "[nodeid=id;][host=]hostname[:port]". Overrides entries in NDB_CONNECTSTRING and my.cnf (Supported in all NDB releases based on MySQL 8.0)
--ndb-mgmd-host=connection_string, -c connection_string Same as --ndb-connectstring (Supported in all NDB releases based on MySQL 8.0)
--ndb-nodeid=# Set node ID for this node, overriding any ID set by --ndb-connectstring (Supported in all NDB releases based on MySQL 8.0)
--ndb-optimized-node-selection Enable optimizations for selection of nodes for transactions. Enabled by default; use --skip-ndb-optimized-node-selection to disable REMOVED: 8.0.31
--no-defaults Do not read default options from any option file other than login file (Supported in all NDB releases based on MySQL 8.0)
--no-nodeid-checks Do not perform any node ID checks (Supported in all NDB releases based on MySQL 8.0)
--nodaemon Do not run ndb_mgmd as a daemon (Supported in all NDB releases based on MySQL 8.0)
--nowait-nodes=list Do not wait for management nodes specified when starting this management server; requires --ndb-nodeid option (Supported in all NDB releases based on MySQL 8.0)
--print-defaults Print program argument list and exit (Supported in all NDB releases based on MySQL 8.0)
--print-full-config, -P Print full configuration and exit (Supported in all NDB releases based on MySQL 8.0)
--reload Causes management server to compare configuration file with configuration cache (Supported in all NDB releases based on MySQL 8.0)
--remove[=name] Used to remove management server process that was previously installed as Windows service, optionally specifying name of service to be removed; does not apply on other platforms (Supported in all NDB releases based on MySQL 8.0)
--skip-config-file Do not use configuration file (Supported in all NDB releases based on MySQL 8.0)
--usage, -? Display help text and exit; same as --help (Supported in all NDB releases based on MySQL 8.0)
--verbose, -v Write additional information to log (Supported in all NDB releases based on MySQL 8.0)
--version, -V Display version information and exit (Supported in all NDB releases based on MySQL 8.0)
ndb_node-id_config.bin.seq-number  

node-id is the management server's node ID; seq-number is a sequence number, beginning with 1. For example, if the management server's node ID is 5, then the first three configuration cache files would, when they are created, be named ndb_5_config.bin.1,ndb_5_config.bin.2, andndb_5_config.bin.3.
If your intent is to purge or reload the configuration cache without actually disabling caching, you should startndb_mgmd with one of the options--reload or--initial instead of--skip-config-cache.
To re-enable the configuration cache, simply restart the management server, but without the--config-cache or--skip-config-cache option that was used previously to disable the configuration cache.
ndb_mgmd does not check for the configuration directory (--configdir) or attempts to create one when --skip-config-cache is used. (Bug #13428853)

[ndbd]  
NodeId = 1  
HostName = 198.51.100.101  
[ndbd]  
NodeId = 2  
HostName = 198.51.100.102  
[ndbd]  
NodeId = 3  
HostName = 198.51.100.103  
[ndbd]  
NodeId = 4  
HostName = 198.51.100.104  
[ndb_mgmd]  
NodeId = 10  
HostName = 198.51.100.150  
[ndb_mgmd]  
NodeId = 11  
HostName = 198.51.100.151  
[api]  
NodeId = 20  
HostName = 198.51.100.200  
[api]  
NodeId = 21  
HostName = 198.51.100.201  

Assume that you wish to start this cluster using only the management server having node ID 10 and running on the host having the IP address 198.51.100.150. (Suppose, for example, that the host computer on which you intend to the other management server is temporarily unavailable due to a hardware failure, and you are waiting for it to be repaired.) To start the cluster in this way, use a command line on the machine at 198.51.100.150 to enter the following command:

$> ndb_mgmd --ndb-nodeid=10 --nowait-nodes=11  

As shown in the preceding example, when using--nowait-nodes, you must also use the --ndb-nodeid option to specify the node ID of thisndb_mgmd process.
You can then start each of the cluster's data nodes in the usual way. If you wish to start and use the second management server in addition to the first management server at a later time without restarting the data nodes, you must start each data node with a connection string that references both management servers, like this:

$> ndbd -c 198.51.100.150,198.51.100.151  

The same is true with regard to the connection string used with any mysqld processes that you wish to start as NDB Cluster SQL nodes connected to this cluster. See Section 25.4.3.3, “NDB Cluster Connection Strings”, for more information.
When used with ndb_mgmd, this option affects the behavior of the management node with regard to other management nodes only. Do not confuse it with the--nowait-nodes option used withndbd or ndbmtd to permit a cluster to start with fewer than its full complement of data nodes; when used with data nodes, this option affects their behavior only with regard to other data nodes.
Multiple management node IDs may be passed to this option as a comma-separated list. Each node ID must be no less than 1 and no greater than 255. In practice, it is quite rare to use more than two management servers for the same NDB Cluster (or to have any need for doing so); in most cases you need to pass to this option only the single node ID for the one management server that you do not wish to use when starting the cluster.
Note
When you later start the “missing” management server, its configuration must match that of the management server that is already in use by the cluster. Otherwise, it fails the configuration check performed by the existing management server, and does not start.

It is not strictly necessary to specify a connection string when starting the management server. However, if you are using more than one management server, a connection string should be provided and each node in the cluster should specify its node ID explicitly.

See Section 25.4.3.3, “NDB Cluster Connection Strings”, for information about using connection strings.Section 25.5.4, “ndb_mgmd — The NDB Cluster Management Server Daemon”, describes other options for ndb_mgmd.

The following files are created or used byndb_mgmd in its starting directory, and are placed in the DataDir as specified in the config.ini configuration file. In the list that follows,nodeid is the unique node identifier.