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

MySQL 8.4 参考手册 · 中文镜像

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

打开官方英文原文 ↗

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

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

25.6 NDB 集群管理25.6 Management of NDB Cluster

管理 NDB 集群涉及许多任务,其中第一个任务是配置并启动 NDB 集群。这在第 25.4 节,“NDB 集群配置”和第 25.5 节,“NDB 集群程序”中有所介绍。Managing an NDB Cluster involves a number of tasks, the first of which is to configure and start NDB Cluster. This is covered in Section 25.4, “Configuration of NDB Cluster”, and Section 25.5, “NDB Cluster Programs”.

接下来的几个部分涵盖了正在运行的 NDB 集群的管理。The next few sections cover the management of a running NDB Cluster.

有关管理和部署 NDB 集群相关的安全问题的一般信息,请参见 第 25.6.19 节,“NDB 集群安全”。有关加密文件系统和 NDB 的信息,请参见 第 25.6.19.4 节,“NDB 集群的文件系统加密”。第 25.6.19.5 节,“NDB 集群的 TLS 链接加密”,提供了有关节点之间加密连接支持的信息。NDB 集群还支持加密备份,许多 NDB 命令行程序都可以读取这些备份,包括 ndb_restore、ndbxfrm、ndb_print_backup_file 和 ndb_mgm。有关更多信息,请参见 第 25.6.8.2 节,“使用 NDB 集群管理客户端创建备份”。For general information about security issues relating to management and deployment of an NDB Cluster, see Section 25.6.19, “NDB Cluster Security”. For information about encrypted file systems and NDB, see Section 25.6.19.4, “File System Encryption for NDB Cluster”. Section 25.6.19.5, “TLS Link Encryption for NDB Cluster”, provides information about support for encrypted connections between nodes. NDB Cluster also supports encrypted backups which can be read by many NDB command-line programs including ndb_restore, ndbxfrm, ndb_print_backup_file, and ndb_mgm. See Section 25.6.8.2, “Using The NDB Cluster Management Client to Create a Backup”, for more information.

本质上,有两种方法可以主动管理正在运行的 NDB 集群。第一种方法是通过在管理客户端中输入命令来进行管理,可以检查集群状态、改变日志级别、启动和停止备份,以及停止和启动节点。第二种方法是研究集群日志 ndb_node_id_cluster.log 的内容;该日志通常位于管理服务器的 DataDir 目录中,但可以使用 LogDestination 选项覆盖此位置。(请记住,node_id 表示正在记录其活动的节点的唯一标识符。)集群日志包含 ndbd 生成的事件报告。也可以将集群日志条目发送到 Unix 系统日志。There are essentially two methods of actively managing a running NDB Cluster. The first of these is through the use of commands entered into the management client whereby cluster status can be checked, log levels changed, backups started and stopped, and nodes stopped and started. The second method involves studying the contents of the cluster log ndb_node_id_cluster.log; this is usually found in the management server's DataDir directory, but this location can be overridden using the LogDestination option. (Recall that node_id represents the unique identifier of the node whose activity is being logged.) The cluster log contains event reports generated by ndbd. It is also possible to send cluster log entries to a Unix system log.

群集操作的一些方面也可以通过 SQL 节点使用 SHOW ENGINE NDB STATUS 语句进行监控。Some aspects of the cluster's operation can be also be monitored from an SQL node using the SHOW ENGINE NDB STATUS statement.

有关 NDB Cluster 操作的更详细信息,可以通过使用 ndbinfo 数据库的 SQL 接口实时获得。更多信息,请参见 第 25.6.15 节,“ndbinfo: NDB Cluster 信息数据库”。More detailed information about NDB Cluster operations is available in real time through an SQL interface using the ndbinfo database. For more information, see Section 25.6.15, “ndbinfo: The NDB Cluster Information Database”.

NDB 统计计数器使用 mysql 客户端提供改进的监控。这些计数器在 NDB 内核中实现,涉及由或影响 Ndb 对象执行的操作,例如启动、关闭和中止事务;主键和唯一键操作;表、范围和修剪扫描;等待各类操作完成的阻塞线程;以及 NDB 集群发送和接收的数据和事件。每当进行 NDB API 调用或数据发送到或接收自数据节点时,NDB 内核会增加这些计数器的值。NDB statistics counters provide improved monitoring using the mysql client. These counters, implemented in the NDB kernel, relate to operations performed by or affecting Ndb objects, such as starting, closing, and aborting transactions; primary key and unique key operations; table, range, and pruned scans; blocked threads waiting for various operations to complete; and data and events sent and received by NDB Cluster. The counters are incremented by the NDB kernel whenever NDB API calls are made or data is sent to or received by the data nodes.

mysqld 将 NDB API 统计计数器作为系统状态变量暴露,这些变量可以通过它们名称的公共前缀 (Ndb_api_) 来识别。这些变量的值可以通过 mysql 客户端中的 SHOW STATUS 语句输出读取,或者通过查询 Performance Schema 的 session_status 或 global_status 表来获取。通过比较执行针对 NDB 表的 SQL 语句前后的状态变量值,可以观察与该语句对应的 NDB API 层级的操作,这对 NDB 集群的监控和性能调优非常有益。mysqld exposes the NDB API statistics counters as system status variables, which can be identified from the prefix common to all of their names (Ndb_api_). The values of these variables can be read in the mysql client from the output of a SHOW STATUS statement, or by querying either the Performance Schema session_status or global_status table. By comparing the values of the status variables before and after the execution of an SQL statement that acts on NDB tables, you can observe the actions taken on the NDB API level that correspond to this statement, which can be beneficial for monitoring and performance tuning of NDB Cluster.

MySQL 集群管理器提供了一个高级命令行界面,可以简化许多原本复杂的 NDB 集群管理任务,例如启动、停止或重启具有大量节点的 NDB 集群。MySQL 集群管理器客户端还支持获取和设置大多数节点配置参数的值,以及与 NDB 集群相关的 mysqld 服务器选项和变量。更多信息请参见 MySQL Cluster Manager 8.4.9 用户手册。MySQL Cluster Manager provides an advanced command-line interface that simplifies many otherwise complex NDB Cluster management tasks, such as starting, stopping, or restarting an NDB Cluster with a large number of nodes. The MySQL Cluster Manager client also supports commands for getting and setting the values of most node configuration parameters as well as mysqld server options and variables relating to NDB Cluster. See MySQL Cluster Manager 8.4.9 User Manual, for more information.