已有的一个 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 PXC集群新增一个高版本节点的更多相关文章

  1. MySQL PXC集群安装配置

    1.关闭防火墙 [root@node04 ~]#systemctl disable firewalld [root@node04 ~]#systemctl stop firewalld [root@n ...

  2. Docker 搭建pxc集群 + haproxy + keepalived 高可用(二)

    上一节我们有了两个分片的pxc集群,这一节我们接着安装haproxy和keepalived的实现集群的高可用 一.先下载haproxy的镜像 [root@localhost ~]# docker pu ...

  3. Docker 搭建pxc集群 + haproxy + keepalived 高可用(一)

    一.首先需要安装好docker,安装方法可以参考之前一篇博文Centos7安装docker [root@localhost ~]# systemctl start docker [root@local ...

  4. MySQL PXC集群部署

    安装 Percona-XtraDB-Cluster 架构: 三个节点: pxc_node_0 30.0.0.196 pxc_node_1 30.0.0.198 pxc_node_2 30.0.0.19 ...

  5. docker中mysql pxc集群

    PXC集群 https://hub.docker.com/r/percona/percona-xtradb-cluster 安装PXC镜像 下载镜像或者导入本地镜像 docker pull perco ...

  6. docker 中搭建 mysql pxc 集群

      一.docker中创建pxc 容器 1.拉取PXC 镜像 pull docker pull percona/percona-xtradb-cluster:5.7.21 2.更改镜像名称为pxc t ...

  7. mysql PXC集群方案总结

    同时写集群内的所有机器 写性能依赖最慢的那个机器 读性能提高X倍

  8. docker mysql pxc集群(percona-xtradb-cluster)

    docker pull percona/percona-xtradb-cluster docker tag percona/percona-xtradb-cluster pxc docker netw ...

  9. MySQL之PXC集群搭建

    一.PXC 介绍 1.1 PXC 简介 PXC 是一套 MySQL 高可用集群解决方案,与传统的基于主从复制模式的集群架构相比 PXC 最突出特点就是解决了诟病已久的数据复制延迟问题,基本上可以达到实 ...

  10. Spark集群新增节点方法

    Spark集群处理能力不足需要扩容,如何在现有spark集群中新增新节点?本文以一个实例介绍如何给Spark集群新增一个节点. 1. 集群环境 现有Spark集群包括3台机器,用户名都是cdahdp, ...

随机推荐

  1. 【python基础】类-模块

    随着不断给类添加功能,文件可能变得很长,即便妥善地使用了继承亦是如此,为遵循Python的总体理念,应让文件尽可能简洁.为在这方面提供帮助,Python允许将类存储在模块中,然后在主程序中导入所需的模 ...

  2. Java 访问控制权限修饰符

    1.访问控制权限修饰符来控制元素的访问范围 2.访问控制权限修饰符包括: public 表示公开的,任何位置都可以可以访问 protected 同包,子类 缺省 同包 private 表示私有的,只能 ...

  3. .Net微服务实战

    前言 第一篇.Net微服务实战是2020年开始的,整个系列拥有文章共11篇,抛开代码计算共有7W多字,每一篇都是我花了不少精力与心思进行打磨. 后续该系列有新增的文章会在此目录同步更新,也是主要方便自 ...

  4. List 接口及其常用方法

    List 接口基本介绍 List接口是Collection接口的子接口,其主要特点如下: List中元素有序,是按照元素的插入顺序进行排序的.每个元素都有一个与之关联的整数型索引(索引从 0 开始), ...

  5. 如何制作 GitHub 个人主页

    人们在网上首先发现你的地方是哪里?也许你的社交媒体是人们搜索你时首先发现的东西,亦也许是你为自己创建的投资组合网站.然而,如果你使用GitHub来分享你的代码并参与开源项目,那么你的GitHub个人主 ...

  6. python中的数据容器

    第六章:Python数据容器 数据容器入门 什么是数据容器 一种可以容纳多份数据的数据类型,容纳的每一份数据称之为1个元素,每一个元素,可以是任意类型的数据,如字符串.数字.布尔等. 根据特点的不同分 ...

  7. OpenCV计算机视觉学习(14)——浅谈常见图像后缀(png, jpg, bmp)的区别(opencv读取语义分割mask的坑)

    如果需要处理的原图及代码,请移步小编的GitHub地址 传送门:请点击我 如果点击有误:https://github.com/LeBron-Jian/ComputerVisionPractice 本来 ...

  8. [NOIP2011 提高组] 聪明的质监员【题解】

    题目 小 T 是一名质量监督员,最近负责检验一批矿产的质量.这批矿产共有 \(n\) 个矿石,从 \(1\) 到 \(n\) 逐一编号,每个矿石都有自己的重量 \(w_i\) 以及价值 \(v_i\) ...

  9. Oracle使用SQL截取某字符串

    很多小伙伴在使用Oracle的时候,想通过SQL来提取根据某一字符串截取来获得的字符串,他苦于对SQL不是很熟悉,但是现在你可以放心啦,现在先恭喜你找到了答案.因为在这里我已经为你写好了相关的函数以及 ...

  10. 【go语言】2.2.1 数组和切片

    数组和切片是 Go 语言中常用的数据结构,它们都可以存储多个同类型的元素. 数组 数组是具有固定长度的数据类型,它的长度在定义时就已经确定,不能随意改变. 你可以使用以下方式定义一个数组: var a ...