8.4 中文镜像

MySQL 8.4 参考手册 · 中文镜像

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

打开官方英文原文 ↗

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

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

25.3.4 NDB 集群的初始启动25.3.4 Initial Startup of NDB Cluster

在集群配置完成后,启动集群并不困难。每个集群节点进程必须单独启动,并且在其所在的主机上启动。管理节点应首先启动,然后是数据节点,最后是任何 SQL 节点:Starting the cluster is not very difficult after it has been configured. Each cluster node process must be started separately, and on the host where it resides. The management node should be started first, followed by the data nodes, and then finally by any SQL nodes:

  1. 在管理主机上,从系统 shell 发出以下命令以启动管理节点进程:On the management host, issue the following command from the system shell to start the management node process:

    $> ndb_mgmd --initial -f /var/lib/mysql-cluster/config.ini
    

    第一次启动时,ndb_mgmd 必须通过 -f 或 --config-file 选项指定其配置文件的位置。此选项要求同时指定 --initial 或 --reload;有关详细信息,请参阅 第 25.5.4 节,“ndb_mgmd — NDB 集群管理服务器守护进程”。The first time that it is started, ndb_mgmd must be told where to find its configuration file, using the -f or --config-file option. This option requires that --initial or --reload also be specified; see Section 25.5.4, “ndb_mgmd — The NDB Cluster Management Server Daemon”, for details.

  2. 在每个数据节点主机上,运行此命令以启动 ndbd 进程:On each of the data node hosts, run this command to start the ndbd process:

    $> ndbd
    
  3. 如果您使用 RPM 文件在 SQL 节点所在的集群主机上安装了 MySQL,您可以(并且应该)使用提供的启动脚本来启动 SQL 节点上的 MySQL 服务器进程。If you used RPM files to install MySQL on the cluster host where the SQL node is to reside, you can (and should) use the supplied startup script to start the MySQL server process on the SQL node.

如果一切顺利,并且集群已正确设置,集群现在应该可以正常运行。您可以通过调用 ndb_mgm 管理节点客户端来测试。输出应类似于这里所示的内容,尽管根据您使用的 MySQL 的具体版本,输出可能会有一些细微差别:If all has gone well, and the cluster has been set up correctly, the cluster should now be operational. You can test this by invoking the ndb_mgm management node client. The output should look like that shown here, although you might see some slight differences in the output depending upon the exact version of MySQL that you are using:

$> ndb_mgm
-- NDB Cluster -- Management Client --
ndb_mgm> SHOW
Connected to Management Server at: localhost:1186 (using cleartext)
Cluster Configuration
---------------------
[ndbd(NDB)]     2 node(s)
id=2    @198.51.100.30  (Version: 8.4.7-ndb-8.4.7, Nodegroup: 0, *)
id=3    @198.51.100.40  (Version: 8.4.7-ndb-8.4.7, Nodegroup: 0)

[ndb_mgmd(MGM)] 1 node(s)
id=1    @198.51.100.10  (Version: 8.4.7-ndb-8.4.7)

[mysqld(API)]   1 node(s)
id=4    @198.51.100.20  (Version: 8.4.7-ndb-8.4.7)

这里将 SQL 节点引用为 [mysqld(API)],这反映了 mysqld 进程作为 NDB Cluster API 节点运行的事实。The SQL node is referenced here as [mysqld(API)], which reflects the fact that the mysqld process is acting as an NDB Cluster API node.

Note

在 SHOW 输出中显示的某个 NDB Cluster SQL 或其他 API 节点的 IP 地址,是 SQL 或 API 节点用于连接集群数据节点的地址,而不是用于连接任何管理节点的地址。The IP address shown for a given NDB Cluster SQL or other API node in the output of SHOW is the address used by the SQL or API node to connect to the cluster data nodes, and not to any management node.

现在你应该可以开始使用 NDB Cluster 中的数据库、表和数据。参见 第 25.3.5 节,“NDB Cluster 表和数据示例”,了解简要讨论。You should now be ready to work with databases, tables, and data in NDB Cluster. See Section 25.3.5, “NDB Cluster Example with Tables and Data”, for a brief discussion.