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

MySQL 8.4 参考手册 · 中文镜像

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

打开官方英文原文 ↗

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

MySQL 8.4 参考手册 / 25 MySQL NDB 集群 8.4 / 25.6 NDB Cluster 的管理 / 25.6.5 执行 NDB Cluster 的滚动重启
中文点击中文段落可显示 / 隐藏英文原文本页译文覆盖 100%

25.6.5 执行 NDB 集群的滚动重启25.6.5 Performing a Rolling Restart of an NDB Cluster

本节讨论如何执行 NDB 集群安装的 滚动重启,之所以称为滚动重启,是因为其涉及依次停止和启动(或重启)每个节点,从而使集群本身保持可运行状态。这通常作为 滚动升级 或 滚动降级 的一部分进行,其中集群的高可用性是强制性的,并且整个集群不允许停机。我们在提到升级时,这里提供的信息通常也适用于降级。This section discusses how to perform a rolling restart of an NDB Cluster installation, so called because it involves stopping and starting (or restarting) each node in turn, so that the cluster itself remains operational. This is often done as part of a rolling upgrade or rolling downgrade, where high availability of the cluster is mandatory and no downtime of the cluster as a whole is permissible. Where we refer to upgrades, the information provided here also generally applies to downgrades as well.

滚动重启可能有多种原因。接下来的几段将对此进行描述。There are a number of reasons why a rolling restart might be desirable. These are described in the next few paragraphs.

配置更改。 为更改集群的配置,例如向集群添加 SQL 节点,或将配置参数设置为新值。Configuration change.  To make a change in the cluster's configuration, such as adding an SQL node to the cluster, or setting a configuration parameter to a new value.

NDB 集群软件升级或降级。 将集群升级到较新的 NDB 集群软件版本(或降级到较旧的版本)。这通常被称为 “滚动升级”(或 “滚动降级”,当回退到较旧的 NDB 集群版本时)。NDB Cluster software upgrade or downgrade.  To upgrade the cluster to a newer version of the NDB Cluster software (or to downgrade it to an older version). This is usually referred to as a “rolling upgrade” (or “rolling downgrade”, when reverting to an older version of NDB Cluster).

节点主机更改。 对运行一个或多个 NDB 集群节点进程的硬件或操作系统进行更改。Change on node host.  To make changes in the hardware or operating system on which one or more NDB Cluster node processes are running.

系统重置(集群重置)。 重置集群,因为它已达到不良状态。在这种情况下,通常希望重新加载一个或多个数据节点的数据和元数据。这可以通过三种方式中的任何一种完成:System reset (cluster reset).  To reset the cluster because it has reached an undesirable state. In such cases it is often desirable to reload the data and metadata of one or more data nodes. This can be done in any of three ways:

资源回收。 释放之前通过连续的 INSERT 和 DELETE 操作分配给表的内存,以供其他 NDB Cluster 表重复使用。Resource Recovery.  To free memory previously allocated to a table by successive INSERT and DELETE operations, for re-use by other NDB Cluster tables.

执行滚动重启的过程可以概括如下:The process for performing a rolling restart may be generalized as follows:

  1. 停止所有集群管理节点(ndb_mgmd 进程),重新配置它们,然后重新启动它们。(参见 多个管理服务器的滚动重启。)Stop all cluster management nodes (ndb_mgmd processes), reconfigure them, then restart them. (See Rolling restarts with multiple management servers.)

  2. 依次停止、重新配置并重新启动每个集群数据节点(ndbd 进程)。Stop, reconfigure, then restart each cluster data node (ndbd process) in turn.

    某些节点配置参数可以通过在前一步之后,在 ndb_mgm 客户端中,对每个数据节点执行 RESTART 来更新。其他参数则需要先使用管理客户端的 STOP 命令完全停止数据节点,然后从系统 shell 中启动,调用相应的 ndbd 或 ndbmtd 可执行文件。(在大多数 Unix 系统上,也可以使用类似 kill 的 shell 命令来停止数据节点进程,但推荐使用 STOP 命令,它通常更简单。)Some node configuration parameters can be updated by issuing RESTART for each of the data nodes in the ndb_mgm client following the previous step. Other parameters require that the data node be stopped completely using the management client STOP command, then started again from a system shell by invoking the ndbd or ndbmtd executable as appropriate. (A shell command such as kill can also be used on most Unix systems to stop a data node process, but the STOP command is preferred and usually simpler.)

    Note

    在 Windows 上,你也可以使用 SC STOP 和 SC START 命令,NET STOP 和 NET START 命令,或者使用 Windows 服务管理器来停止和启动已作为 Windows 服务安装的节点(见 第 25.3.2.4 节,“将 NDB 集群进程安装为 Windows 服务”)。On Windows, you can also use SC STOP and SC START commands, NET STOP and NET START commands, or the Windows Service Manager to stop and start nodes which have been installed as Windows services (see Section 25.3.2.4, “Installing NDB Cluster Processes as Windows Services”).

    所需的重启类型在每个节点配置参数的文档中有说明。请参见 第 25.4.3 节,“NDB 集群配置文件”。The type of restart required is indicated in the documentation for each node configuration parameter. See Section 25.4.3, “NDB Cluster Configuration Files”.

  3. 停止、重新配置,然后依次重启每个集群 SQL 节点(mysqld 进程)。Stop, reconfigure, then restart each cluster SQL node (mysqld process) in turn.

