MySQL PXC集群新增一个高版本节点

本文涉及的产品
RDS MySQL Serverless 基础系列,0.5-2RCU 50GB
云数据库 RDS MySQL,集群系列 2核4GB
推荐场景:
搭建个人博客
云数据库 RDS MySQL,高可用系列 2核4GB
简介: 已有的一个 MySQL PXC 集群环境,因为种种原因仅剩一个节点 node1,需要新增一个集群节点 node2

已有的一个 MySQL PXC 集群环境,因为种种原因仅剩一个节点 node1,需要新增一个集群节点 node2。
node1 版本:donor version (8.0.21)
node2 版本:local version (8.0.32)

大致步骤:
1、node2 配置部署新版本的集群环境;
2、node2 配置/etc/my.cnf
拷贝 node1 的配置文件,仅需修改serverid、nodename
3、node2 准备数据目录,确保目录为空
4、node2 启动服务
会提示报错,需要将 node1 的 *.pem 文件拷贝到新节点,再次启动即可。
本次遇见一个低级错误,顺便看一下启动过程日志如下:

开始是使用那些pem文件握手连接,并执行数据同步,之后是升级:
2023-07-26T01:47:42.264423Z 1 [System] [MY-013413] [Server] Data dictionary upgrade from version '80021' to '80023' completed.
2023-07-26T01:47:50.295523Z 4 [System] [MY-013381] [Server] Server upgrade from '80021' to '80032' completed.
后面的启动尽管报错,但无需再次升级数据:
2023-07-26T01:50:51.621940Z 0 [Note] [MY-000000] [WSREP-SST] Proceeding with SST.........
2023-07-26T01:50:51.670240Z 0 [Note] [MY-000000] [WSREP-SST] ............Waiting for SST streaming to complete!
2023-07-26T01:51:15.992054Z 0 [Note] [MY-000000] [Galera] 0.0 (node1): State transfer to 1.0 (node2) complete.
2023-07-26T01:51:15.993423Z 0 [Note] [MY-000000] [Galera] Member 0.0 (node1) synced with group.
2023-07-26T01:51:15.998986Z 0 [Note] [MY-000000] [WSREP-SST] Preparing the backup at /mysql/pxc/data//sst-xb-tmpdir
2023-07-26T01:51:17.808995Z 0 [Note] [MY-000000] [WSREP-SST] Moving the backup to /mysql/pxc/data/
2023-07-26T01:51:17.929261Z 0 [Note] [MY-000000] [WSREP-SST] Running post-processing...........
2023-07-26T01:51:17.938459Z 0 [Note] [MY-000000] [WSREP-SST] Opting for mysql_upgrade (sst): local version (8.0.32) != donor version (8.0.21)
2023-07-26T01:51:18.030688Z 0 [Note] [MY-000000] [WSREP-SST] Waiting for server instance to start..... This may take some time
2023-07-26T01:51:31.230189Z 0 [ERROR] [MY-000000] [WSREP-SST] ******************* FATAL ERROR **********************
2023-07-26T01:51:31.230243Z 0 [ERROR] [MY-000000] [WSREP-SST] Failed to start the mysql server that checks for async replication.
2023-07-26T01:51:31.230251Z 0 [ERROR] [MY-000000] [WSREP-SST] Check the parameters and retry
2023-07-26T01:51:31.230255Z 0 [ERROR] [MY-000000] [WSREP-SST] Line 521 pid:6129
2023-07-26T01:51:31.232347Z 0 [ERROR] [MY-000000] [WSREP-SST] ------------ mysql error log (START) ------------
---- Starting the MySQL server used for post-processing ----
2023-07-26T01:51:18.237305Z 0 [Warning] [MY-011068] [Server] The syntax 'wsrep_slave_threads' is deprecated and will be removed in a future release. Please use wsrep_applier_threads instead.
2023-07-26T01:51:18.237360Z 0 [Warning] [MY-011068] [Server] The syntax 'skip_slave_start' is deprecated and will be removed in a future release. Please use skip_replica_start instead.
2023-07-26T01:51:18.237435Z 0 [Warning] [MY-010097] [Server] Insecure configuration for --secure-file-priv: Current value does not restrict location of generated files. Consider setting it to a valid, non-empty path.
2023-07-26T01:51:18.237441Z 0 [Warning] [MY-010097] [Server] Insecure configuration for --secure-log-path: Current value does not restrict location of generated files. Consider setting it to a valid, non-empty path.
2023-07-26T01:51:18.237480Z 0 [Warning] [MY-000000] [WSREP] Node is not a cluster node. Disabling pxc_strict_mode
2023-07-26T01:51:18.238775Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.32-24.2) starting as process 6129
2023-07-26T01:51:18.240915Z 0 [Warning] [MY-013242] [Server] --character-set-server: 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous.
2023-07-26T01:51:18.243886Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.
2023-07-26T01:51:18.243929Z 0 [System] [MY-013602] [Server] Channel mysql_main configured to support TLS. Encrypted connections are now supported for this channel.
2023-07-26T01:51:18.249172Z 0 [Warning] [MY-010075] [Server] No existing UUID has been found, so we assume that this is the first time that this server has been started. Generating a new UUID: e9aa301e-2b56-11ee-a47e-000c2948ee39.
2023-07-26T01:51:18.254102Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2023-07-26T01:51:18.446220Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
2023-07-26T01:51:18.461620Z 1 [System] [MY-011090] [Server] Data dictionary upgrading from version '80021' to '80023'.
2023-07-26T01:51:20.020760Z 1 [System] [MY-013413] [Server] Data dictionary upgrade from version '80021' to '80023' completed.
2023-07-26T01:51:20.288653Z 1 [Note] [MY-000000] [WSREP] wsrep_init_schema_and_SR (nil)
2023-07-26T01:51:22.618990Z 4 [System] [MY-013381] [Server] Server upgrade from '80021' to '80032' started.
2023-07-26T01:51:27.913366Z 4 [System] [MY-013381] [Server] Server upgrade from '80021' to '80032' completed.
2023-07-26T01:51:27.991646Z 0 [System] [MY-010229] [Server] Starting XA crash recovery...
2023-07-26T01:51:28.163501Z 0 [System] [MY-010232] [Server] XA crash recovery finished.
2023-07-26T01:51:28.220564Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.
2023-07-26T01:51:28.220603Z 0 [System] [MY-013602] [Server] Channel mysql_main configured to support TLS. Encrypted connections are now supported for this channel.
2023-07-26T01:51:28.221965Z 0 [Warning] [MY-011810] [Server] Insecure configuration for --pid-file: Location '/tmp' in the path is accessible to all OS users. Consider choosing a different directory.
报错日志:
2023-07-26T01:51:28.224149Z 0 [ERROR] [MY-000067] [Server] unknown variable 'cert.pem;socket.ssl_ca=ca.pem"'.
2023-07-26T01:51:28.224217Z 0 [ERROR] [MY-010119] [Server] Aborting
2023-07-26T01:51:30.216961Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.32-24.2) Percona XtraDB Cluster (GPL), Release rel24, Revision 2119e75, WSREP version 26.1.4.3.

