Rechercher dans le manuel MySQL
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 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.
The following table includes command options specific to the NDB Cluster data node program ndbd. Additional descriptions follow the table. For options common to most NDB Cluster programs (including ndbd), see Section 22.4.31, “Options Common to NDB Cluster Programs — Options Common to NDB Cluster Programs”.
Table 22.334 Command-line options for the ndbd program
Format | Description | Added, Deprecated, or Removed |
---|---|---|
Local bind address | All NDB 8.0 releases |
|
Time to wait between attempts to contact a management server, in seconds; 0 means do not wait between attempts | All NDB 8.0 releases |
|
Set the number of times to retry a connection before giving up; 0 means 1 attempt only (and no retries) | All NDB 8.0 releases |
|
Time to wait between attempts to contact a management server, in seconds; 0 means do not wait between attempts | All NDB 8.0 releases |
|
Start ndbd as daemon (default); override with --nodaemon | All NDB 8.0 releases |
|
Run ndbd in foreground, provided for debugging purposes (implies --nodaemon) | All NDB 8.0 releases |
|
Perform initial start of ndbd, including cleaning the file system. Consult the documentation before using this option | All NDB 8.0 releases |
|
Perform partial initial start (requires --nowait-nodes) | All NDB 8.0 releases |
|
Used to install the data node process as a Windows service. Does not apply on non-Windows platforms. | All NDB 8.0 releases |
|
Control size of log buffer. For use when debugging with many log messages being generated; default is sufficient for normal operations. | All NDB 8.0 releases |
|
Don't start ndbd immediately; ndbd waits for command to start from ndb_mgmd | All NDB 8.0 releases |
|
Do not start ndbd as daemon; provided for testing purposes | All NDB 8.0 releases |
|
Do not wait for these data nodes to start (takes comma-separated list of node IDs). Also requires --ndb-nodeid to be used. | All NDB 8.0 releases |
|
Used to remove a data node process that was previously installed as a Windows service. Does not apply on non-Windows platforms. | All NDB 8.0 releases |
|
Causes the data log to write extra debugging information to the node log. | All NDB 8.0 releases |
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.
-
Property Value Command-Line Format --bind-address=name
Type String Default Value Causes ndbd to bind to a specific network interface (host name or IP address). This option has no default value.
-
Property Value Command-Line Format --connect-delay=#
Deprecated Yes Type Numeric Default Value 5
Minimum Value 0
Maximum Value 3600
Determines the time to wait between attempts to contact a management server when starting (the number of attempts is controlled by the
--connect-retries
option). The default is 5 seconds.This option is deprecated, and is subject to removal in a future release of NDB Cluster. Use
--connect-retry-delay
instead. -
Property Value Command-Line Format --connect-retries=#
Type Numeric Default Value 12
Minimum Value 0
Maximum Value 65535
Set the number of times to retry a connection before giving up; 0 means 1 attempt only (and no retries). The default is 12 attempts. The time to wait between attempts is controlled by the
--connect-retry-delay
option. -
Property Value Command-Line Format --connect-retry-delay=#
Type Numeric Default Value 5
Minimum Value 0
Maximum Value 4294967295
Determines the time to wait between attempts to contact a management server when starting (the time between attempts is controlled by the
--connect-retries
option). The default is 5 seconds.This option takes the place of the
--connect-delay
option, which is now deprecated and subject to removal in a future release of NDB Cluster. -
Property Value Command-Line Format --daemon
Type Boolean Default Value TRUE
Instructs ndbd or ndbmtd to execute as a daemon process. This is the default behavior.
--nodaemon
can be used to prevent the process from running as a daemon.This option has no effect when running ndbd or ndbmtd on Windows platforms.
-
Property Value Command-Line Format --foreground
Type Boolean Default Value FALSE
Causes ndbd or ndbmtd to execute as a foreground process, primarily for debugging purposes. This option implies the
--nodaemon
option.This option has no effect when running ndbd or ndbmtd on Windows platforms.
-
Property Value Command-Line Format --initial
Type Boolean Default Value FALSE
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. On some operating systems, this process can take a substantial amount of time.
An
--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 NDB 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.
WarningTo avoid the possibility of eventual data loss, it is recommended that you not use the
--initial
option together withStopOnError = 0
. Instead, setStopOnError
to 0 inconfig.ini
only after the cluster has been started, then restart the data nodes normally—that is, without the--initial
option. See the description of theStopOnError
parameter for a detailed explanation of this issue. (Bug #24945638)Use of this option prevents the
StartPartialTimeout
andStartPartitionedTimeout
configuration parameters from having any effect.ImportantThis option does not affect either of the following types of files:
Backup files that have already been created by the affected node
NDB Cluster Disk Data files (see Section 22.5.13, “NDB Cluster Disk Data Tables”).
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 an NDB Cluster that is running normally.
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.
-
Property Value Command-Line Format --initial-start
Type Boolean Default Value FALSE
This option is used when performing a partial initial start of the cluster. Each node should be started with this option, as well as
--nowait-nodes
.Suppose that you have a 4-node cluster whose data nodes have the IDs 2, 3, 4, and 5, and you wish to perform a partial initial start using only nodes 2, 4, and 5—that is, omitting node 3:
shell> ndbd --ndb-nodeid=2 --nowait-nodes=3 --initial-start shell> ndbd --ndb-nodeid=4 --nowait-nodes=3 --initial-start shell> 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.ImportantDo not confuse this option with the
--nowait-nodes
option for ndb_mgmd, which can be used to enable a cluster configured with multiple management servers to be started without all management servers being online. -
Property Value Command-Line Format --install[=name]
Platform Specific Windows Type String Default Value ndbd
Causes ndbd to be installed as a Windows service. Optionally, you can specify a name for the service; if not set, the service name defaults to
ndbd
. Although it is preferable to specify other ndbd program options in amy.ini
ormy.cnf
configuration file, it is possible to use together with--install
. However, in such cases, the--install
option must be specified first, before any other options are given, for the Windows service installation to succeed.It is generally not advisable to use this option together with the
--initial
option, since this causes the data node file system to be wiped and rebuilt every time the service is stopped and started. Extreme care should also be taken if you intend to use any of the other ndbd options that affect the starting of data nodes—including--initial-start
,--nostart
, and--nowait-nodes
—together with--install
, and you should make absolutely certain you fully understand and allow for any possible consequences of doing so.The
--install
option has no effect on non-Windows platforms. -
Property Value Command-Line Format --logbuffer-size=#
Type Integer Default Value 32768
Minimum Value 2048
Maximum Value 4294967295
Sets the size of the data node log buffer. When debugging with high amounts of extra logging, it is possible for the log buffer to run out of space if there are too many log messages, in which case some log messages can be lost. This should not occur during normal operations.
-
Property Value Command-Line Format --nodaemon
Type Boolean Default Value FALSE
Prevents ndbd or ndbmtd from executing as a daemon process. This option overrides the
--daemon
option. This is useful for redirecting output to the screen when debugging the binary.The default behavior for ndbd and ndbmtd on Windows is to run in the foreground, making this option unnecessary on Windows platforms, where it has no effect.
-
Property Value Command-Line Format --nostart
Type Boolean Default Value FALSE
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 22.5.2, “Commands in the NDB Cluster Management Client”). --nowait-nodes=
node_id_1
[,node_id_2
[, ...]]Property Value Command-Line Format --nowait-nodes=list
Type String Default Value This option takes a list of data nodes which for which the cluster will not wait for before starting.
This can be used to start the cluster in a partitioned state. For example, to start the cluster with only half of the data nodes (nodes 2, 3, 4, and 5) running in a 4-node cluster, you can start each ndbd process with
--nowait-nodes=3,5
. In this case, the cluster starts as soon as nodes 2 and 4 connect, and does not waitStartPartitionedTimeout
milliseconds for nodes 3 and 5 to connect as it would otherwise.If you wanted to start up the same cluster as in the previous example without one ndbd (say, for example, that the host machine for node 3 has suffered a hardware failure) then start nodes 2, 4, and 5 with
--nowait-nodes=3
. Then the cluster will start as soon as nodes 2, 4, and 5 connect and will not wait for node 3 to start.-
Property Value Command-Line Format --remove[=name]
Platform Specific Windows Type String Default Value ndbd
Causes an ndbd process that was previously installed as a Windows service to be removed. Optionally, you can specify a name for the service to be uninstalled; if not set, the service name defaults to
ndbd
.The
--remove
option has no effect on non-Windows platforms. Causes extra debug output to be written to the node log.
You can also use
NODELOG DEBUG ON
andNODELOG DEBUG OFF
to enable and disable this extra logging while the data node is running.
ndbd generates a set of log files which are
placed in the directory specified by
DataDir
in the
config.ini
configuration file.
These log files are listed below.
node_id
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
.
ndb_
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:node_id
_error.logDate/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 in Data Node Error Messages.
ImportantThe 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
ndb_
file (see below). Error log entries are thus overwritten in a cyclical and not sequential fashion.node_id
_trace.log.nextndb_
is a trace file describing exactly what happened just before the error occurred. This information is useful for analysis by the NDB Cluster development team.node_id
_trace.log.trace_id
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.ndb_
is the file that keeps track of the next trace file number to be assigned.node_id
_trace.log.nextndb_
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.node_id
_out.logndb_
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.node_id
.pidndb_
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 ndbd process.node_id
_signal.log
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.
shell> ndbd --connect-string="nodeid=2;host=ndb_mgmd.mysql.com:1186"
See Section 22.3.3.3, “NDB Cluster Connection Strings”, for additional information about this issue. Section 22.4.31, “Options Common to NDB Cluster Programs — Options Common to NDB Cluster Programs”, describes other command-line options which can be used with ndbd. For information about data node configuration parameters, see Section 22.3.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 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 8.0 in a production setting. See Section 22.1.7, “Known Limitations of NDB Cluster”.
Traduction non disponible
Le manuel MySQL n'est pas encore traduit en français sur l'infobrol. Seule la version anglaise est disponible pour l'instant.
Document créé le 26/06/2006, dernière modification le 26/10/2018
Source du document imprimé : https://www.gaudry.be/mysql-rf-mysql-cluster-programs-ndbd.html
L'infobrol est un site personnel dont le contenu n'engage que moi. Le texte est mis à disposition sous licence CreativeCommons(BY-NC-SA). Plus d'info sur les conditions d'utilisation et sur l'auteur.
Références
Ces références et liens indiquent des documents consultés lors de la rédaction de cette page, ou qui peuvent apporter un complément d'information, mais les auteurs de ces sources ne peuvent être tenus responsables du contenu de cette page.
L'auteur de ce site est seul responsable de la manière dont sont présentés ici les différents concepts, et des libertés qui sont prises avec les ouvrages de référence. N'oubliez pas que vous devez croiser les informations de sources multiples afin de diminuer les risques d'erreurs.