NDB 集群支持升级节点时的顺序有一定灵活性。在升级 NDB 集群时,您可以在升级管理节点、数据节点或两者之前升级 API 节点(包括 SQL 节点)。换句话说,您可以按任意顺序升级 API 和 SQL 节点。但需遵守以下规定:NDB Cluster supports a somewhat flexible order for upgrading nodes. When upgrading an NDB Cluster, you may upgrade API nodes (including SQL nodes) before upgrading the management nodes, data nodes, or both. In other words, you are permitted to upgrade the API and SQL nodes in any order. This is subject to the following provisions:

  • 此功能仅用于在线升级。不同 NDB 集群版本的节点二进制文件混合使用,并不适用于生产环境中的持续、长期使用,也不受支持。This functionality is intended for use as part of an online upgrade only. A mix of node binaries from different NDB Cluster releases is neither intended nor supported for continuous, long-term use in a production setting.

  • 在升级不同类型的节点之前,必须先升级同类型的所有节点(管理节点、数据节点或 API 节点)。无论节点的升级顺序如何,这一点都成立。You must upgrade all nodes of the same type (management, data, or API node) before upgrading any nodes of a different type. This remains true regardless of the order in which the nodes are upgraded.

  • 在升级任何数据节点之前,必须先升级所有管理节点。无论您升级集群的 API 和 SQL 节点的顺序如何,这一点都成立。You must upgrade all management nodes before upgrading any data nodes. This remains true regardless of the order in which you upgrade the cluster's API and SQL nodes.

  • Features specific to the “新” version must not be used until all management nodes and data nodes have been upgraded.Features specific to the “new” version must not be used until all management nodes and data nodes have been upgraded.

    这也适用于任何可能涉及的 MySQL 服务器版本更改,以及 NDB 引擎版本更改,因此在规划升级时不要忘记考虑这一点。(这对于 NDB 集群的在线升级通常都是适用的。)This also applies to any MySQL Server version change that may apply, in addition to the NDB engine version change, so do not forget to take this into account when planning the upgrade. (This is true for online upgrades of NDB Cluster in general.)

在节点重启期间,任何 API 节点都无法执行模式操作(如数据定义语句)。部分由于这一限制,在在线升级或降级期间也不支持模式操作。此外,在升级或降级进行时,不可能执行本地备份。It is not possible for any API node to perform schema operations (such as data definition statements) during a node restart. Due in part to this limitation, schema operations are also not supported during an online upgrade or downgrade. In addition, it is not possible to perform native backups while an upgrade or downgrade is ongoing.

使用多个管理服务器进行滚动重启。 在对具有多个管理节点的 NDB 集群执行滚动重启时,您应记住,ndb_mgmd 会检查是否有其他管理节点正在运行,如果有,它会尝试使用该节点的配置数据。为了防止这种情况发生,并强制 ndb_mgmd 重新读取其配置文件,请执行以下步骤:Rolling restarts with multiple management servers.  When performing a rolling restart of an NDB Cluster with multiple management nodes, you should keep in mind that ndb_mgmd checks to see if any other management node is running, and, if so, tries to use that node's configuration data. To keep this from occurring, and to force ndb_mgmd to re-read its configuration file, perform the following steps:

  1. 停止所有 NDB Cluster ndb_mgmd 进程。Stop all NDB Cluster ndb_mgmd processes.

  2. 更新所有 config.ini 文件。Update all config.ini files.

  3. 使用 --reload、--initial 或所需的两个选项之一启动一个 ndb_mgmd 实例。Start a single ndb_mgmd with --reload, --initial, or both options as desired.

  4. 如果你使用 ndb_mgmd 的 --initial 选项启动了第一个进程,那么你必须也使用 --initial 启动其余的所有 ndb_mgmd 进程。If you started the first ndb_mgmd with the --initial option, you must also start any remaining ndb_mgmd processes using --initial.

    无论在启动第一个 ndb_mgmd 时使用了哪些其他选项,都不应在使用 --reload 启动第一个之后,再启动剩余的 ndb_mgmd 进程。Regardless of any other options used when starting the first ndb_mgmd, you should not start any remaining ndb_mgmd processes after the first one using --reload.

  5. 按照正常流程完成数据节点和 API 节点的滚动重启。Complete the rolling restarts of the data nodes and API nodes as normal.

在执行滚动重启以更新集群配置时,可以使用 ndbinfo.nodes 表的 config_generation 列来跟踪哪些数据节点已成功使用新配置重启。请参阅 第 25.6.15.48 节,“ndbinfo nodes 表”。When performing a rolling restart to update the cluster's configuration, you can use the config_generation column of the ndbinfo.nodes table to keep track of which data nodes have been successfully restarted with the new configuration. See Section 25.6.15.48, “The ndbinfo nodes Table”.