mysql 集群恢复
准备使用集群的时候发现集群起不来,
发现抱错集群各个节点都是readonly 状态,找了很多资料,由于集群处于不一致的情况需要防止不同的节点数据写入脏数据
取消节点readonly 方法如下:
MySQL 取消 super read only
直接关闭read only 模式
SET GLOBAL super_read_only = OFF;
登录 mysqlsh 执行
dba.configureLocalInstance()
Dba.configureLocalInstance: This function is not available through a session to an instance belonging to an unmanaged asynchronous replication topology (RuntimeError)
shell.connect('root@node1:3306')
Creating a session to 'root@node1:3306'
Fetching schema names for autocompletion... Press ^C to stop.
Closing old connection...
Your MySQL connection id is 215
Server version: 8.0.30 MySQL Community Server - GPL
No default schema selected; type \use <schema> to set one.
看到一个帖子说创建了一个集群就好了
开始创建集群:
var cluster = dba.createCluster('testCluster')A new InnoDB Cluster will be created on instance 'node1:3306'.Disabling super_read_only mode on instance 'node1:3306'.
Validating instance configuration at node1:3306...This instance reports its own address as node1:3306Instance configuration is suitable.
NOTE: Group Replication will communicate with other members using 'node1:3306'. Use the localAddress option to override.Creating InnoDB Cluster 'testCluster' on 'node1:3306'...Adding Seed Instance...
NOTE: User 'mysql_innodb_cluster_1891693795'@'%' already existed at instance 'node1:3306'. It will be deleted and created again with a new password.
Cluster successfully created. Use Cluster.addInstance() to add MySQL instances.
创建成功,添加实例
cluster.addInstance('root@node2:3306');
结果报错:
cluster.addInstance('root@node2:3306');WARNING: A GTID set check of the MySQL instance at 'node2:3306' determined that it contains transactions that do not originate from the cluster, which must be discarded before it can join the cluster.node2:3306 has the following errant GTIDs that do not exist in the cluster:
45fc6a70-48a9-11ed-adfc-000c29325d80:1WARNING: Discarding these extra GTID events can either be done manually or by completely overwriting the state of node2:3306 with a physical snapshot from an existing cluster member. To use this method by default, set the 'recoveryMethod' option to 'clone'.Having extra GTID events is not expected, and it is recommended to investigate this further and ensure that the data can be removed prior to choosing the clone recovery method.Please select a recovery method [C]lone/[A]bort (default Abort): C
Validating instance configuration at node2:3306...This instance reports its own address as node2:3306Instance configuration is suitable.
NOTE: Group Replication will communicate with other members using 'node2:3306'. Use the localAddress option to override.A new instance will be added to the InnoDB cluster. Depending on the amount of
data on the cluster this might take from a few seconds to several hours.Adding instance to the cluster...NOTE: User 'mysql_innodb_cluster_1780669600'@'%' already existed at instance 'node1:3306'. It will be deleted and created again with a new password.
Monitoring recovery process of the new cluster member. Press ^C to stop monitoring and let it continue in background.
Clone based state recovery is now in progress.NOTE: A server restart is expected to happen as part of the clone process. If the
server does not support the RESTART command or does not come back after a
while, you may need to manually start it back.* Waiting for clone to finish...
NOTE: node2:3306 is being cloned from node1:3306
** Stage DROP DATA: Completed
** Clone Transfer FILE COPY ############################################################ 100% CompletedPAGE COPY ############################################################ 100% CompletedREDO COPY ############################################################ 100% CompletedNOTE: node2:3306 is shutting down...* Waiting for server restart... ready
* node2:3306 has restarted, waiting for clone to finish...
** Stage RESTART: Completed
* Clone process has finished: 75.75 MB transferred in about 1 second (~75.75 MB/s)State recovery already finished for 'node2:3306'The instance 'node2:3306' was successfully added to the cluster.
实例中有的gts没同步过来,需要同步选择C 复制过来,第二个实例也添加成功了
再添加第三个实例
查看集群状态
cluster.status();
cluster.status();
{"clusterName": "testCluster", "defaultReplicaSet": {"name": "default", "primary": "node1:3306", "ssl": "REQUIRED", "status": "OK", "statusText": "Cluster is ONLINE and can tolerate up to ONE failure.", "topology": {"node1:3306": {"address": "node1:3306", "memberRole": "PRIMARY", "mode": "R/W", "readReplicas": {}, "replicationLag": "applier_queue_applied", "role": "HA", "status": "ONLINE", "version": "8.0.30"}, "node2:3306": {"address": "node2:3306", "memberRole": "SECONDARY", "mode": "R/O", "readReplicas": {}, "replicationLag": "applier_queue_applied", "role": "HA", "status": "ONLINE", "version": "8.0.30"}, "node3:3306": {"address": "node3:3306", "memberRole": "SECONDARY", "mode": "R/O", "readReplicas": {}, "replicationLag": "applier_queue_applied", "role": "HA", "status": "ONLINE", "version": "8.0.30"}}, "topologyMode": "Single-Primary"}, "groupInformationSourceMember": "node1:3306"
}
集群状态运行正常
相关文章:
mysql 集群恢复
准备使用集群的时候发现集群起不来, 发现抱错集群各个节点都是readonly 状态,找了很多资料,由于集群处于不一致的情况需要防止不同的节点数据写入脏数据 取消节点readonly 方法如下: MySQL 取消 super read only 直接关闭read…...
基于STM32的色彩识别与分类算法优化
基于STM32的色彩识别与分类算法优化是一项与图像处理和机器学习相关的研究任务,旨在实现高效的色彩识别和分类算法在STM32微控制器上的运行。本文将介绍基于STM32的色彩识别与分类算法优化的原理和实现步骤,并提供相应的代码示例。 1. 色彩识别与分类概…...
阿里云发送短信
官方代码如下: // This file is auto-generated, dont edit it. Thanks. package com.aliyun.sample;import com.aliyun.tea.*;public class Sample {/*** 使用AK&SK初始化账号Client* param accessKeyId* param accessKeySecret* return Client* throws Excep…...
关于用css设置input输入框hover的时候的样式以及当input为disabled的时候,不要让hover样式生效
效果如果: 编辑状态下的时候: 只读状态下的时候: 代码如图: <input type"text" name"dataForm.exportCode" id"exportCodeItem" required :disabled"editDisabled" />input:not(…...
hadoop在本地创建文件,然后将文件拷贝/上传到HDFS
1.要$cd {对应目录}进入到对应目录,一般为 cd /usr/local/hadoop/ 2.创建文件,$sudo gedit {文件名},例 sudo gedit test.txt 然后在弹出的txt文件输入内容,点击右上角的保存之后,关闭即可。 3.拷贝本地文件到HDF…...
NFC:应用场景广泛的短距离通信技术
NFC:应用场景广泛的短距离通信技术 一、NFC 技术介绍1.1 NFC 技术应用场景1.2 NFC 技术优点1.3 NFC 工作原理 二、NFC 开发2.1 NFC 应用开发流程2.2 NFC 读取和写入2.3 NFC 读写功能示例 三、总结 一、NFC 技术介绍 NFC (Near-field communication&…...
CentOS使用docker安装OpenGauss数据库
1.搜索OpenGauss docker search opengauss 2.选择其中一个源拉取 docker pull docker.io/enmotech/opengauss 3.运行OpenGauss docker run --name opengauss --privilegedtrue --restartalways -d -e GS_USERNAMEpostgres -e GS_PASSWORDmyGauss2023 -p 5432:5432 docker.…...
原理Redis-QuickList
QuickList **问题1:**ZipList虽然节省内存,但申请内存必须是连续空间,如果内存占用较多,申请内存效率很低。怎么办? 为了缓解这个问题,我们必须限制ZipList的长度和entry大小。 **问题2:**但是…...
js双击修改元素内容并提交到后端封装实现
前面发过一个版本了,后来又追加了些功能。重新发一版。新版支持select和radio。 效果图: 右上角带有绿标的,是可以修改的单元格。如果不喜欢显示绿标,可以传递参数时指定不显示,如果想改为其它颜色,也可以…...
Kubernetes+Gitlab+Jenkins+ArgoCD多集群部署
KubernetesGitlabJenkinsArgoCD多集群部署 文章目录 KubernetesGitlabJenkinsArgoCD多集群部署1. KubernetesGitlabJenkinsArgoCD多集群部署2. 添加WebHooks自动触发3. Jenkins-构建-执行Shell4. 制作镜像及修改Yaml文件4.1 Dockerfile4.2 Build-Shell 5.自动部署Demo测试5.1 推…...
在中国企业出海的大浪潮下,亚马逊云科技提供遍及全球的基础设施和技术支持
中国技术出海是中国企业更高层次更高质量的全球化。在人类文明发展史上,凝聚中国古人智慧结晶的造纸术、印刷术、火药、指南针等,曾为中国技术出海写下过浓墨重彩的一笔。在今天,如金山办公、店匠科技、ADVANCE.AI等公司又以技术立业…...
前端如何判空
这样判空就会报错 loadNode(node, resolve)console.log("node")console.log(node)if (node.data ! null) {this.get(ctx /publicity/publicityType/typeTreeData?id node.data.id).then((res) > {resolve(res)})}}, 需要这样写,用typeof来做类型判…...
基于SSM的焦作旅游协会管理系统设计与实现
末尾获取源码 开发语言:Java Java开发工具:JDK1.8 后端框架:SSM 前端:采用JSP技术开发 数据库:MySQL5.7和Navicat管理工具结合 服务器:Tomcat8.5 开发软件:IDEA / Eclipse 是否Maven项目&#x…...
庖丁解牛:NIO核心概念与机制详解 07 _ 字符集
文章目录 Pre概述编码/解码处理文本的正确方式示例程序Code Pre 庖丁解牛:NIO核心概念与机制详解 01 庖丁解牛:NIO核心概念与机制详解 02 _ 缓冲区的细节实现 庖丁解牛:NIO核心概念与机制详解 03 _ 缓冲区分配、包装和分片 庖丁解牛&…...
ansible的基本安装
目录 一、简介 1.ansible自动化运维人工运维时代 2.自动化运维时代 3.ansible介绍 4.ansible特点 二、ansible实践 1.环境 2.ansible管理安装 3.ansible被管理安装 4.管理方式 5.添加被管理机器的ip 6.ssh密码认证方式管理 三、配置免密登录 1.ansible自带的密码…...
开发仿抖音APP遇到的问题和解决方案
uni-app如何引入阿里矢量库图标/uniapp 中引入 iconfont 文件报错文件查找失败 uni-app如何引入阿里矢量库图标 - 知乎 uniapp 中引入 iconfont 文件报错文件查找失败:‘./iconfont.woff?t1673007495384‘ at App.vue:6_宝马金鞍901的博客-CSDN博客 将课件中的cs…...
手机上玩.NET的两种方式
少见!手机上玩 .NET_哔哩哔哩_bilibili 小米平板敲代码,termux安装dotnet和vscode_哔哩哔哩_bilibili 都是先容器加载linux rootfs,然后安装 linux-arm64 版本的 dotnet 命令行方式运行 dotnet,代码编辑到是可以安装使用 vscode…...
DedeBIZ 管理系统 DedeV6 v6.2.6 社区版 免费授权版
DedeBIZ 系统:开源、安全、高效的 DedeV6 v6.2.6 社区版 DedeBIZ 系统是基于 PHP 7 版本开发的,具有强大的可扩展性,并且完全开放源代码。它采用现流行的 Go 语言设计开发,不仅拥有简单易用、灵活扩展的特性,还具备更…...
编译 CUDA加速的 OpenCV-4.8.0 版本
文章目录 前言一、编译环境二、前期准备三、CMake编译四、VS编译OpenCV.sln五、问题 前言 由于项目需要用上CUDA加速的OpenCV,编译时也踩了不少坑,所以这里记录一下。 一、编译环境 我的编译环境是: Win10 RTX4050 CUDA-12.0 CUDNN 8.9.…...
设计模式篇---外观模式
文章目录 概念结构实例总结 概念 外观模式:为子系统中的一组接口提供一个统一的入口。外观模式定义了一个高层接口,这个接口使得这一子系统更加容易使用。 外观模式引入了一个新的外观类,它为多个业务类的调用提供了一个统一的入口。主要优点…...
APK Installer:在Windows上轻松安装Android应用的终极指南
APK Installer:在Windows上轻松安装Android应用的终极指南 【免费下载链接】APK-Installer An Android Application Installer for Windows 项目地址: https://gitcode.com/GitHub_Trending/ap/APK-Installer 你是否曾经想在Windows电脑上使用Android应用&am…...
在Windows上安装APK文件?5个步骤让你告别安卓模拟器
在Windows上安装APK文件?5个步骤让你告别安卓模拟器 【免费下载链接】APK-Installer An Android Application Installer for Windows 项目地址: https://gitcode.com/GitHub_Trending/ap/APK-Installer 你是否曾经想在Windows电脑上直接运行Android应用&…...
探索开源散热管理的3个关键维度:智能调控、跨硬件协同与动态响应
探索开源散热管理的3个关键维度:智能调控、跨硬件协同与动态响应 【免费下载链接】FanControl.Releases This is the release repository for Fan Control, a highly customizable fan controlling software for Windows. 项目地址: https://gitcode.com/GitHub_T…...
告别IAP折腾:用涂鸦IoT平台给MCU做OTA升级,保姆级避坑指南(附SDK代码解析)
告别IAP折腾:用涂鸦IoT平台给MCU做OTA升级,保姆级避坑指南(附SDK代码解析) 嵌入式开发者们对IAP(In-Application Programming)应该都不陌生——这种直接在应用中编程的技术,让我们能够通过串口…...
3分钟在Windows上安装APK:APK-Installer极简指南
3分钟在Windows上安装APK:APK-Installer极简指南 【免费下载链接】APK-Installer An Android Application Installer for Windows 项目地址: https://gitcode.com/GitHub_Trending/ap/APK-Installer 你是否曾在Windows电脑上下载了安卓应用安装包(…...
STM32H750驱动正点原子1.3寸屏,这个SPI4参数没设对,屏幕会卡顿黑屏
STM32H750驱动正点原子1.3寸屏的SPI4参数优化指南 第一次在STM32H750核心板上成功点亮正点原子1.3寸屏时,那种成就感确实让人兴奋。但当我在压力测试阶段遇到屏幕突然黑屏、显示卡顿甚至必须连接调试器才能工作的诡异现象时,这种兴奋很快被困惑取代。经过…...
【C语言存算一体芯片开发必修课】:5个真实指令调用示例,覆盖卷积加速、内存映射与低功耗唤醒场景
更多请点击: https://intelliparadigm.com 第一章:C语言存算一体芯片开发概览与指令集架构基础 存算一体(Processing-in-Memory, PIM)芯片通过将计算单元嵌入存储阵列,显著降低数据搬运开销,成为突破“内存…...
Nexu全栈开发平台:一体化架构、Prisma数据层与生产部署实战
1. 项目概述:从零到一理解Nexu最近在开源社区里,一个名为“nexu-io/nexu”的项目引起了我的注意。乍一看这个名字,你可能会联想到“nexus”(连接点、核心),没错,这个项目的核心定位就是成为一个…...
华硕笔记本性能优化技术指南:G-Helper深度配置与硬件控制原理
华硕笔记本性能优化技术指南:G-Helper深度配置与硬件控制原理 【免费下载链接】g-helper G-Helper is a fast, native tool for tuning performance, fans, GPU, battery, and RGB on any Asus laptop or handheld - ROG Zephyrus, Flow, Strix, TUF, Vivobook, Zen…...
机器学习中的Grokking现象解析与优化策略
1. 现象解析:什么是Grokking?在机器学习训练过程中,我们有时会观察到一种奇特现象:模型在训练初期表现平平,验证集准确率长期停滞,却在某个时刻突然"顿悟"(Grokking)&…...
