25.5.1 ndbd — The NDB Cluster Data Node Daemon (original) (raw)

25.5.1 ndbd — The NDB Cluster Data Node Daemon

The ndbd binary provides the single-threaded version of the process that is used to handle all the data in tables employing the NDBCLUSTER storage engine. This data node process enables a data node to accomplish distributed transaction handling, node recovery, checkpointing to disk, online backup, and related tasks. In NDB 8.0.38 and later, when started, ndbd logs a warning similar to that shown here:

2024-05-28 13:32:16 [ndbd] WARNING  -- Running ndbd with a single thread of
signal execution.  For multi-threaded signal execution run the ndbmtd binary.

ndbmtd is the multi-threaded version of this binary.

In an NDB Cluster, a set of ndbd processes cooperate in handling data. These processes can execute on the same computer (host) or on different computers. The correspondences between data nodes and Cluster hosts is completely configurable.

Options that can be used with ndbd are shown in the following table. Additional descriptions follow the table.

Table 25.24 Command-line options used with the program ndbd

Format Description Added, Deprecated, or Removed
--bind-address=name Local bind address (Supported in all NDB releases based on MySQL 8.0)
--character-sets-dir=path Directory containing character sets (Supported in all NDB releases based on MySQL 8.0)
--connect-delay=# Obsolete synonym for --connect-retry-delay, which should be used instead of this option REMOVED: NDB 8.0.28
--connect-retries=# Set the number of times to retry a connection before giving up; 0 means 1 attempt only (and no retries); -1 means continue retrying indefinitely (Supported in all NDB releases based on MySQL 8.0)
--connect-retry-delay=# Time to wait between attempts to contact a management server, in seconds; 0 means do not wait between attempts (Supported in all NDB releases based on MySQL 8.0)
--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 (Supported in all NDB releases based on MySQL 8.0)
--daemon, -d Start ndbd as daemon (default); override with --nodaemon (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)
--filesystem-password=password Password for node file system encryption; can be passed from stdin, tty, or my.cnf file ADDED: NDB 8.0.31
--filesystem-password-from-stdin={TRUE|FALSE} Get password for node file system encryption, passed from stdin ADDED: NDB 8.0.31
--foreground Run ndbd in foreground, provided for debugging purposes (implies --nodaemon) (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 Perform initial start of ndbd, including file system cleanup; consult documentation before using this option (Supported in all NDB releases based on MySQL 8.0)
--initial-start Perform partial initial start (requires --nowait-nodes) (Supported in all NDB releases based on MySQL 8.0)
--install[=name] Used to install data node process as Windows service; does not apply on other platforms (Supported in all NDB releases based on MySQL 8.0)
--logbuffer-size=# Control size of log buffer; for use when debugging with many log messages being generated; default is sufficient for normal operations (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)
--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)
--nodaemon Do not start ndbd as daemon; provided for testing purposes (Supported in all NDB releases based on MySQL 8.0)
--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)
--nostart, -n Do not start ndbd immediately; ndbd waits for command to start from ndb_mgm (Supported in all NDB releases based on MySQL 8.0)
--nowait-nodes=list Do not wait for these data nodes to start (takes comma-separated list of node IDs); requires --ndb-nodeid (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
--print-defaults Print program argument list and exit (Supported in all NDB releases based on MySQL 8.0)
--remove[=name] Used to remove data node process that was previously installed as Windows service; does not apply on other platforms (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 extra debugging information to node 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)

Note

All of these options also apply to the multithreaded version of this program (ndbmtd) and you may substitute “ndbmtd” for“ndbd” wherever the latter occurs in this section.

$> ndbd --ndb-nodeid=2 --nowait-nodes=3 --initial-start  
$> ndbd --ndb-nodeid=4 --nowait-nodes=3 --initial-start  
$> ndbd --ndb-nodeid=5 --nowait-nodes=3 --initial-start  

When using this option, you must also specify the node ID for the data node being started with the--ndb-nodeid option.
Important
Do not confuse this option with the--nowait-nodes option forndb_mgmd, which can be used to enable a cluster configured with multiple management servers to be started without all management servers being online.

ndbd generates a set of log files which are placed in the directory specified byDataDir in theconfig.ini configuration file.

These log files are listed below.nodeid is and represents the node's unique identifier. For example,ndb_2_error.log is the error log generated by the data node whose node ID is 2.

Date/Time: Saturday 30 July 2004 - 00:20:01  
Type of error: error  
Message: Internal program error (failed ndbrequire)  
Fault ID: 2341  
Problem data: DbtupFixAlloc.cpp  
Object of reference: DBTUP (Line: 173)  
ProgramName: NDB Kernel  
ProcessID: 14909  
TraceFile: ndb_2_trace.log.2  
***EOM***  

Listings of possible ndbd exit codes and messages generated when a data node process shuts down prematurely can be found inData Node Error Messages.
Important
The last entry in the error log file is not necessarily the newest one (nor is it likely to be). Entries in the error log are not listed in chronological order; rather, they correspond to the order of the trace files as determined in thendb_ _`nodeid`__trace.log.next file (see below). Error log entries are thus overwritten in a cyclical and not sequential fashion.

It is recommended not to use a directory mounted through NFS because in some environments this can cause problems whereby the lock on the .pid file remains in effect even after the process has terminated.

To start ndbd, it may also be necessary to specify the host name of the management server and the port on which it is listening. Optionally, one may also specify the node ID that the process is to use.

$> ndbd --connect-string="nodeid=2;host=ndb_mgmd.mysql.com:1186"

See Section 25.4.3.3, “NDB Cluster Connection Strings”, for additional information about this issue. For more information about data node configuration parameters, seeSection 25.4.3.6, “Defining NDB Cluster Data Nodes”.

When ndbd starts, it actually initiates two processes. The first of these is called the “angel process”; its only job is to discover when the execution process has been completed, and then to restart thendbd process if it is configured to do so. Thus, if you attempt to kill ndbd using the Unix kill command, it is necessary to kill both processes, beginning with the angel process. The preferred method of terminating an ndbd process is to use the management client and stop the process from there.

The execution process uses one thread for reading, writing, and scanning data, as well as all other activities. This thread is implemented asynchronously so that it can easily handle thousands of concurrent actions. In addition, a watch-dog thread supervises the execution thread to make sure that it does not hang in an endless loop. A pool of threads handles file I/O, with each thread able to handle one open file. Threads can also be used for transporter connections by the transporters in thendbd process. In a multi-processor system performing a large number of operations (including updates), thendbd process can consume up to 2 CPUs if permitted to do so.

For a machine with many CPUs it is possible to use severalndbd processes which belong to different node groups; however, such a configuration is still considered experimental and is not supported for MySQL 8.0 in a production setting. SeeSection 25.2.7, “Known Limitations of NDB Cluster”.