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.…...
设计模式篇---外观模式
文章目录 概念结构实例总结 概念 外观模式:为子系统中的一组接口提供一个统一的入口。外观模式定义了一个高层接口,这个接口使得这一子系统更加容易使用。 外观模式引入了一个新的外观类,它为多个业务类的调用提供了一个统一的入口。主要优点…...
Java - Mysql数据类型对应
Mysql数据类型java数据类型备注整型INT/INTEGERint / java.lang.Integer–BIGINTlong/java.lang.Long–––浮点型FLOATfloat/java.lang.FloatDOUBLEdouble/java.lang.Double–DECIMAL/NUMERICjava.math.BigDecimal字符串型CHARjava.lang.String固定长度字符串VARCHARjava.lang…...
CocosCreator 之 JavaScript/TypeScript和Java的相互交互
引擎版本: 3.8.1 语言: JavaScript/TypeScript、C、Java 环境:Window 参考:Java原生反射机制 您好,我是鹤九日! 回顾 在上篇文章中:CocosCreator Android项目接入UnityAds 广告SDK。 我们简单讲…...
爬虫基础学习day2
# 爬虫设计领域 工商:企查查、天眼查短视频:抖音、快手、西瓜 ---> 飞瓜电商:京东、淘宝、聚美优品、亚马逊 ---> 分析店铺经营决策标题、排名航空:抓取所有航空公司价格 ---> 去哪儿自媒体:采集自媒体数据进…...
10-Oracle 23 ai Vector Search 概述和参数
一、Oracle AI Vector Search 概述 企业和个人都在尝试各种AI,使用客户端或是内部自己搭建集成大模型的终端,加速与大型语言模型(LLM)的结合,同时使用检索增强生成(Retrieval Augmented Generation &#…...
智能AI电话机器人系统的识别能力现状与发展水平
一、引言 随着人工智能技术的飞速发展,AI电话机器人系统已经从简单的自动应答工具演变为具备复杂交互能力的智能助手。这类系统结合了语音识别、自然语言处理、情感计算和机器学习等多项前沿技术,在客户服务、营销推广、信息查询等领域发挥着越来越重要…...
LRU 缓存机制详解与实现(Java版) + 力扣解决
📌 LRU 缓存机制详解与实现(Java版) 一、📖 问题背景 在日常开发中,我们经常会使用 缓存(Cache) 来提升性能。但由于内存有限,缓存不可能无限增长,于是需要策略决定&am…...
Chrome 浏览器前端与客户端双向通信实战
Chrome 前端(即页面 JS / Web UI)与客户端(C 后端)的交互机制,是 Chromium 架构中非常核心的一环。下面我将按常见场景,从通道、流程、技术栈几个角度做一套完整的分析,特别适合你这种在分析和改…...
SpringAI实战:ChatModel智能对话全解
一、引言:Spring AI 与 Chat Model 的核心价值 🚀 在 Java 生态中集成大模型能力,Spring AI 提供了高效的解决方案 🤖。其中 Chat Model 作为核心交互组件,通过标准化接口简化了与大语言模型(LLM࿰…...
基于Uniapp的HarmonyOS 5.0体育应用开发攻略
一、技术架构设计 1.混合开发框架选型 (1)使用Uniapp 3.8版本支持ArkTS编译 (2)通过uni-harmony插件调用原生能力 (3)分层架构设计: graph TDA[UI层] -->|Vue语法| B(Uniapp框架)B --&g…...
使用VMware克隆功能快速搭建集群
自己搭建的虚拟机,后续不管是学习java还是大数据,都需要集群,java需要分布式的微服务,大数据Hadoop的计算集群,如果从头开始搭建虚拟机会比较费时费力,这里分享一下如何使用克隆功能快速搭建一个集群 先把…...
