文档首页
MySQL 8.4 参考手册
8.4 中文镜像

MySQL 8.4 参考手册 · 中文镜像

正文为中文,英文原文默认隐藏。点击任意中文段落即可展开 / 收起对应英文原文。

打开官方英文原文 ↗

译文由机器翻译生成,仅供理解参考;有疑问请以官方英文原文为准。

中文点击中文段落可显示 / 隐藏英文原文本页译文覆盖 100%

25.6.4 NDB 集群启动阶段摘要25.6.4 Summary of NDB Cluster Start Phases

本节提供了启动 NDB 集群数据节点时所涉及步骤的简化概述。更完整的信息可以在 NDB 集群启动阶段中找到,该内容位于 NDB 内部指南 中。This section provides a simplified outline of the steps involved when NDB Cluster data nodes are started. More complete information can be found in NDB Cluster Start Phases, in the NDB Internals Guide.

这些阶段与管理客户端中 node_id STATUS 命令输出中报告的相同(参见 第 25.6.1 节,“NDB Cluster 管理客户端中的命令”)。这些启动阶段也在 ndbinfo.nodes 表的 start_phase 列中报告。These phases are the same as those reported in the output from the node_id STATUS command in the management client (see Section 25.6.1, “Commands in the NDB Cluster Management Client”). These start phases are also reported in the start_phase column of the ndbinfo.nodes table.

启动类型。 有几种不同的启动类型和模式,如下列清单所示:Start types.  There are several different startup types and modes, as shown in the following list:

  • 初始启动。 集群在所有数据节点上以干净的文件系统开始。这发生在集群首次启动时,或所有数据节点使用 --initial 选项重启时。Initial start.  The cluster starts with a clean file system on all data nodes. This occurs either when the cluster started for the very first time, or when all data nodes are restarted using the --initial option.

    Note

    使用 --initial 重启节点时,磁盘数据文件不会被删除。Disk Data files are not removed when restarting a node using --initial.

  • 系统重启。 集群启动并读取存储在数据节点中的数据。这发生在集群在使用后已关闭、并希望集群从之前停止的点继续操作时。System restart.  The cluster starts and reads data stored in the data nodes. This occurs when the cluster has been shut down after having been in use, when it is desired for the cluster to resume operations from the point where it left off.

  • 节点重启。 这是在集群本身运行时对集群节点进行的在线重启。Node restart.  This is the online restart of a cluster node while the cluster itself is running.

  • 初始节点重启。 这与节点重启相同,只是节点会重新初始化并在干净的文件系统上启动。Initial node restart.  This is the same as a node restart, except that the node is reinitialized and started with a clean file system.

设置和初始化(阶段 -1)。 在启动之前,每个数据节点(ndbd 进程)必须进行初始化。初始化包括以下步骤:Setup and initialization (phase -1).  Prior to startup, each data node (ndbd process) must be initialized. Initialization consists of the following steps:

  1. 获取节点 IDObtain a node ID

  2. 获取配置数据Fetch configuration data

  3. 分配用于节点间通信的端口Allocate ports to be used for inter-node communications

  4. 根据从配置文件获取的设置分配内存Allocate memory according to settings obtained from the configuration file

当数据节点或 SQL 节点首次连接到管理节点时,它会保留一个集群节点 ID。为了确保没有其他节点分配相同的节点 ID,该 ID 会被保留,直到节点成功连接到集群并且至少有一个 ndbd 报告该节点已连接。节点 ID 的保留由该节点与 ndb_mgmd 之间的连接来保护。When a data node or SQL node first connects to the management node, it reserves a cluster node ID. To make sure that no other node allocates the same node ID, this ID is retained until the node has managed to connect to the cluster and at least one ndbd reports that this node is connected. This retention of the node ID is guarded by the connection between the node in question and ndb_mgmd.

