【博客文章2024】MySQL NDB Cluster在RHEL8系统中最便捷的安装和运行方法
Author: Bo Tang
1. 要安装的环境和架构:
要安装的环境是一套共有7个节点的MySQL NDB Cluster 8.0.36环境。其中的Mgmt节点是node0.example.com。 Data节点是node3.example.com/node4.example.com/node5.example.com/node6.example.com。 Sql节点是node1.example.com和node2.example.com。 所有节点的操作系统都是RedHat Linux8.3(4.18.0-240.el8.x86_64 #1 SMP Wed Sep 23 05:13:10 EDT 2020 x86_64 x86_64 x86_64 GNU/Linux)。
2. 下载NDB Cluster 8.0.36的rpm安装包,在RHEL8上制作yum安装源:
NDB Cluster的rpm包集(mysql-cluster-community-8.0.36-1.el8.x86_64.rpm-bundle.tar)可以从https://dev.mysql.com/downloads/cluster/下载:
准备一个目录,将下载的mysql-cluster-community-8.0.36-1.el8.x86_64.rpm-bundle.tar在其中解压缩:
[root@node0 ~]# mkdir mysql-cluster [root@node0 ~]# tar -C ./mysql-cluster/ -xvf /root/下载/mysql-cluster-community-8.0.36-1.el8.x86_64.rpm-bundle.tar mysql-cluster-community-client-8.0.36-1.el8.x86_64.rpm mysql-cluster-community-client-debuginfo-8.0.36-1.el8.x86_64.rpm mysql-cluster-community-client-plugins-8.0.36-1.el8.x86_64.rpm mysql-cluster-community-client-plugins-debuginfo-8.0.36-1.el8.x86_64.rpm mysql-cluster-community-common-8.0.36-1.el8.x86_64.rpm mysql-cluster-community-data-node-8.0.36-1.el8.x86_64.rpm mysql-cluster-community-data-node-debuginfo-8.0.36-1.el8.x86_64.rpm mysql-cluster-community-debuginfo-8.0.36-1.el8.x86_64.rpm mysql-cluster-community-debugsource-8.0.36-1.el8.x86_64.rpm mysql-cluster-community-devel-8.0.36-1.el8.x86_64.rpm mysql-cluster-community-icu-data-files-8.0.36-1.el8.x86_64.rpm mysql-cluster-community-java-8.0.36-1.el8.x86_64.rpm mysql-cluster-community-libs-8.0.36-1.el8.x86_64.rpm mysql-cluster-community-libs-debuginfo-8.0.36-1.el8.x86_64.rpm mysql-cluster-community-management-server-8.0.36-1.el8.x86_64.rpm mysql-cluster-community-management-server-debuginfo-8.0.36-1.el8.x86_64.rpm mysql-cluster-community-ndbclient-8.0.36-1.el8.x86_64.rpm mysql-cluster-community-ndbclient-debuginfo-8.0.36-1.el8.x86_64.rpm mysql-cluster-community-ndbclient-devel-8.0.36-1.el8.x86_64.rpm mysql-cluster-community-nodejs-8.0.36-1.el8.x86_64.rpm mysql-cluster-community-nodejs-debuginfo-8.0.36-1.el8.x86_64.rpm mysql-cluster-community-server-8.0.36-1.el8.x86_64.rpm mysql-cluster-community-server-debug-8.0.36-1.el8.x86_64.rpm mysql-cluster-community-server-debug-debuginfo-8.0.36-1.el8.x86_64.rpm mysql-cluster-community-server-debuginfo-8.0.36-1.el8.x86_64.rpm mysql-cluster-community-test-8.0.36-1.el8.x86_64.rpm mysql-cluster-community-test-debuginfo-8.0.36-1.el8.x86_64.rpm
|
2.1 Mgmt节点的安装: mysql-cluster-community-8.0.36-1.el8.x86_64.rpm-bundle.tar中的mysql-cluster-community-management-server-8.0.36-1.el8.x86_64.rpm要安装于Mgmt节点,用于提供ndb_mgmd后台进程。 ndb_mgm这个客户端程序一般也需要安装在Mgmt节点,用于管理ndb_mgmd。ndb_mgm由mysql-cluster-community-client-8.0.36-1.el8.x86_64.rpm和mysql-cluster-community-client-plugins-8.0.36-1.el8.x86_64.rpm提供。 以上3个包所公共依赖的mysql-cluster-community-common-8.0.36-1.el8.x86_64.rpm和mysql-cluster-community-libs-8.0.36-1.el8.x86_64.rpm也需要拷贝到Mgmt节点。而所有包含debuginfo/debugsource名字的包,都是debug用途的,可以不安装;所有包含devel名字的包,都是开发用途的,也可以不安装。所有包含test名字的包,都是测试用途的,也可以不安装。 在Mgmt节点上,准备一个目录存放上面提到的5个包: [root@node0 ~]# mkdir mgmt-node [root@node0 mysql-cluster]# cp mysql-cluster-community-client-8.0.36-1.el8.x86_64.rpm mysql-cluster-community-client-plugins-8.0.36-1.el8.x86_64.rpm mysql-cluster-community-management-server-8.0.36-1.el8.x86_64.rpm mysql-cluster-community-common-8.0.36-1.el8.x86_64.rpm mysql-cluster-community-libs-8.0.36-1.el8.x86_64.rpm ../mgmt-node/
|
在Mgmt节点上,以RHEL8原安装光盘作为yum安装源安装createrepo:
[root@node0 ~]# yum list "createrepo*" Updating Subscription Management repositories. Unable to read consumer identity
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
上次元数据过期检查:3:20:37 前,执行于 2024年02月29日 星期四 07时46分06秒。 可安装的软件包 createrepo_c.x86_64 0.15.11-2.el8 RHAppStream createrepo_c-devel.i686 0.15.11-2.el8 RHAppStream createrepo_c-devel.x86_64 0.15.11-2.el8 RHAppStream createrepo_c-libs.i686 0.15.11-2.el8 RHAppStream createrepo_c-libs.x86_64 0.15.11-2.el8 RHAppStream [root@node0 ~]# yum -y install "createrepo*" Updating Subscription Management repositories. Unable to read consumer identity
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
上次元数据过期检查:3:20:53 前,执行于 2024年02月29日 星期四 07时46分06秒。 依赖关系解决。 ================================================================================ 软件包 架构 版本 仓库 大小 ================================================================================ 安装: createrepo_c x86_64 0.15.11-2.el8 RHAppStream 86 k createrepo_c-devel x86_64 0.15.11-2.el8 RHAppStream 300 k createrepo_c-libs x86_64 0.15.11-2.el8 RHAppStream 113 k 安装依赖关系: drpm x86_64 0.4.1-3.el8 RHAppStream 68 k libzstd-devel x86_64 1.4.4-1.el8 RHBaseOS 44 k popt-devel x86_64 1.16-14.el8 RHBaseOS 30 k rpm-devel x86_64 4.14.3-4.el8 RHBaseOS 141 k sqlite-devel x86_64 3.26.0-11.el8 RHBaseOS 164 k
事务概要 ================================================================================ 安装 8 软件包
总计:946 k 安装大小:4.0 M 下载软件包: 运行事务检查 事务检查成功。 运行事务测试 事务测试成功。 运行事务 准备中 : 1/1 安装 : drpm-0.4.1-3.el8.x86_64 1/8 安装 : createrepo_c-libs-0.15.11-2.el8.x86_64 2/8 安装 : sqlite-devel-3.26.0-11.el8.x86_64 3/8 安装 : popt-devel-1.16-14.el8.x86_64 4/8 安装 : libzstd-devel-1.4.4-1.el8.x86_64 5/8 安装 : rpm-devel-4.14.3-4.el8.x86_64 6/8 安装 : createrepo_c-devel-0.15.11-2.el8.x86_64 7/8 安装 : createrepo_c-0.15.11-2.el8.x86_64 8/8 运行脚本: createrepo_c-0.15.11-2.el8.x86_64 8/8
验证 : libzstd-devel-1.4.4-1.el8.x86_64 1/8 验证 : popt-devel-1.16-14.el8.x86_64 2/8 验证 : rpm-devel-4.14.3-4.el8.x86_64 3/8 验证 : sqlite-devel-3.26.0-11.el8.x86_64 4/8 验证 : createrepo_c-0.15.11-2.el8.x86_64 5/8 验证 : createrepo_c-devel-0.15.11-2.el8.x86_64 6/8 验证 : createrepo_c-libs-0.15.11-2.el8.x86_64 7/8 验证 : drpm-0.4.1-3.el8.x86_64 8/8 Installed products updated.
已安装: createrepo_c-0.15.11-2.el8.x86_64 createrepo_c-devel-0.15.11-2.el8.x86_64 createrepo_c-libs-0.15.11-2.el8.x86_64 drpm-0.4.1-3.el8.x86_64 libzstd-devel-1.4.4-1.el8.x86_64 popt-devel-1.16-14.el8.x86_64 rpm-devel-4.14.3-4.el8.x86_64 sqlite-devel-3.26.0-11.el8.x86_64
完毕!
|
在Mgmt节点上,使用createrepo制作mgmt-node的yum安装源:
[[root@node0 mgmt-node]# cd [root@node0 ~]# createrepo -v /root/mgmt-node/ 14:33:42: Version: 0.15.11 (Features: DeltaRPM LegacyWeakdeps ) 14:33:42: Signal handler setup 14:33:42: Thread pool ready Directory walk started 14:33:42: Adding pkg: /root/mgmt-node/mysql-cluster-community-client-8.0.36-1.el8.x86_64.rpm 14:33:42: Adding pkg: /root/mgmt-node/mysql-cluster-community-client-plugins-8.0.36-1.el8.x86_64.rpm 14:33:42: Adding pkg: /root/mgmt-node/mysql-cluster-community-management-server-8.0.36-1.el8.x86_64.rpm 14:33:42: Adding pkg: /root/mgmt-node/mysql-cluster-community-common-8.0.36-1.el8.x86_64.rpm 14:33:42: Adding pkg: /root/mgmt-node/mysql-cluster-community-libs-8.0.36-1.el8.x86_64.rpm 14:33:42: Dir to scan: /root/mgmt-node/.repodata 14:33:42: Package count: 5 Directory walk done - 5 packages Temporary output repo path: /root/mgmt-node/.repodata/ 14:33:42: Creating .xml.gz files 14:33:42: Setting number of packages Preparing sqlite DBs 14:33:42: Creating databases 14:33:42: Thread pool user data ready Pool started (with 5 workers) Pool finished 14:33:42: Generating repomd.xml 14:33:42: Old repodata doesn't exists: Cannot rename /root/mgmt-node/repodata/ -> /root/mgmt-node/repodata.old.31164.20240229143342.798743: No such file or directory 14:33:42: Renamed /root/mgmt-node/.repodata/ -> /root/mgmt-node/repodata/ 14:33:42: Memory cleanup 14:33:42: All done
|
在Mgmt节点上,在RHEL8原安装光盘的yum安装源的基础上,添加我们制作的mgmt-node的yum安装源:
[root@node0 mgmt-node]# vim /etc/yum.repos.d/base.repo [root@node0 mgmt-node]# cat /etc/yum.repos.d/base.repo [RHBaseOS] name=BaseOS baseurl=file:///mnt2/BaseOS gpgcheck=0 [RHAppStream] name=AppStream baseurl=file:///mnt2/AppStream gpgcheck=0 [mgmt-node] name=mgmt-node baseurl=file:///root/mgmt-node gpgcheck=0
|
由于RHEL8自带的mysql yum module对安装上述的mgmt-node yum安装源有严重的干扰。它会屏蔽mysql-cluster-community-client.x86_64和mysql-cluster-community-common.x86_64。这就是安装不上ndb版本的mysql的原因。默认情况下,yum只显示RHEL自带的mysql.x86_64和mysql-common.x86_64:
[root@node0 ~]# yum list "mysql*" Updating Subscription Management repositories. Unable to read consumer identity
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
BaseOS 10 MB/s | 2.3 MB 00:00 AppStream 262 MB/s | 6.3 MB 00:00 mgmt-node 5.2 MB/s | 5.4 kB 00:00 上次元数据过期检查:0:06:49 前,执行于 2024年02月29日 星期四 14时28分36秒。 可安装的软件包 mysql.x86_64 8.0.21-1.module+el8.2.0+7855+47abd494 RHAppStream mysql-cluster-community-client-plugins.x86_64 8.0.36-1.el8 mgmt-node mysql-cluster-community-management-server.x86_64 8.0.36-1.el8 mgmt-node mysql-common.x86_64 8.0.21-1.module+el8.2.0+7855+47abd494 RHAppStream mysql-devel.x86_64 8.0.21-1.module+el8.2.0+7855+47abd494 RHAppStream mysql-errmsg.x86_64 8.0.21-1.module+el8.2.0+7855+47abd494 RHAppStream mysql-libs.x86_64 8.0.21-1.module+el8.2.0+7855+47abd494 RHAppStream mysql-server.x86_64 8.0.21-1.module+el8.2.0+7855+47abd494 RHAppStream mysql-test.x86_64 8.0.21-1.module+el8.2.0+7855+47abd494 RHAppStream
|
所以要做如下处理,以禁用RHEL8自带的mysql yum module:
[root@node0 ~]# yum module list mysql Updating Subscription Management repositories. Unable to read consumer identity
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
上次元数据过期检查:0:16:52 前,执行于 2024年02月29日 星期四 14时28分36秒。 AppStream Name Stream Profiles Summary mysql 8.0 [d][e] client, server [d] MySQL Module
提示:[d]默认,[e]已启用,[x]已禁用,[i]已安装
[root@node0 ~]# yum module disable mysql Updating Subscription Management repositories. Unable to read consumer identity
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
上次元数据过期检查:0:07:01 前,执行于 2024年02月29日 星期四 14时28分36秒。 依赖关系解决。 =================================================================================================== 软件包 架构 版本 仓库 大小 =================================================================================================== 禁用模块: mysql
事务概要 ===================================================================================================
确定吗?[y/N]: y 完毕! [root@node0 ~]# yum module list mysql Updating Subscription Management repositories. Unable to read consumer identity
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
上次元数据过期检查:0:07:12 前,执行于 2024年02月29日 星期四 14时28分36秒。 AppStream Name Stream Profiles Summary mysql 8.0 [d][x] client, server [d] MySQL Module
提示:[d]默认,[e]已启用,[x]已禁用,[i]已安装
|
做好上面的工作后,在Mgmt节点上执行安装(包括安装ndb_mgmd和安装ndb_mgm两部分):
如果系统中安装有mariadb,要先行删除它:
[root@node0 ~]# yum remove mariadb* Updating Subscription Management repositories. Unable to read consumer identity
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
模块依赖问题
问题 1: conflicting requests - nothing provides module(perl:5.26) needed by module perl-App-cpanminus:1.7044:8030020200313075600:09acf126-0.x86_64 问题 2: conflicting requests - nothing provides module(perl:5.26) needed by module perl-DBD-MySQL:4.046:8030020200511061544:3a70019f-0.x86_64 问题 3: conflicting requests - nothing provides module(perl:5.26) needed by module perl-DBD-Pg:3.7:8030020200313075823:56fce90f-0.x86_64 问题 4: conflicting requests - nothing provides module(perl:5.26) needed by module perl-DBD-SQLite:1.58:8030020200313075906:3a70019f-0.x86_64 问题 5: conflicting requests - nothing provides module(perl:5.26) needed by module perl-DBI:1.641:8030020200505125553:1e4bbb35-0.x86_64 问题 6: conflicting requests - nothing provides module(perl:5.26) needed by module perl-FCGI:0.78:8030020200313080105:1e4bbb35-0.x86_64 问题 7: conflicting requests - nothing provides module(perl:5.26) needed by module perl-IO-Socket-SSL:2.066:8030020200430120526:1e4bbb35-0.x86_64 问题 8: conflicting requests - nothing provides module(perl:5.26) needed by module perl-YAML:1.24:8030020200313080146:f01fa41a-0.x86_64 问题 9: conflicting requests - nothing provides module(perl:5.26) needed by module perl-libwww-perl:6.34:8030020200428102957:b967a9a2-0.x86_64 依赖关系解决。 =================================================================================================== 软件包 架构 版本 仓库 大小 =================================================================================================== 移除: mariadb x86_64 3:10.3.17-1.module+el8.1.0+3974+90eded84 @RH83AppStream 40 M mariadb-backup x86_64 3:10.3.17-1.module+el8.1.0+3974+90eded84 @RH83AppStream 28 M mariadb-common x86_64 3:10.3.17-1.module+el8.1.0+3974+90eded84 @RH83AppStream 179 k mariadb-connector-c x86_64 3.0.7-1.el8 @AppStream 424 k mariadb-connector-c-config noarch 3.0.7-1.el8 @AppStream 497 mariadb-errmsg x86_64 3:10.3.17-1.module+el8.1.0+3974+90eded84 @RH83AppStream 2.3 M mariadb-gssapi-server x86_64 3:10.3.17-1.module+el8.1.0+3974+90eded84 @RH83AppStream 26 k mariadb-server x86_64 3:10.3.17-1.module+el8.1.0+3974+90eded84 @RH83AppStream 88 M mariadb-server-utils x86_64 3:10.3.17-1.module+el8.1.0+3974+90eded84 @RH83AppStream 11 M 清除未被使用的依赖关系: perl-DBD-MySQL x86_64 4.046-3.module+el8.1.0+2938+301254e2 @RH83AppStream 358 k
事务概要 =================================================================================================== 移除 10 软件包
将会释放空间:171 M 确定吗?[y/N]: y 运行事务检查 事务检查成功。 运行事务测试 事务测试成功。 运行事务 准备中 : 1/1 运行脚本: mariadb-gssapi-server-3:10.3.17-1.module+el8.1.0+3974+90eded84.x86_64 1/1 删除 : mariadb-gssapi-server-3:10.3.17-1.module+el8.1.0+3974+90eded84.x86_64 1/10 删除 : mariadb-backup-3:10.3.17-1.module+el8.1.0+3974+90eded84.x86_64 2/10 运行脚本: mariadb-server-3:10.3.17-1.module+el8.1.0+3974+90eded84.x86_64 3/10 删除 : mariadb-server-3:10.3.17-1.module+el8.1.0+3974+90eded84.x86_64 3/10 运行脚本: mariadb-server-3:10.3.17-1.module+el8.1.0+3974+90eded84.x86_64 3/10 删除 : mariadb-3:10.3.17-1.module+el8.1.0+3974+90eded84.x86_64 4/10 删除 : mariadb-errmsg-3:10.3.17-1.module+el8.1.0+3974+90eded84.x86_64 5/10 删除 : mariadb-common-3:10.3.17-1.module+el8.1.0+3974+90eded84.x86_64 6/10 删除 : mariadb-server-utils-3:10.3.17-1.module+el8.1.0+3974+90eded84.x86_64 7/10 删除 : perl-DBD-MySQL-4.046-3.module+el8.1.0+2938+301254e2.x86_64 8/10 删除 : mariadb-connector-c-3.0.7-1.el8.x86_64 9/10 删除 : mariadb-connector-c-config-3.0.7-1.el8.noarch 10/10 运行脚本: mariadb-connector-c-config-3.0.7-1.el8.noarch 10/10
验证 : mariadb-3:10.3.17-1.module+el8.1.0+3974+90eded84.x86_64 1/10 验证 : mariadb-backup-3:10.3.17-1.module+el8.1.0+3974+90eded84.x86_64 2/10 验证 : mariadb-common-3:10.3.17-1.module+el8.1.0+3974+90eded84.x86_64 3/10 验证 : mariadb-connector-c-3.0.7-1.el8.x86_64 4/10 验证 : mariadb-connector-c-config-3.0.7-1.el8.noarch 5/10 验证 : mariadb-errmsg-3:10.3.17-1.module+el8.1.0+3974+90eded84.x86_64 6/10 验证 : mariadb-gssapi-server-3:10.3.17-1.module+el8.1.0+3974+90eded84.x86_64 7/10 验证 : mariadb-server-3:10.3.17-1.module+el8.1.0+3974+90eded84.x86_64 8/10 验证 : mariadb-server-utils-3:10.3.17-1.module+el8.1.0+3974+90eded84.x86_64 9/10 验证 : perl-DBD-MySQL-4.046-3.module+el8.1.0+2938+301254e2.x86_64 10/10 Installed products updated.
已移除: mariadb-3:10.3.17-1.module+el8.1.0+3974+90eded84.x86_64 mariadb-backup-3:10.3.17-1.module+el8.1.0+3974+90eded84.x86_64 mariadb-common-3:10.3.17-1.module+el8.1.0+3974+90eded84.x86_64 mariadb-connector-c-3.0.7-1.el8.x86_64 mariadb-connector-c-config-3.0.7-1.el8.noarch mariadb-errmsg-3:10.3.17-1.module+el8.1.0+3974+90eded84.x86_64 mariadb-gssapi-server-3:10.3.17-1.module+el8.1.0+3974+90eded84.x86_64 mariadb-server-3:10.3.17-1.module+el8.1.0+3974+90eded84.x86_64 mariadb-server-utils-3:10.3.17-1.module+el8.1.0+3974+90eded84.x86_64 perl-DBD-MySQL-4.046-3.module+el8.1.0+2938+301254e2.x86_64
完毕!
|
安装ndb_mgmd:
[root@node0 ndb]# yum list "mysql*" Updating Subscription Management repositories. Unable to read consumer identity
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
上次元数据过期检查:1:19:02 前,执行于 2024年02月29日 星期四 15时30分06秒。 可用的软件包 mysql-cluster-community-client.x86_64 8.0.36-1.el8 @mgmt-node mysql-cluster-community-client-plugins.x86_64 8.0.36-1.el8 @mgmt-node mysql-cluster-community-common.x86_64 8.0.36-1.el8 @mgmt-node mysql-cluster-community-libs.x86_64 8.0.36-1.el8 @mgmt-node mysql-cluster-community-management-server.x86_64 8.0.36-1.el8 @mgmt-node [root@node0 ~]# yum install mysql-cluster-community-management-server.x86_64 Updating Subscription Management repositories. Unable to read consumer identity
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
上次元数据过期检查:0:13:53 前,执行于 2024年02月29日 星期四 14时49分37秒。 依赖关系解决。 =================================================================================================== 软件包 架构 版本 仓库 大小 =================================================================================================== 安装: mysql-cluster-community-management-server x86_64 8.0.36-1.el8 mgmt-node 2.1 M
事务概要 =================================================================================================== 安装 1 软件包
总计:2.1 M 安装大小:9.2 M 确定吗?[y/N]: y 下载软件包: 运行事务检查 事务检查成功。 运行事务测试 事务测试成功。 运行事务 准备中 : 1/1 安装 : mysql-cluster-community-management-server-8.0.36-1.el8.x86_64 1/1 运行脚本: mysql-cluster-community-management-server-8.0.36-1.el8.x86_64 1/1
验证 : mysql-cluster-community-management-server-8.0.36-1.el8.x86_64 1/1 Installed products updated.
已安装: mysql-cluster-community-management-server-8.0.36-1.el8.x86_64
完毕!
|
从上面的实验中可以看出mysql-cluster-community-management-server.x86_64没有依赖关系,实际上用rpm来进行安装都是可以的。
安装ndb_mgm:
[root@node0 ~]# yum install mysql-cluster-community-client.x86_64 Updating Subscription Management repositories. Unable to read consumer identity
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
上次元数据过期检查:0:18:21 前,执行于 2024年02月29日 星期四 14时49分37秒。 依赖关系解决。 =================================================================================================== 软件包 架构 版本 仓库 大小 =================================================================================================== 安装: mysql-cluster-community-client x86_64 8.0.36-1.el8 mgmt-node 56 M 安装依赖关系: mysql-cluster-community-client-plugins x86_64 8.0.36-1.el8 mgmt-node 3.6 M mysql-cluster-community-common x86_64 8.0.36-1.el8 mgmt-node 676 k mysql-cluster-community-libs x86_64 8.0.36-1.el8 mgmt-node 1.5 M
事务概要 =================================================================================================== 安装 4 软件包
总计:61 M 安装大小:311 M 确定吗?[y/N]: y 下载软件包: 运行事务检查 事务检查成功。 运行事务测试 事务测试成功。 运行事务 准备中 : 1/1 安装 : mysql-cluster-community-client-plugins-8.0.36-1.el8.x86_64 1/4 安装 : mysql-cluster-community-common-8.0.36-1.el8.x86_64 2/4 安装 : mysql-cluster-community-libs-8.0.36-1.el8.x86_64 3/4 运行脚本: mysql-cluster-community-libs-8.0.36-1.el8.x86_64 3/4 /sbin/ldconfig: /lib64/libk5crypto.so.3 不是符号链接
安装 : mysql-cluster-community-client-8.0.36-1.el8.x86_64 4/4 运行脚本: mysql-cluster-community-client-8.0.36-1.el8.x86_64 4/4
验证 : mysql-cluster-community-client-8.0.36-1.el8.x86_64 1/4 验证 : mysql-cluster-community-client-plugins-8.0.36-1.el8.x86_64 2/4 验证 : mysql-cluster-community-common-8.0.36-1.el8.x86_64 3/4 验证 : mysql-cluster-community-libs-8.0.36-1.el8.x86_64 4/4 Installed products updated.
已安装: mysql-cluster-community-client-8.0.36-1.el8.x86_64 mysql-cluster-community-client-plugins-8.0.36-1.el8.x86_64 mysql-cluster-community-common-8.0.36-1.el8.x86_64 mysql-cluster-community-libs-8.0.36-1.el8.x86_64
完毕!
|
从上面的实验中可以看出mysql-cluster-community-client.x86_64有大量依赖关系,建议使用yum来进行安装。
至此,Mgmt节点安装完毕: [root@node0 ~]# which ndb_mgmd /usr/sbin/ndb_mgmd [root@node0 ~]# which ndb_mgm /usr/bin/ndb_mgm
|
2.2 Data节点的安装(所有Data节点上都要进行操作): mysql-cluster-community-8.0.36-1.el8.x86_64.rpm-bundle.tar中的mysql-cluster-community-data-node-8.0.36-1.el8.x86_64.rpm要安装于Data节点,用于提供ndbd后台进程。 mysql-cluster-community-data-node-8.0.36-1.el8.x86_64.rpm没有依赖关系,实际上用rpm来进行安装都是可以的。 将mysql-cluster-community-data-node-8.0.36-1.el8.x86_64.rpm传送到每一个Data节点,然后执行下面的rpm安装命令: [root@node3 data-node]# rpm -ivh mysql-cluster-community-data-node-8.0.36-1.el8.x86_64.rpm warning: mysql-cluster-community-data-node-8.0.36-1.el8.x86_64.rpm: Header V4 RSA/SHA256 Signature, key ID a8d3785c: NOKEY Verifying... ################################# [100%] Preparing... ################################# [100%] Updating / installing... 1:mysql-cluster-community-data-node################################# [100%]
|
至此,Data节点安装完毕: [root@node3 data-node]# which ndbd /usr/sbin/ndbd
|
2.3 Sql节点(所有Sql节点上都要进行操作): mysql-cluster-community-8.0.36-1.el8.x86_64.rpm-bundle.tar中的mysql-cluster-community-server-8.0.36-1.el8.x86_64.rpm要安装于Sql节点,用于提供带有ndb集群扩展的mysqld后台进程。不能使用RHEL8自带的mysqld安装包或者任何没有ndb集群扩展的mysqld安装包(比如用于Innodb集群的mysqld安装包)。
mysql这个客户端程序一般也需要安装在Sql节点。mysql这个程序由mysql-cluster-community-client-8.0.36-1.el8.x86_64.rpm和mysql-cluster-community-client-plugins-8.0.36-1.el8.x86_64.rpm提供。
以上3个包所公共依赖的mysql-cluster-community-common-8.0.36-1.el8.x86_64.rpm、mysql-cluster-community-icu-data-files-8.0.36-1.el8.x86_64.rpm和mysql-cluster-community-libs-8.0.36-1.el8.x86_64.rpm也需要拷贝到Sql节点。而所有包含debuginfo/debugsource名字的包,都是debug用途的,可以不安装;所有包含devel名字的包,都是开发用途的,也可以不安装。所有包含test名字的包,都是测试用途的,也可以不安装。 在Sql节点上,准备一个目录存放上面提到的6个包: [root@node1 ~]# cd sql-node/ [root@node1 sql-node]# ls mysql-cluster-community-client-8.0.36-1.el8.x86_64.rpm mysql-cluster-community-client-plugins-8.0.36-1.el8.x86_64.rpm mysql-cluster-community-common-8.0.36-1.el8.x86_64.rpm mysql-cluster-community-icu-data-files-8.0.36-1.el8.x86_64.rpm mysql-cluster-community-libs-8.0.36-1.el8.x86_64.rpm mysql-cluster-community-server-8.0.36-1.el8.x86_64.rpm
|
在Sql节点上,以RHEL8原安装光盘作为yum安装源安装createrepo(与Mgmt节点上的操作完全相同,见2.1)。在Sql节点上,使用createrepo制作sql-node的yum安装源:
[root@node1 ~]# createrepo -v /root/sql-node/ 08:21:09: Version: 0.15.11 (Features: DeltaRPM LegacyWeakdeps ) 08:21:09: Signal handler setup 08:21:09: Thread pool ready Directory walk started 08:21:09: Adding pkg: /root/sql-node/mysql-cluster-community-client-8.0.36-1.el8.x86_64.rpm 08:21:09: Adding pkg: /root/sql-node/mysql-cluster-community-client-plugins-8.0.36-1.el8.x86_64.rpm 08:21:09: Adding pkg: /root/sql-node/mysql-cluster-community-common-8.0.36-1.el8.x86_64.rpm 08:21:09: Adding pkg: /root/sql-node/mysql-cluster-community-icu-data-files-8.0.36-1.el8.x86_64.rpm 08:21:09: Adding pkg: /root/sql-node/mysql-cluster-community-libs-8.0.36-1.el8.x86_64.rpm 08:21:09: Adding pkg: /root/sql-node/mysql-cluster-community-server-8.0.36-1.el8.x86_64.rpm 08:21:09: Dir to scan: /root/sql-node/.repodata 08:21:09: Package count: 6 Directory walk done - 6 packages Temporary output repo path: /root/sql-node/.repodata/ 08:21:09: Creating .xml.gz files 08:21:09: Setting number of packages Preparing sqlite DBs 08:21:09: Creating databases 08:21:09: Thread pool user data ready Pool started (with 5 workers) Pool finished 08:21:09: Generating repomd.xml 08:21:09: Old repodata doesn't exists: Cannot rename /root/sql-node/repodata/ -> /root/sql-node/repodata.old.34213.20240229082109.584742: No such file or directory 08:21:09: Renamed /root/sql-node/.repodata/ -> /root/sql-node/repodata/ 08:21:09: Memory cleanup 08:21:09: All done
|
在Sql节点上,在RHEL8原安装光盘的yum安装源的基础上,添加我们制作的sql-node的yum安装源:
[root@node1 ~]# vim /etc/yum.repos.d/base.repo [root@node1 ~]# cat /etc/yum.repos.d/base.repo [RHBaseOS] name=BaseOS baseurl=file:///mnt2/BaseOS gpgcheck=0 [RHAppStream] name=AppStream baseurl=file:///mnt2/AppStream gpgcheck=0 [sql-node] name=sql-node baseurl=file:///root/sql-node gpgcheck=0
|
由于RHEL8自带的mysql
yum module对安装上述的sql-node
yum安装源有严重的干扰。它会屏蔽mysql-cluster-community-server.x86_64、mysql-cluster-community-client.x86_64和mysql-cluster-community-common.x86_64。这就是安装不上ndb版本的mysql的原因。默认情况下,yum只显示RHEL自带的mysql.x86_64和mysql-common.x86_64:
[root@node1 ~]# yum list "mysql*" Failed to set locale, defaulting to C.UTF-8 Updating Subscription Management repositories. Unable to read consumer identity
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
BaseOS 254 MB/s | 2.3 MB 00:00 AppStream 276 MB/s | 6.3 MB 00:00 sql-node 9.0 MB/s | 9.2 kB 00:00 Available Packages mysql.x86_64 8.0.21-1.module+el8.2.0+7855+47abd494 RHAppStream mysql-cluster-community-client-plugins.x86_64 8.0.36-1.el8 sql-node mysql-cluster-community-icu-data-files.x86_64 8.0.36-1.el8 sql-node mysql-common.x86_64 8.0.21-1.module+el8.2.0+7855+47abd494 RHAppStream mysql-devel.x86_64 8.0.21-1.module+el8.2.0+7855+47abd494 RHAppStream mysql-errmsg.x86_64 8.0.21-1.module+el8.2.0+7855+47abd494 RHAppStream mysql-libs.x86_64 8.0.21-1.module+el8.2.0+7855+47abd494 RHAppStream mysql-server.x86_64 8.0.21-1.module+el8.2.0+7855+47abd494 RHAppStream mysql-test.x86_64 8.0.21-1.module+el8.2.0+7855+47abd494 RHAppStream
|
所以要禁用RHEL8自带的mysql yum module(与Mgmt节点上的操作完全相同,见2.1)。做好上面的工作后,在Sql节点上执行安装(如果系统中安装有mariadb,要先行删除它,见2.1):
[root@node1 ~]# yum list "mysql*" Failed to set locale, defaulting to C.UTF-8 Updating Subscription Management repositories. Unable to read consumer identity
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Last metadata expiration check: 0:11:32 ago on Thu Feb 29 08:40:06 2024. Available Packages mysql-cluster-community-client.x86_64 8.0.36-1.el8 sql-node mysql-cluster-community-client-plugins.x86_64 8.0.36-1.el8 sql-node mysql-cluster-community-common.x86_64 8.0.36-1.el8 sql-node mysql-cluster-community-icu-data-files.x86_64 8.0.36-1.el8 sql-node mysql-cluster-community-libs.x86_64 8.0.36-1.el8 sql-node mysql-cluster-community-server.x86_64 8.0.36-1.el8 sql-node [root@node1 ~]# yum install mysql-cluster-community-server.x86_64 Failed to set locale, defaulting to C.UTF-8 Updating Subscription Management repositories. Unable to read consumer identity
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Last metadata expiration check: 0:12:18 ago on Thu Feb 29 08:40:06 2024. Dependencies resolved. =================================================================================================== Package Architecture Version Repository Size =================================================================================================== Installing: mysql-cluster-community-server x86_64 8.0.36-1.el8 sql-node 64 M Installing dependencies: mysql-cluster-community-client x86_64 8.0.36-1.el8 sql-node 56 M mysql-cluster-community-client-plugins x86_64 8.0.36-1.el8 sql-node 3.6 M mysql-cluster-community-common x86_64 8.0.36-1.el8 sql-node 676 k mysql-cluster-community-icu-data-files x86_64 8.0.36-1.el8 sql-node 2.2 M mysql-cluster-community-libs x86_64 8.0.36-1.el8 sql-node 1.5 M
Transaction Summary =================================================================================================== Install 6 Packages
Total size: 128 M Installed size: 610 M Is this ok [y/N]: y Downloading Packages: Running transaction check Transaction check succeeded. Running transaction test Transaction test succeeded. Running transaction Preparing : 1/1 Installing : mysql-cluster-community-common-8.0.36-1.el8.x86_64 1/6 Installing : mysql-cluster-community-client-plugins-8.0.36-1.el8.x86_64 2/6 Installing : mysql-cluster-community-libs-8.0.36-1.el8.x86_64 3/6 Running scriptlet: mysql-cluster-community-libs-8.0.36-1.el8.x86_64 3/6 Installing : mysql-cluster-community-client-8.0.36-1.el8.x86_64 4/6 Installing : mysql-cluster-community-icu-data-files-8.0.36-1.el8.x86_64 5/6 Running scriptlet: mysql-cluster-community-server-8.0.36-1.el8.x86_64 6/6 Installing : mysql-cluster-community-server-8.0.36-1.el8.x86_64 6/6 Running scriptlet: mysql-cluster-community-server-8.0.36-1.el8.x86_64 6/6 Verifying : mysql-cluster-community-client-8.0.36-1.el8.x86_64 1/6 Verifying : mysql-cluster-community-client-plugins-8.0.36-1.el8.x86_64 2/6 Verifying : mysql-cluster-community-common-8.0.36-1.el8.x86_64 3/6 Verifying : mysql-cluster-community-icu-data-files-8.0.36-1.el8.x86_64 4/6 Verifying : mysql-cluster-community-libs-8.0.36-1.el8.x86_64 5/6 Verifying : mysql-cluster-community-server-8.0.36-1.el8.x86_64 6/6 Installed products updated.
Installed: mysql-cluster-community-client-8.0.36-1.el8.x86_64 mysql-cluster-community-client-plugins-8.0.36-1.el8.x86_64 mysql-cluster-community-common-8.0.36-1.el8.x86_64 mysql-cluster-community-icu-data-files-8.0.36-1.el8.x86_64 mysql-cluster-community-libs-8.0.36-1.el8.x86_64 mysql-cluster-community-server-8.0.36-1.el8.x86_64
Complete!
|
从上面的实验中可以看出mysql-cluster-community-server.x86_64有大量的依赖关系,建议使用yum来进行安装。 至此,Sql节点安装完毕: [root@node1 ~]# mysqladmin --version mysqladmin Ver 8.0.36-cluster for Linux on x86_64 (MySQL Cluster Community Server - GPL)
|
3. 配置和运行:
node0-node6所有节点关闭防火墙,disable SElinux。以node0为例子(改完成SElinux配置文件后,需要重新启动系统。“setenforce 0”仍然会记录audit.log,建议彻底重新启动系统以减少permisive模式的日志消耗): [root@node0 ~]# systemctl status firewalld ● firewalld.service - firewalld - dynamic firewall daemon Loaded: loaded (/usr/lib/systemd/system/firewalld.service; enabled; vendor p> Active: active (running) since Thu 2024-02-29 02:50:07 EST; 18h ago Docs: man:firewalld(1) Main PID: 937 (firewalld) Tasks: 2 (limit: 11247) Memory: 31.8M CGroup: /system.slice/firewalld.service └─937 /usr/libexec/platform-python -s /usr/sbin/firewalld --nofork ->
Feb 29 02:50:00 node1.example.com systemd[1]: Starting firewalld - dynamic fire> Feb 29 02:50:07 node1.example.com systemd[1]: Started firewalld - dynamic firew> Feb 29 02:50:09 node1.example.com firewalld[937]: WARNING: AllowZoneDrifting is> [root@node1 ~]# systemctl stop firewalld [root@node1 ~]# systemctl disable firewalld Removed /etc/systemd/system/multi-user.target.wants/firewalld.service. Removed /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service. [root@node1 ~]# vim /etc/selinux/config [root@node1 ~]# cat /etc/selinux/config
# This file controls the state of SELinux on the system. # SELINUX= can take one of these three values: # enforcing - SELinux security policy is enforced. # permissive - SELinux prints warnings instead of enforcing. # disabled - No SELinux policy is loaded. SELINUX=disabled # SELINUXTYPE= can take one of these three values: # targeted - Targeted processes are protected, # minimum - Modification of targeted policy. Only selected processes are protected. # mls - Multi Level Security protection. SELINUXTYPE=targeted
|
3.1 配置和运行Mgmt节点: Mgmt节点上不需要创建mysql用户和mysql组。 需要编辑/var/lib/mysql-cluster/config.ini,通过cat /var/lib/mysql-cluster/config.ini显示其内容:
[root@node0 ~]# mkdir /var/lib/mysql-cluster [root@node0 ~]# vim /var/lib/mysql-cluster/config.ini
[root@node0 ~]# cat /var/lib/mysql-cluster/config.ini [ndbd default] # Options affecting ndbd processes on all data nodes: NoOfReplicas=4 # Number of fragment replicas DataMemory=1024M # How much memory to allocate for data storage
[ndb_mgmd] # Management process options: HostName=172.25.250.200 # Hostname or IP address of management node DataDir=/var/lib/mysql-cluster # Directory for management node log files NodeId=1
[ndbd] # Options for data node "A": # (one [ndbd] section per data node) HostName=172.25.250.203 # Hostname or IP address NodeId=4 # Node ID for this data node DataDir=/var/lib/mysql # Directory for this data node's data files
[ndbd] # Options for data node "B": HostName=172.25.250.204 # Hostname or IP address NodeId=5 # Node ID for this data node DataDir=/var/lib/mysql # Directory for this data node's data files
[ndbd] # Options for data node "C": HostName=172.25.250.205 # Hostname or IP address NodeId=6 # Node ID for this data node DataDir=/var/lib/mysql # Directory for this data node's data files
[ndbd] # Options for data node "D": HostName=172.25.250.206 # Hostname or IP address NodeId=7 # Node ID for this data node DataDir=/var/lib/mysql # Directory for this data node's data files
[mysqld] # SQL node options: HostName=172.25.250.201 # Hostname or IP address NodeId=2 # (additional mysqld connections can be # specified for this node for various # purposes such as running ndb_restore)
[mysqld] # SQL node options: HostName=172.25.250.202 # Hostname or IP address NodeId=3 |
启动ndb_mgmd:
[root@node0 ~]# ndb_mgmd --initial -f /var/lib/mysql-cluster/config.ini MySQL Cluster Management Server mysql-8.0.36 ndb-8.0.36 2024-03-01 15:01:25 [MgmtSrvr] INFO -- The default config directory '/usr/mysql-cluster' does not exist. Trying to create it... 2024-03-01 15:01:25 [MgmtSrvr] INFO -- Sucessfully created config directory
|
3.2 配置和运行Data节点:
每一个Data节点上都要配置和执行,以node3为例子:
每一个Data节点都需要创建mysql用户和mysql组:
[root@node3 ~]# groupadd -g 27 mysql [root@node3 ~]# useradd -u 27 -g mysql -s /sbin/nologin mysql
|
每一个Data节点都需要创建数据和日志目录:
[root@node3 ~]#mkdir -p /var/lib/mysql [root@node3 ~]# mkdir -p /var/log/mysql [root@node3 ~]# chown mysql.mysql /var/lib/mysql [root@node3 ~]# chown mysql.mysql /var/log/mysql
|
需要编辑/etc/my.cnf,通过cat /etc/my.cnf显示其内容:
[root@node3 ~]# vim /etc/my.cnf [root@node3 ~]# cat /etc/my.cnf [mysqld] datadir=/var/lib/mysql socket=/var/lib/mysql/mysql.sock user=mysql log-error=/var/log/mysql/mysqld.log ndbcluster pid-file=/var/lib/mysql/mysqld.pid
[mysql] socket=/var/lib/mysql/mysql.sock
[mysql_cluster] # Options for NDB Cluster processes: ndb-connectstring=172.25.250.200 # location of management server [root@node3 ~]#chown mysql.mysql /etc/my.cnf
|
启动ndbd:
[root@node3 ~]# ndbd 2024-03-01 02:37:55 [ndbd] INFO -- Angel connected to '172.25.250.200:1186' 2024-03-01 02:37:55 [ndbd] INFO -- Angel allocated nodeid: 4
|
3.3 配置和运行Sql节点: 每一个Sql节点上都要配置和执行,以node1为例子:
每一个Sql节点由于安装了mysql-cluster-server包,已经存在mysql用户和mysql组,不需要再创建。 每一个data节点都需要创建数据和日志目录:
[root@node3 ~]#mkdir -p /var/lib/mysql [root@node3 ~]# mkdir -p /var/log/mysql [root@node3 ~]# chown mysql.mysql /var/lib/mysql [root@node3 ~]# chown mysql.mysql /var/log/mysql
|
需要编辑/etc/my.cnf,通过cat /etc/my.cnf显示其内容(与Data节点完全相同的内容):
[root@node1 ~]# vim /etc/my.cnf [root@node1 ~]# cat /etc/my.cnf [mysqld] datadir=/var/lib/mysql socket=/var/lib/mysql/mysql.sock user=mysql log-error=/var/log/mysql/mysqld.log ndbcluster pid-file=/var/lib/mysql/mysqld.pid
[mysql] socket=/var/lib/mysql/mysql.sock
[mysql_cluster] # Options for NDB Cluster processes: ndb-connectstring=172.25.250.200 # location of management server [root@node1 ~]#chown mysql.mysql /etc/my.cnf
|
启动mysqld:
[root@node1 ~]# mysqld --initialize [root@node1 ~]# grep password /var/log/mysql/mysqld.log 2024-03-01T08:06:39.690287Z 6 [Note] [MY-010454] [Server] A temporary password is generated for root@localhost: 88u(seRpoI0p [root@node1 ~]# systemctl enable mysqld
[root@node1 mysql]# systemctl restart mysqld
|
查看日志/var/log/mysql/mysqld.log:
......
2024-03-01T08:09:06.938678Z 2 [System] [MY-010865] [NDB] Binlog: logging ./mysql/ndb_schema_result (UPDATED,USE_WRITE) 2024-03-01T08:09:06.939011Z 2 [System] [MY-010865] [NDB] Removing potentially stale table definition with id 7 from DD 2024-03-01T08:09:06.940863Z 2 [System] [MY-010865] [NDB] Creating table 'mysql.ndb_index_stat_head' 2024-03-01T08:09:06.968286Z 2 [System] [MY-010865] [NDB] Removing potentially stale table definition with id 8 from DD 2024-03-01T08:09:06.970263Z 2 [System] [MY-010865] [NDB] Creating table 'mysql.ndb_index_stat_sample' 2024-03-01T08:09:07.006470Z 2 [System] [MY-010865] [NDB] Signalling the index stat thread to restart 2024-03-01T08:09:07.008531Z 2 [System] [MY-010865] [NDB] Removing potentially stale table definition with id 10 from DD 2024-03-01T08:09:07.010376Z 2 [System] [MY-010865] [NDB] Creating table 'mysql.ndb_apply_status' 2024-03-01T08:09:07.027923Z 2 [System] [MY-010865] [NDB] Event 'REPL$mysql/ndb_apply_status' for table 'mysql.ndb_apply_status' already exists 2024-03-01T08:09:07.031811Z 2 [System] [MY-010865] [NDB] Binlog: logging ./mysql/ndb_apply_status (UPDATED,USE_WRITE) 2024-03-01T08:09:07.031905Z 2 [System] [MY-010865] [NDB] Starting metadata synchronization... 2024-03-01T08:09:07.031919Z 2 [System] [MY-010865] [NDB] Synchronizing logfile groups 2024-03-01T08:09:07.032509Z 2 [System] [MY-010865] [NDB] Synchronizing tablespaces 2024-03-01T08:09:07.033048Z 2 [System] [MY-010865] [NDB] Synchronizing databases 2024-03-01T08:09:07.035767Z 2 [System] [MY-010865] [NDB] Synchronizing schema 'mysql' 2024-03-01T08:09:07.036063Z 2 [System] [MY-010865] [NDB] Synchronizing schema 'information_schema' 2024-03-01T08:09:07.036382Z 2 [System] [MY-010865] [NDB] Synchronizing schema 'performance_schema' 2024-03-01T08:09:07.036680Z 2 [System] [MY-010865] [NDB] Synchronizing schema 'sys' 2024-03-01T08:09:07.036981Z 2 [System] [MY-010865] [NDB] Synchronizing schema 'ndbinfo' 2024-03-01T08:09:07.037250Z 2 [System] [MY-010865] [NDB] Completed metadata synchronization 2024-03-01T08:09:07.037285Z 2 [System] [MY-010865] [NDB] Ndb_stored_grants::setup() -- normal setup 2024-03-01T08:09:07.038822Z 2 [System] [MY-010865] [NDB] Removing potentially stale table definition with id 11 from DD 2024-03-01T08:09:07.040419Z 2 [System] [MY-010865] [NDB] Creating table 'mysql.ndb_sql_metadata' 2024-03-01T08:09:07.061494Z 2 [System] [MY-010865] [NDB] From NDB stored grants, applied 0 grants for 0 users. 2024-03-01T08:09:07.061545Z 2 [System] [MY-010866] [NDB] Binlog: Wait for first event 2024-03-01 03:09:07 [NdbApi] INFO -- Flushing incomplete GCI:s < 582/9 2024-03-01 03:09:07 [NdbApi] INFO -- Flushing incomplete GCI:s < 582/9 2024-03-01T08:09:07.102888Z 2 [System] [MY-010866] [NDB] Binlog: starting log at epoch 582/9 2024-03-01T08:09:07.102910Z 2 [System] [MY-010866] [NDB] Binlog: Got first event 2024-03-01T08:09:07.102918Z 2 [System] [MY-010866] [NDB] Binlog: NDB tables writable 2024-03-01T08:09:07.103307Z 2 [System] [MY-010866] [NDB] Binlog: Startup and setup completed 2024-03-01T08:09:07.113721Z 2 [System] [MY-010866] [NDB] Binlog: Reloaded metadata cache 2024-03-01T08:09:07.807900Z 0 [System] [MY-010866] [NDB] Index Stat: Initial restart detected
|
4. 查看NDB集群的整体状态:
以下输出说明NDB集群安装/运行是成功的:
[root@node0 ~]# ndb_mgm -- NDB Cluster -- Management Client -- ndb_mgm> show Connected to Management Server at: localhost:1186 Cluster Configuration --------------------- [ndbd(NDB)] 4 node(s) id=4 @172.25.250.203 (mysql-8.0.36 ndb-8.0.36, Nodegroup: 0, *) id=5 @172.25.250.204 (mysql-8.0.36 ndb-8.0.36, Nodegroup: 0) id=6 @172.25.250.205 (mysql-8.0.36 ndb-8.0.36, Nodegroup: 0) id=7 @172.25.250.206 (mysql-8.0.36 ndb-8.0.36, Nodegroup: 0)
[ndb_mgmd(MGM)] 1 node(s) id=1 @172.25.250.200 (mysql-8.0.36 ndb-8.0.36)
[mysqld(API)] 2 node(s) id=2 @172.25.250.201 (mysql-8.0.36 ndb-8.0.36) id=3 @172.25.250.202 (mysql-8.0.36 ndb-8.0.36)
ndb_mgm>
|
|