ndbd 二进制文件提供单线程版本的进程,用于处理使用 NDBCLUSTER 存储引擎的表中的所有数据。该数据节点进程使数据节点能够执行分布式事务处理、节点恢复、写入磁盘的检查点、在线备份以及相关任务。在 NDB 8.4.1 及更高版本中,启动时,ndbd 会记录类似于此处显示的警告: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.4.1 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 是该二进制文件的多线程版本。ndbmtd is the multi-threaded version of this binary.
在 NDB Cluster 中,一组 ndbd 进程协同处理数据。这些进程可以在同一台计算机(主机)上或不同计算机上执行。数据节点与 Cluster 主机之间的对应关系是完全可配置的。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.
ndbd 可以使用的选项显示在下表中。表格之后有更多描述。Options that can be used with ndbd are shown in the following table. Additional descriptions follow the table.
所有这些选项也适用于该程序的多线程版本(ndbmtd)并且您可以在本节中将出现的 “ndbd” 替换为 “ndbmtd”。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.
命令行格式Command-Line Format --bind-address=name类型Type 字符串String 默认值Default Value 使 ndbd 绑定到特定的网络接口(主机名或 IP 地址)。此选项没有默认值。Causes ndbd to bind to a specific network interface (host name or IP address). This option has no default value.
命令行格式Command-Line Format --character-sets-dir=path--character-sets-dir=path包含字符集的目录。Directory containing character sets.
命令行格式Command-Line Format --connect-delay=#已弃用Deprecated 是Yes 类型Type 数字Numeric 默认值Default Value 5最小值Minimum Value 0最大值Maximum Value 3600确定在启动时尝试联系管理服务器之间的等待时间(尝试次数由
--connect-retries选项控制)。默认值为 5 秒。Determines the time to wait between attempts to contact a management server when starting (the number of attempts is controlled by the--connect-retriesoption). The default is 5 seconds.此选项已被弃用,可能在未来的 NDB Cluster 版本中移除。应改用
--connect-retry-delay。This option is deprecated, and is subject to removal in a future release of NDB Cluster. Use--connect-retry-delayinstead.命令行格式Command-Line Format --connect-retries=#类型Type 数字Numeric 默认值Default Value 12最小值Minimum Value -1最大值Maximum Value 65535设置在放弃之前重试连接的次数;0 表示仅尝试 1 次(且不重试)。默认是 12 次尝试。每次尝试之间的等待时间由
--connect-retry-delay选项控制。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-delayoption.也可以将此选项设置为-1,在这种情况下,数据节点进程会无限期地尝试连接。It is also possible to set this option to -1, in which case, the data node process continues indefinitely to try to connect.
命令行格式Command-Line Format --connect-retry-delay=#类型Type 数字Numeric 默认值Default Value 5最小值Minimum Value 0最大值Maximum Value 4294967295确定在启动时尝试联系管理服务器之间的等待时间(尝试之间的时间由
--connect-retries选项控制)。默认值为 5 秒。Determines the time to wait between attempts to contact a management server when starting (the time between attempts is controlled by the--connect-retriesoption). The default is 5 seconds.该选项取代了
--connect-delay选项,该选项现在已被弃用,并可能在 NDB Cluster 的未来版本中移除。This option takes the place of the--connect-delayoption, which is now deprecated and subject to removal in a future release of NDB Cluster.此选项的简写形式
-r也已弃用,因此可能会被移除。请改用长形式。The short form-rfor this option is also deprecated, and thus subject to removal. Use the long form instead.命令行格式Command-Line Format --connect-string=connection_string类型Type 字符串String 默认值Default Value [none][none]与
--ndb-connectstring相同。Same as--ndb-connectstring.命令行格式Command-Line Format --core-file错误时生成核心文件;用于调试。Write core file on error; used in debugging.
--daemon,-d命令行格式Command-Line Format --daemon指示ndbd或ndbmtd以守护进程方式执行。这是默认行为。可以使用
--nodaemon防止进程以守护进程方式运行。Instructs ndbd or ndbmtd to execute as a daemon process. This is the default behavior.--nodaemoncan be used to prevent the process from running as a daemon.在 Windows 平台上运行 ndbd 或 ndbmtd 时,此选项没有效果。This option has no effect when running ndbd or ndbmtd on Windows platforms.
命令行格式Command-Line Format --defaults-extra-file=path--defaults-extra-file=path类型Type 字符串String 默认值Default Value [none][none]在读取全局文件之后读取给定文件。Read given file after global files are read.
命令行格式Command-Line Format --defaults-file=path类型Type 字符串String 默认值Default Value [none][none]仅从指定文件读取默认选项。Read default options from given file only.
命令行格式Command-Line Format --defaults-group-suffix=string类型Type 字符串String 默认值Default Value [none][none]也读取组合了 concat(group, suffix) 的组。Also read groups with concat(group, suffix).
命令行格式Command-Line Format --filesystem-password=password通过
stdin、tty或my.cnf文件,将文件系统加密和解密密码传递给数据节点进程。Pass the filesystem encryption and decryption password to the data node process usingstdin,tty, or themy.cnffile.需要
EncryptedFileSystem = 1。RequiresEncryptedFileSystem = 1.更多信息,请参见 第 25.6.19.4 节,“NDB 集群的文件系统加密”。For more information, see Section 25.6.19.4, “File System Encryption for NDB Cluster”.
--filesystem-password-from-stdin命令行格式Command-Line Format --filesystem-password-from-stdin={TRUE|FALSE}将文件系统加密和解密密码仅通过
stdin传递给数据节点进程。Pass the filesystem encryption and decryption password to the data node process fromstdin(only).需要
EncryptedFileSystem = 1。RequiresEncryptedFileSystem = 1.更多信息,请参见 第 25.6.19.4 节,“NDB 集群的文件系统加密”。For more information, see Section 25.6.19.4, “File System Encryption for NDB Cluster”.
命令行格式Command-Line Format --foreground使 ndbd 或 ndbmtd 以前台进程执行,主要用于调试目的。此选项隐含
--nodaemon选项。Causes ndbd or ndbmtd to execute as a foreground process, primarily for debugging purposes. This option implies the--nodaemonoption.在 Windows 平台上运行 ndbd 或 ndbmtd 时,此选项没有效果。This option has no effect when running ndbd or ndbmtd on Windows platforms.
命令行格式Command-Line Format --help--help显示帮助文本并退出。Display help text and exit.
命令行格式Command-Line Format --initial指示 ndbd 执行初始启动。初始启动会删除由先前实例的 ndbd 为恢复目的创建的任何文件。它还会重新创建恢复日志文件。在某些操作系统上,该过程可能需要相当长的时间。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.
此选项还会删除与磁盘表空间相关的所有数据文件以及与以前存在于此数据节点上的日志文件组相关的撤销日志文件(参见 第 25.6.11 节,“NDB Cluster 磁盘表”)。The option also causes the removal of all data files associated with Disk Data tablespaces and undo log files associated with log file groups that existed previously on this data node (see Section 25.6.11, “NDB Cluster Disk Data Tables”).
--initial启动 仅 应在极特殊情况下用于启动 ndbd 进程;这是因为此选项会删除 NDB Cluster 文件系统中的所有文件,并重新创建所有重做日志文件。具体情况如下:An--initialstart 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.
在使用新版本的 ndbd 重启节点时。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.
Warning为了避免最终数据丢失的可能性,建议您不要将
--initial选项与StopOnError = 0一起使用。相反,应在集群启动后才在config.ini中将StopOnError设置为 0,然后正常重启数据节点——也就是不使用--initial选项。有关此问题的详细说明,请参见StopOnError参数的描述。(Bug #24945638)To avoid the possibility of eventual data loss, it is recommended that you not use the--initialoption together withStopOnError = 0. Instead, setStopOnErrorto 0 inconfig.inionly after the cluster has been started, then restart the data nodes normally—that is, without the--initialoption. See the description of theStopOnErrorparameter for a detailed explanation of this issue. (Bug #24945638)使用此选项会阻止
StartPartialTimeout和StartPartitionedTimeout配置参数生效。Use of this option prevents theStartPartialTimeoutandStartPartitionedTimeoutconfiguration parameters from having any effect.Important此选项不会影响受影响节点已创建的备份文件。This option does not affect backup files that have already been created by the affected node.
此选项也不会影响刚启动(或重启)的数据节点从已在运行的数据节点恢复数据的过程(除非它们在初始重启时也使用了
--initial启动)。在正常运行的 NDB Cluster 中,这种数据恢复会自动进行,无需用户干预。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 (unless they also were started with--initial, as part of an initial restart). 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 在多线程系统中 necessary to do so.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.
命令行格式Command-Line Format --initial-start此选项用于执行集群的部分初始启动。每个节点都应使用此选项启动,同时还应使用
--nowait-nodes。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.假设您有一个数据节点 ID 为 2、3、4 和 5 的 4 节点集群,并且您希望只使用 2、4 和 5 节点进行部分初始启动——也就是忽略节点 3: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:
$>
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使用此选项时,您还必须使用
--ndb-nodeid选项指定要启动的数据节点的节点 ID。When using this option, you must also specify the node ID for the data node being started with the--ndb-nodeidoption.Important不要将此选项与
--nowait-nodes选项混淆,该选项用于 ndb_mgmd,可用于在配置了多个管理服务器的集群中,在并非所有管理服务器均在线的情况下启动集群。Do not confuse this option with the--nowait-nodesoption 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.命令行格式Command-Line Format --install[=name]特定平台Platform Specific 窗口Windows 类型Type 字符串String 默认值Default Value ndbd导致 ndbd 被安装为 Windows 服务。您可以选择为该服务指定一个名称;如果未设置,服务名称默认为
ndbd。虽然最好在my.ini或my.cnf配置文件中指定其他 ndbd 程序选项,但也可以与--install一起使用。然而,在这种情况下,为了 Windows 服务安装成功,--install选项必须首先指定,然后才能提供其他选项。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 tondbd. Although it is preferable to specify other ndbd program options in amy.iniormy.cnfconfiguration file, it is possible to use together with--install. However, in such cases, the--installoption must be specified first, before any other options are given, for the Windows service installation to succeed.通常不建议将此选项与
--initial选项一起使用,因为这会导致每次服务停止和启动时数据节点文件系统都被清空并重建。如果您打算使用其他任何影响数据节点启动的ndbd选项,包括--initial-start、--nostart以及--nowait-nodes,与--install一起使用时,也应格外小心,并且应确保您完全理解并考虑这样做可能带来的任何后果。It is generally not advisable to use this option together with the--initialoption, 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.--install选项在非 Windows 平台上无效。The--installoption has no effect on non-Windows platforms.命令行格式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.
命令行格式Command-Line Format --login-path=path类型Type 字符串String 默认值Default Value [none][none]从登录文件读取给定路径。Read given path from login file.
命令行格式Command-Line Format --no-login-paths跳过从登录路径文件读取选项。Skips reading options from the login path file.
命令行格式Command-Line Format --ndb-connectstring=connection_string类型Type 字符串String 默认值Default Value [none][none]设置用于连接到 ndb_mgmd 的连接字符串。语法:
[nodeid=。覆盖id;][host=]hostname[:port]NDB_CONNECTSTRING和my.cnf中的条目。Set connection string for connecting to ndb_mgmd. Syntax:[nodeid=. Overrides entries inid;][host=]hostname[:port]NDB_CONNECTSTRINGandmy.cnf.命令行格式Command-Line Format --ndb-log-timestamps类型Type 枚举Enumeration 默认值Default Value LEGACY有效值Valid Values LEGACYUTCUTCSYSTEMSYSTEM设置节点日志中使用的时间戳格式。这是以下值之一:Sets the format used for timestamps in node logs. This is one of the following values:
LEGACY在 MySQL 8.4 中是默认值,以保持与以前版本的向后兼容性。LEGACYis the default in MySQL 8.4, for backwards compatibility with previous versions.命令行格式Command-Line Format --ndb-mgmd-host=connection_string类型Type 字符串String 默认值Default Value [none][none]与
--ndb-connectstring相同。Same as--ndb-connectstring.命令行格式Command-Line Format --ndb-mgm-tls=level类型Type 枚举Enumeration 默认值Default Value relaxedrelaxed有效值Valid Values relaxedrelaxedstrictstrict设置连接到管理服务器所需的 TLS 支持级别;可以是
relaxed或strict。relaxed(默认)表示尝试建立 TLS 连接,但不要求成功;strict表示连接必须使用 TLS。Sets the level of TLS support required to connect to the management server; one ofrelaxedorstrict.relaxed(the default) means that a TLS connection is attempted, but success is not required;strictmeans that TLS is required to connect.命令行格式Command-Line Format --ndb-nodeid=#类型Type 整数Integer 默认值Default Value [none][none]为此节点设置节点 ID,覆盖任何由 --ndb-connectstring 设置的 ID。Set node ID for this node, overriding any ID set by --ndb-connectstring.
--ndb-optimized-node-selection命令行格式Command-Line Format --ndb-optimized-node-selection启用事务节点选择的优化。默认启用;使用
--skip-ndb-optimized-node-selection来禁用。Enable optimizations for selection of nodes for transactions. Enabled by default; use--skip-ndb-optimized-node-selectionto disable.命令行格式Command-Line Format --ndb-tls-search-path=list类型Type 路径名Path name 默认值(Unix)Default Value (Unix) $HOME/ndb-tls$HOME/ndb-tls默认值(Windows)Default Value (Windows) $HOMEDIR/ndb-tls指定用于搜索 CA 文件的目录列表。在 Unix 平台上,目录名称用冒号 (
:) 分隔;在 Windows 系统上,使用分号 (;) 作为分隔符。目录引用可以是相对路径或绝对路径;它可以包含一个或多个环境变量,每个变量以美元符号 ($) 开头,并在使用前进行展开。Specify a list of directories to search for a CA file. On Unix platforms, the directory names are separated by colons (:); on Windows systems, the semicolon character (;) is used as the separator. A directory reference may be relative or absolute; it may contain one or more environment variables, each denoted by a prefixed dollar sign ($), and expanded prior to use.搜索从最左边的命名目录开始,按从左到右的顺序进行,直到找到文件。空字符串表示空搜索路径,这会导致所有搜索失败。由单个点 (
.) 组成的字符串表示搜索路径仅限于当前工作目录。Searching begins with the leftmost named directory and proceeds from left to right until a file is found. An empty string denotes an empty search path, which causes all searches to fail. A string consisting of a single dot (.) indicates that the search path limited to the current working directory.如果未提供搜索路径,则使用编译时的默认值。此值取决于所使用的平台:在 Windows 上,它是
\ndb-tls;在其他平台(包括 Linux)上,它是$HOME/ndb-tls。可以通过使用-DWITH_NDB_TLS_SEARCH_PATH编译 NDB Cluster 来覆盖该值。If no search path is supplied, the compiled-in default value is used. This value depends on the platform used: On Windows, this is\ndb-tls; on other platforms (including Linux), it is$HOME/ndb-tls. This can be overridden by compiling NDB Cluster using-DWITH_NDB_TLS_SEARCH_PATH.命令行格式Command-Line Format --nodaemon阻止 ndbd 或 ndbmtd 以守护进程方式执行。此选项会覆盖
--daemon选项。当调试二进制文件时,将输出重定向到屏幕非常有用。Prevents ndbd or ndbmtd from executing as a daemon process. This option overrides the--daemonoption. This is useful for redirecting output to the screen when debugging the binary.在 Windows 上,ndbd 和 ndbmtd 的默认行为是在前台运行,因此在 Windows 平台上使用该选项是多余的,它不会产生任何效果。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.
命令行格式Command-Line Format --no-defaults--no-defaults除了登录文件之外,不从任何配置文件读取默认选项。Do not read default options from any option file other than login file.
--nostart,-n命令行格式Command-Line Format --nostart指示 ndbd 不要自动启动。使用此选项时,ndbd 会连接到管理服务器,从中获取配置数据,并初始化通信对象。然而,它实际上不会启动执行引擎,除非管理服务器特别请求这样做。这可以通过在管理客户端中发出适当的
START命令来完成(参见 第 25.6.1 节,“NDB 集群管理客户端中的命令”)。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 properSTARTcommand in the management client (see Section 25.6.1, “Commands in the NDB Cluster Management Client”).--nowait-nodes=node_id_1[,node_id_2[, ...]]命令行格式Command-Line Format --nowait-nodes=list类型Type 字符串String 默认值Default Value 此选项接受一个数据节点列表,集群在启动之前不会等待这些节点。This option takes a list of data nodes for which the cluster does not wait, prior to starting.
这可以用于以分区状态启动集群。例如,要在一个 4 节点集群中仅启动一半的数据节点(节点 2、3、4 和 5),可以使用 ndbd 进程并加上
--nowait-nodes=3,5参数启动。在这种情况下,一旦节点 2 和 4 连接,集群就会启动,并且 不会 等待节点 3 和 5 按原计划在StartPartitionedTimeout毫秒内连接。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 waitStartPartitionedTimeoutmilliseconds for nodes 3 and 5 to connect as it would otherwise.如果你想像前面的例子一样启动同一个集群,但没有一个 ndbd(例如,节点 3 的主机出现硬件故障),那么可以用
--nowait-nodes=3启动节点 2、4 和 5。然后,当节点 2、4 和 5 连接时,集群就会启动,而不会等待节点 3 启动。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 starts as soon as nodes 2, 4, and 5 connect, and does not wait for node 3 to start.命令行格式Command-Line Format --print-defaults打印程序参数列表然后退出。Print program argument list and exit.
命令行格式Command-Line Format --remove[=name]特定平台Platform Specific 窗口Windows 类型Type 字符串String 默认值Default Value ndbd导致先前作为 Windows 服务安装的 ndbd 进程被移除。可选地,您可以指定要卸载的服务名称;如果未设置,服务名称默认为
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 tondbd.--remove选项在非 Windows 平台上无效果。The--removeoption has no effect on non-Windows platforms.命令行格式Command-Line Format --usage显示帮助文本并退出;同 --help。Display help text and exit; same as --help.
--verbose,-v会在节点日志中写入额外的调试输出。Causes extra debug output to be written to the node log.
您还可以使用
NODELOG DEBUG ON和NODELOG DEBUG OFF在数据节点运行时启用或禁用此额外日志记录。You can also useNODELOG DEBUG ONandNODELOG DEBUG OFFto enable and disable this extra logging while the data node is running.命令行格式Command-Line Format --version显示版本信息并退出。Display version information and exit.
ndbd 会生成一组日志文件,这些文件会被放置在 DataDir 在 config.ini 配置文件中指定的目录下。ndbd generates a set of log files which are
placed in the directory specified by
DataDir in the
config.ini configuration file.
这些日志文件如下列出。node_id 表示节点的唯一标识符。例如,ndb_2_error.log 是由节点 ID 为 2 的数据节点生成的错误日志。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_是一个包含所引用的 ndbd 进程遇到的所有崩溃记录的文件。此文件中的每条记录都包含简短的错误字符串以及指向该崩溃的跟踪文件的引用。该文件中的典型条目可能如下所示:node_id_error.logndb_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***
可以在 ndbd 退出码和数据节点进程异常关闭时生成的信息的列表查看 数据节点错误信息。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.
Important错误日志文件中的最后一条记录不一定是最新的(也很可能不是)。错误日志中的条目 不 按时间顺序列出;它们对应于
ndb_文件中确定的跟踪文件顺序(见下文)。因此,错误日志条目是以循环方式而非顺序方式被覆盖的。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 thenode_id_trace.log.nextndb_file (see below). Error log entries are thus overwritten in a cyclical and not sequential fashion.node_id_trace.log.nextndb_是一个跟踪文件,精确描述了错误发生之前的情况。这些信息对于 NDB Cluster 开发团队的分析非常有用。node_id_trace.log.trace_idndb_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可以配置在覆盖旧文件之前创建的这些跟踪文件的数量。
trace_id是一个数字,每次生成新的跟踪文件时都会递增。It is possible to configure the number of these trace files that are created before old files are overwritten.trace_idis a number which is incremented for each successive trace file.ndb_是用于记录下一个要分配的跟踪文件编号的文件。node_id_trace.log.nextndb_is the file that keeps track of the next trace file number to be assigned.node_id_trace.log.nextndb_是一个包含 ndbd 进程输出的任何数据的文件。只有在 ndbd 作为守护进程启动时才会创建此文件,这是默认行为。node_id_out.logndb_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_是一个文件,包含作为守护进程启动时 ndbd 进程的进程 ID。它还作为锁文件使用,以避免启动具有相同标识符的节点。node_id.pidndb_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_是一个仅在 ndbd 调试版本中使用的文件,在其中可以追踪 ndbd 进程中所有传入、传出和内部消息及其数据。node_id_signal.logndb_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
建议不要使用通过 NFS 挂载的目录,因为在某些环境中,这可能会导致问题,即使进程已经终止,.pid 文件上的锁仍然有效。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.
要启动 ndbd,可能还需要指定管理服务器的主机名以及其监听的端口。可选地,也可以指定进程将使用的节点 ID。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"
有关此问题的更多信息,请参见 第 25.4.3.3 节,“NDB 集群连接字符串”。有关数据节点配置参数的更多信息,请参见 第 25.4.3.6 节,“定义 NDB 集群数据节点”。See Section 25.4.3.3, “NDB Cluster Connection Strings”, for additional information about this issue. For more information about data node configuration parameters, see Section 25.4.3.6, “Defining NDB Cluster Data Nodes”.
当 ndbd 启动时,它实际上会启动两个进程。其中第一个称为 “天使进程”;它唯一的任务是检测执行进程何时完成,然后在配置允许的情况下重新启动 ndbd 进程。因此,如果你尝试使用 Unix 的 kill 命令终止 ndbd,就必须首先终止天使进程,然后再终止另一个进程。终止 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.
执行过程使用一个线程来进行数据的读取、写入和扫描,以及所有其他活动。该线程以异步方式实现,以便可以轻松处理数千个并发操作。此外,一个看门狗线程会监控执行线程,以确保它不会陷入无限循环。一个线程池处理文件 I/O,每个线程可以处理一个打开的文件。线程也可以被 ndbd 进程中的传输器用于传输连接。在执行大量操作(包括更新)的多处理器系统中,如果允许的话,ndbd 进程最多可以消耗 2 个 CPU。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.
对于拥有多个 CPU 的机器,可以使用属于不同节点组的多个 ndbd 进程;然而,这种配置仍被认为是实验性的,并且在生产环境中不支持 MySQL 8.4。请参见 第 25.2.7 节,“NDB Cluster 已知限制”。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.4 in a production setting. See Section 25.2.7, “Known Limitations of NDB Cluster”.