在每个数据节点初始化完成后,集群启动过程可以继续。集群在此过程中经历的阶段列在此处:After each data node has been initialized, the cluster startup process can proceed. The stages which the cluster goes through during this process are listed here:

  • 阶段 0. NDBFS 和 NDBCNTR 块启动。在那些使用 --initial 选项启动的数据节点上,数据节点文件系统会被清空。Phase 0.  The NDBFS and NDBCNTR blocks start. Data node file systems are cleared on those data nodes that were started with --initial option.

  • 阶段 1. 在此阶段,所有剩余的 NDB 内核块都会启动。NDB Cluster 连接会建立,块间通信会启动,并且心跳信号会开始。在节点重启的情况下,API 节点连接也会被检查。Phase 1.  In this stage, all remaining NDB kernel blocks are started. NDB Cluster connections are set up, inter-block communications are established, and heartbeats are started. In the case of a node restart, API node connections are also checked.

    Note

    当一个或多个节点在阶段 1 挂起,而其余节点在阶段 2 挂起时,这通常表示网络问题。这类问题的一个可能原因是一个或多个集群主机具有多个网络接口。导致这种情况的另一个常见问题来源是阻塞了集群节点之间通信所需的 TCP/IP 端口。在后一种情况下,这通常是由于防火墙配置错误造成的。When one or more nodes hang in Phase 1 while the remaining node or nodes hang in Phase 2, this often indicates network problems. One possible cause of such issues is one or more cluster hosts having multiple network interfaces. Another common source of problems causing this condition is the blocking of TCP/IP ports needed for communications between cluster nodes. In the latter case, this is often due to a misconfigured firewall.

  • 阶段 2. NDBCNTR 内核块检查所有现有节点的状态。选择主节点,并初始化集群模式文件。Phase 2.  The NDBCNTR kernel block checks the states of all existing nodes. The master node is chosen, and the cluster schema file is initialized.

  • 阶段 3. DBLQH 和 DBTC 内核模块建立它们之间的通信。启动类型被确定;如果这是重启,DBDIH 模块获得执行重启的权限。Phase 3.  The DBLQH and DBTC kernel blocks set up communications between them. The startup type is determined; if this is a restart, the DBDIH block obtains permission to perform the restart.

  • 阶段 4. 对于初始启动或节点初始重启,会创建重做日志文件。这些文件的数量等于 NoOfFragmentLogFiles。Phase 4.  For an initial start or initial node restart, the redo log files are created. The number of these files is equal to NoOfFragmentLogFiles.

    对于系统重启:For a system restart:

    • 读取模式或模式集合。Read schema or schemas.

    • 从本地检查点读取数据。Read data from the local checkpoint.

    • 应用所有重做信息,直到到达最新可恢复的全局检查点。Apply all redo information until the latest restorable global checkpoint has been reached.

    对于节点重启,找到重做日志的末尾。For a node restart, find the tail of the redo log.

  • 阶段 5。 数据节点启动的大部分与数据库相关的部分在此阶段执行。对于初次启动或系统重启,将执行本地检查点,然后是全局检查点。在此阶段开始定期检查内存使用情况,并执行任何必要的节点接管操作。Phase 5.  Most of the database-related portion of a data node start is performed during this phase. For an initial start or system restart, a local checkpoint is executed, followed by a global checkpoint. Periodic checks of memory usage begin during this phase, and any required node takeovers are performed.

  • 阶段 6。 在此阶段,定义并设置节点组。Phase 6.  In this phase, node groups are defined and set up.

  • 第 7 阶段。 仲裁节点被选中并开始运行。下一备份 ID 被设置,同时设置备份磁盘写入速度。到达此启动阶段的节点会被标记为 Started。现在 API 节点(包括 SQL 节点)可以连接到集群。Phase 7.  The arbitrator node is selected and begins to function. The next backup ID is set, as is the backup disk write speed. Nodes reaching this start phase are marked as Started. It is now possible for API nodes (including SQL nodes) to connect to the cluster.

  • 第 8 阶段。 如果这是系统重启,所有索引都会被重建(由 DBDIH)。Phase 8.  If this is a system restart, all indexes are rebuilt (by DBDIH).

  • 第 9 阶段。 节点内部启动变量被重置。Phase 9.  The node internal startup variables are reset.

  • 第 100 阶段(已废弃)。 以前,在节点重启或初始节点重启时,API 节点可以连接到节点并开始接收事件。当前,此阶段为空。Phase 100 (OBSOLETE).  Formerly, it was at this point during a node restart or initial node restart that API nodes could connect to the node and begin to receive events. Currently, this phase is empty.

  • 阶段 101. 在节点重启或初始节点重启的此阶段,事件交付会移交给加入集群的节点。新加入的节点负责将其主数据传递给订阅者。这个阶段也被称为 SUMA 移交阶段。Phase 101.  At this point in a node restart or initial node restart, event delivery is handed over to the node joining the cluster. The newly-joined node takes over responsibility for delivering its primary data to subscribers. This phase is also referred to as SUMA handover phase.

对于初始启动或系统重启,在此过程完成后,事务处理将被启用。对于节点重启或初始节点重启,启动过程完成意味着该节点现在可以充当事务协调器。After this process is completed for an initial start or system restart, transaction handling is enabled. For a node restart or initial node restart, completion of the startup process means that the node may now act as a transaction coordinator.