- 25.4.3.1 NDB 集群配置:基本示例25.4.3.1 NDB Cluster Configuration: Basic Example
- 25.4.3.2 NDB 集群推荐的初始配置25.4.3.2 Recommended Starting Configuration for NDB Cluster
- 25.4.3.3 NDB 集群连接字符串25.4.3.3 NDB Cluster Connection Strings
- 25.4.3.4 在 NDB 集群中定义计算机25.4.3.4 Defining Computers in an NDB Cluster
- 25.4.3.5 定义 NDB 集群管理服务器25.4.3.5 Defining an NDB Cluster Management Server
- 25.4.3.6 定义 NDB 集群数据节点25.4.3.6 Defining NDB Cluster Data Nodes
- 25.4.3.7 在 NDB 集群中定义 SQL 和其他 API 节点25.4.3.7 Defining SQL and Other API Nodes in an NDB Cluster
- 25.4.3.8 定义系统25.4.3.8 Defining the System
- 25.4.3.9 NDB 集群的 MySQL 服务器选项和变量25.4.3.9 MySQL Server Options and Variables for NDB Cluster
- 25.4.3.10 NDB 集群 TCP/IP 连接25.4.3.10 NDB Cluster TCP/IP Connections
- 25.4.3.11 使用直接连接的 NDB 集群 TCP/IP 连接25.4.3.11 NDB Cluster TCP/IP Connections Using Direct Connections
- 25.4.3.12 NDB 集群共享内存连接25.4.3.12 NDB Cluster Shared-Memory Connections
- 25.4.3.13 数据节点内存管理25.4.3.13 Data Node Memory Management
- 25.4.3.14 配置 NDB 集群发送缓冲区参数25.4.3.14 Configuring NDB Cluster Send Buffer Parameters
配置 NDB 集群需要处理两个文件:Configuring NDB Cluster requires working with two files:
my.cnf:为所有 NDB 集群可执行文件指定选项。您应该熟悉此文件,这是因为之前使用 MySQL 时会接触到,每个在集群中运行的可执行文件都必须能够访问此文件。my.cnf: Specifies options for all NDB Cluster executables. This file, with which you should be familiar with from previous work with MySQL, must be accessible by each executable running in the cluster.config.ini:此文件,有时也称为全局配置文件,仅由 NDB 集群管理服务器读取,然后将其中包含的信息分发给参与集群的所有进程。config.ini包含集群中每个节点的描述。这包括数据节点的配置参数以及集群中所有节点之间连接的配置参数。如需快速参考此文件中可能出现的各个部分,以及每个部分中可能放置的配置参数类型,请参见config.ini文件的各个部分。config.ini: This file, sometimes known as the global configuration file, is read only by the NDB Cluster management server, which then distributes the information contained therein to all processes participating in the cluster.config.inicontains a description of each node involved in the cluster. This includes configuration parameters for data nodes and configuration parameters for connections between all nodes in the cluster. For a quick reference to the sections that can appear in this file, and what sorts of configuration parameters may be placed in each section, see Sections of theconfig.iniFile.
配置数据的缓存。 NDB 使用 有状态配置。管理服务器每次重启时不会读取全局配置文件,而是在第一次启动时缓存配置文件,并且此后只有在以下条件之一成立时才会读取全局配置文件:Caching of configuration data.
NDB uses stateful
configuration. Rather than reading the global
configuration file every time the management server is
restarted, the management server caches the configuration the
first time it is started, and thereafter, the global
configuration file is read only when one of the following
conditions is true:
使用 --initial 选项启动管理服务器。 当使用
--initial时,全局配置文件将被重新读取,任何现有的缓存文件将被删除,管理服务器创建一个新的配置缓存。The management server is started using the --initial option. When--initialis used, the global configuration file is re-read, any existing cache files are deleted, and the management server creates a new configuration cache.管理服务器使用 --reload 选项启动。
--reload选项使管理服务器将其缓存与全局配置文件进行比较。如果它们不同,管理服务器将创建新的配置缓存;任何现有的配置缓存都会被保留,但不会使用。如果管理服务器的缓存与全局配置文件包含相同的配置数据,则使用现有缓存,不会创建新的缓存。The management server is started using the --reload option. The--reloadoption causes the management server to compare its cache with the global configuration file. If they differ, the management server creates a new configuration cache; any existing configuration cache is preserved, but not used. If the management server's cache and the global configuration file contain the same configuration data, then the existing cache is used, and no new cache is created.管理服务器使用 --config-cache=FALSE 启动。 这会禁用
--config-cache(默认启用),并可用于强制管理服务器完全绕过配置缓存。在这种情况下,管理服务器会忽略可能存在的任何配置文件,总是从config.ini文件中读取其配置信息。The management server is started using --config-cache=FALSE. This disables--config-cache(enabled by default), and can be used to force the management server to bypass configuration caching altogether. In this case, the management server ignores any configuration files that may be present, always reading its configuration data from theconfig.inifile instead.未找到配置缓存。 在这种情况下,管理服务器读取全局配置文件,并创建一个缓存,其中包含与文件中相同的配置信息。No configuration cache is found. In this case, the management server reads the global configuration file and creates a cache containing the same configuration data as found in the file.
配置缓存文件。 管理服务器默认会在 MySQL 安装目录下创建名为 mysql-cluster 的配置缓存文件目录。(如果在 Unix 系统上从源码构建 NDB Cluster,默认位置是 /usr/local/mysql-cluster。)可以通过在运行时使用 --configdir 选项启动管理服务器来覆盖此设置。配置缓存文件是二进制文件,其命名模式为 ndb_,其中 node_id_config.bin.seq_idnode_id 是管理服务器在集群中的节点 ID,seq_id 是缓存标识符。缓存文件按创建顺序使用 seq_id 连续编号。管理服务器使用由 seq_id 确定的最新缓存文件。Configuration cache files.
The management server by default creates configuration cache
files in a directory named mysql-cluster in
the MySQL installation directory. (If you build NDB Cluster from
source on a Unix system, the default location is
/usr/local/mysql-cluster.) This can be
overridden at runtime by starting the management server with the
--configdir option.
Configuration cache files are binary files named according to
the pattern
ndb_,
where node_id_config.bin.seq_idnode_id is the management
server's node ID in the cluster, and
seq_id is a cache identifier. Cache
files are numbered sequentially using
seq_id, in the order in which they
are created. The management server uses the latest cache file as
determined by the seq_id.
可以通过删除后续的配置缓存文件,或者通过重命名较早的缓存文件使其具有更高的seq_id来回滚到先前的配置。但是,由于配置缓存文件是以二进制格式编写的,您不应尝试手动编辑其内容。It is possible to roll back to a previous configuration by
deleting later configuration cache files, or by renaming an
earlier cache file so that it has a higher
seq_id. However, since configuration
cache files are written in a binary format, you should not
attempt to edit their contents by hand.
有关 NDB 集群管理服务器的 --configdir、--config-cache、--initial 和 --reload 选项的更多信息,请参见 第 25.5.4 节,“ndb_mgmd — NDB 集群管理服务器守护进程”。For more information about the
--configdir,
--config-cache,
--initial, and
--reload options for the NDB
Cluster management server, see
Section 25.5.4, “ndb_mgmd — The NDB Cluster Management Server Daemon”.
我们正在不断改进 NDB Cluster 配置,并尝试简化此过程。尽管我们努力保持向后兼容性,但有时可能会引入不兼容的更改。在这种情况下,如果某个更改不向后兼容,我们会尽量提前通知 NDB Cluster 用户。如果您发现了这样的更改,而我们尚未记录,请按照 第 1.6 节,“如何报告错误或问题” 中的说明,在 MySQL 错误数据库中报告。We are continuously making improvements in NDB Cluster configuration and attempting to simplify this process. Although we strive to maintain backward compatibility, there may be times when introduce an incompatible change. In such cases we try to let NDB Cluster users know in advance if a change is not backward compatible. If you find such a change and we have not documented it, please report it in the MySQL bugs database using the instructions given in Section 1.6, “How to Report Bugs or Problems”.