可见报错的是配置文件错误!原因是多了一个换行符的低级错误,修改后即可。
之后正确的做法是将node1也升级为最新版本即可。

相关实践学习
如何在云端创建MySQL数据库
开始实验后,系统会自动创建一台自建MySQL的 源数据库 ECS 实例和一台 目标数据库 RDS。
全面了解阿里云能为你做什么
阿里云在全球各地部署高效节能的绿色数据中心,利用清洁计算为万物互联的新世界提供源源不断的能源动力,目前开服的区域包括中国(华北、华东、华南、香港)、新加坡、美国(美东、美西)、欧洲、中东、澳大利亚、日本。目前阿里云的产品涵盖弹性计算、数据库、存储与CDN、分析与搜索、云通信、网络、管理与监控、应用服务、互联网中间件、移动服务、视频服务等。通过本课程,来了解阿里云能够为你的业务带来哪些帮助     相关的阿里云产品:云服务器ECS 云服务器 ECS(Elastic Compute Service)是一种弹性可伸缩的计算服务,助您降低 IT 成本,提升运维效率,使您更专注于核心业务创新。产品详情: https://www.aliyun.com/product/ecs
目录
相关文章
|
2月前
|
分布式计算 关系型数据库 MySQL
大数据-88 Spark 集群 案例学习 Spark Scala 案例 SuperWordCount 计算结果数据写入MySQL
大数据-88 Spark 集群 案例学习 Spark Scala 案例 SuperWordCount 计算结果数据写入MySQL
54 3
|
2月前
|
消息中间件 分布式计算 关系型数据库
大数据-140 - ClickHouse 集群 表引擎详解5 - MergeTree CollapsingMergeTree 与其他数据源 HDFS MySQL
大数据-140 - ClickHouse 集群 表引擎详解5 - MergeTree CollapsingMergeTree 与其他数据源 HDFS MySQL
58 0
|
1月前
|
关系型数据库 MySQL
mysql 5.7.x版本查看某张表、库的大小 思路方案说明
mysql 5.7.x版本查看某张表、库的大小 思路方案说明
69 5
|
1月前
|
关系型数据库 MySQL
mysql 5.7.x版本查看某张表、库的大小 思路方案说明
mysql 5.7.x版本查看某张表、库的大小 思路方案说明
39 1
|
2月前
|
Java 关系型数据库 MySQL
【编程基础知识】Eclipse连接MySQL 8.0时的JDK版本和驱动问题全解析
本文详细解析了在使用Eclipse连接MySQL 8.0时常见的JDK版本不兼容、驱动类错误和时区设置问题,并提供了清晰的解决方案。通过正确配置JDK版本、选择合适的驱动类和设置时区,确保Java应用能够顺利连接MySQL 8.0。
255 1
|
2月前
|
SQL JSON 关系型数据库
MySQL是一个广泛使用的开源关系型数据库管理系统,它有许多不同的版本
【10月更文挑战第3天】MySQL是一个广泛使用的开源关系型数据库管理系统,它有许多不同的版本
179 5
|
1月前
|
SQL 关系型数据库 MySQL
MySql5.6版本开启慢SQL功能-本次采用永久生效方式
MySql5.6版本开启慢SQL功能-本次采用永久生效方式
43 0
|
2月前
|
SQL 分布式计算 关系型数据库
Hadoop-24 Sqoop迁移 MySQL到Hive 与 Hive到MySQL SQL生成数据 HDFS集群 Sqoop import jdbc ETL MapReduce
Hadoop-24 Sqoop迁移 MySQL到Hive 与 Hive到MySQL SQL生成数据 HDFS集群 Sqoop import jdbc ETL MapReduce
104 0
|
2月前
|
SQL 分布式计算 关系型数据库
Hadoop-23 Sqoop 数据MySQL到HDFS(部分) SQL生成数据 HDFS集群 Sqoop import jdbc ETL MapReduce
Hadoop-23 Sqoop 数据MySQL到HDFS(部分) SQL生成数据 HDFS集群 Sqoop import jdbc ETL MapReduce
48 0
|
2月前
|
SQL 分布式计算 关系型数据库
Hadoop-22 Sqoop 数据MySQL到HDFS(全量) SQL生成数据 HDFS集群 Sqoop import jdbc ETL MapReduce
Hadoop-22 Sqoop 数据MySQL到HDFS(全量) SQL生成数据 HDFS集群 Sqoop import jdbc ETL MapReduce
57 0

推荐镜像

更多
下一篇
DataWorks