ndbd is the process that is used to handle all the data in tables using the NDB Cluster storage engine. This is the process that empowers a data node to accomplish distributed transaction handling, node recovery, checkpointing to disk, online backup, and related tasks.
In a MySQL 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.
The following table includes command options specific to the MySQL Cluster data node program ndbd. Additional descriptions follow the table. For options common to all MySQL Cluster programs, see Section 15.4.20, “Options Common to MySQL Cluster Programs — Options Common to MySQL Cluster Programs”.
Table 15.9. ndbd Command Line Options
|--daemon||Start ndbd as daemon (default); override with --nodaemon|
|--foreground||Run ndbd in foreground, provided for debugging purposes (implies --nodaemon)|
|--initial||Perform initial start of ndbd, including cleaning the file system. Consult the documentation before using this option|
|--nodaemon||Do not start ndbd as daemon; provided for testing purposes|
|--nostart||Don't start ndbd immediately; ndbd waits for command to start from ndb_mgmd|
|Permitted Values (>= 4.1.5)|
Instructs ndbd to execute as a daemon
process. From MySQL 4.1.5 on, this is the default behavior,
--nodaemon can be used to prevent the
process from running as a daemon.
Instructs ndbd to perform an initial start. An initial start erases any files created for recovery purposes by earlier instances of ndbd. It also re-creates recovery log files. Note that on some operating systems this process can take a substantial amount of time.
--initial start is to be used
only when starting the
ndbd process under very special
circumstances; this is because this option causes all files
to be removed from the Cluster file system and all redo log
files to be re-created. These circumstances are listed here:
When performing a software upgrade which has changed the contents of any files.
When restarting the node with a new version of ndbd.
As a measure of last resort when for some reason the node restart or system restart repeatedly fails. In this case, be aware that this node can no longer be used to restore data due to the destruction of the data files.
Use of this option prevents the
parameters from having any effect.
This option does not affect any backup files that have already been created by the affected node.
This option also has no effect on recovery of data by a data node that is just starting (or restarting) from data nodes that are already running. This recovery of data occurs automatically, and requires no user intervention in a MySQL Cluster that is running normally.
In older versions of MySQL Cluster, it was possible to use
-i for this option. This shortcut was
removed to prevent this option from being used by mistake.
It is permissible to use this option when starting the cluster for the very first time (that is, before any data node files have been created); however, it is not necessary to do so.
Instructs ndbd not to start
automatically. When this option is used,
ndbd connects to the management server,
obtains configuration data from it, and initializes
communication objects. However, it does not actually start
the execution engine until specifically requested to do so
by the management server. This can be accomplished by
issuing the proper
START command in the
management client (see
Section 15.5.2, “Commands in the MySQL Cluster Management Client”).
In MySQL versions prior to 4.1.5, each ndbd
process should be started in a separate directory, the reason
for this being that ndbd generated a set of
log files in its starting directory. In MySQL 4.1.5, this
behavior was changed such that these files are placed in the
directory specified by
DataDir in the
configuration file. Thus ndbd can be started
These log files are listed below.
node_id is the node's unique
identifier. Note that
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
error.log in version 4.1.3) is a
file containing records of all crashes which the referenced
ndbd process has encountered. Each record
in this file contains a brief error string and a reference
to a trace file for this crash. A typical entry in this file
might appear as shown here:
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***
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 the
file (see below). Error log entries are thus overwritten
in a cyclical and not sequential fashion.
in version 4.1.3) is a trace file describing exactly what
happened just before the error occurred. This information is
useful for analysis by the MySQL Cluster development team.
It is possible to configure the number of these trace files
that will be created before old files are overwritten.
trace_id is a number which is
incremented for each successive trace file.
NextTraceFileNo.log in version
4.1.3) is the file that keeps track of the next trace file
number to be assigned.
is a file containing any data output by the
ndbd process. This file is created only
if ndbd is started as a daemon, which is
the default behavior beginning with MySQL 4.1.5. This file
in versions 4.1.3 and 4.1.4.
is a file containing the process ID of the
ndbd process when started as a daemon. It
also functions as a lock file to avoid the starting of nodes
with the same identifier.
Signal.log in version 4.1.3) is a
file used only in debug versions of ndbd,
where it is possible to trace all incoming, outgoing, and
internal messages with their data in the
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.
See Section 126.96.36.199, “The MySQL Cluster Connectstring”, for additional information about this issue. Section 15.4.1, “ndbd — The MySQL Cluster Data Node Daemon”, describes other options for ndbd.
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 the ndbd 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 the ndbd process. In a multi-processor system performing a large number of operations (including updates), the ndbd process can consume up to 2 CPUs if permitted to do so.
For a machine with many CPUs it is possible to use several ndbd processes which belong to different node groups; however, such a configuration is still considered experimental and is not supported for MySQL 4.1 in a production setting. See Section 15.1.4, “Known Limitations of MySQL Cluster”.