首页 > 数据库 >MySQL--半同步复制与参数slave_compressed_protocol

MySQL--半同步复制与参数slave_compressed_protocol

时间:2023-02-13 11:13:29浏览次数:54  
标签:02 00 slave -- 08 compressed 2023 13T09 44

问题场景

MySQL版本:5.7.26-29-log Percona Server (GPL)

操作系统版本:CentOS Linux release 7.6.1810 (Core)

BINLOG产生速度:

问题描述

配置半同步的集群频繁报警,提示集群主节点状态rpl_semi_sync_master_clients=0,即从半同步状态退化为异步状态。

查看主从复制正常,但从库错误日志中有:

2023-02-13T09:44:00.700625+08:00 160 [ERROR] Error reading packet from server for channel '': Lost connection to MySQL server during query (server_errno=2013)
2023-02-13T09:44:00.700652+08:00 160 [Warning] Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information.
2023-02-13T09:44:02.177640+08:00 160 [ERROR] Error reading packet from server for channel '': Lost connection to MySQL server during query (server_errno=2013)
2023-02-13T09:44:02.177670+08:00 160 [Warning] Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information.
2023-02-13T09:44:05.965457+08:00 160 [ERROR] Error reading packet from server for channel '': Lost connection to MySQL server during query (server_errno=2013)
2023-02-13T09:44:05.965486+08:00 160 [Warning] Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information.

主库错误日志中有:

--
2023-02-13T09:44:00.700648+08:00 0 [ERROR] /home/q/mysql/multi/3309/private/bin/mysqld: Got an error reading communication packets
2023-02-13T09:44:00.702066+08:00 232112955 [Note] While initializing dump thread for slave with UUID <9b1ee63e-ebba-11ec-83a2-84656961b909>, found a zombie dump thread with the same UUID. Master is killing the zombie dump thread(232112906).
2023-02-13T09:44:00.702106+08:00 232112906 [Note] Stop semi-sync binlog_dump to slave (server_id: 30165)
2023-02-13T09:44:00.702115+08:00 232112906 [Note] Semi-sync replication switched OFF.
2023-02-13T09:44:00.702160+08:00 232112955 [Note] Start binlog_dump to master_thread_id(232112955) slave_server(30165), pos(, 4)
--
2023-02-13T09:44:02.177660+08:00 0 [ERROR] /home/q/mysql/multi/3309/private/bin/mysqld: Got an error reading communication packets
2023-02-13T09:44:02.179184+08:00 232112972 [Note] While initializing dump thread for slave with UUID <9b1ee63e-ebba-11ec-83a2-84656961b909>, found a zombie dump thread with the same UUID. Master is killing the zombie dump thread(232112955).
2023-02-13T09:44:02.179226+08:00 232112955 [Note] Stop semi-sync binlog_dump to slave (server_id: 30165)
2023-02-13T09:44:02.179238+08:00 232112955 [Note] Semi-sync replication switched OFF.
2023-02-13T09:44:02.179281+08:00 232112972 [Note] Start binlog_dump to master_thread_id(232112972) slave_server(30165), pos(, 4)
--
2023-02-13T09:44:05.965481+08:00 0 [ERROR] /home/q/mysql/multi/3309/private/bin/mysqld: Got an error reading communication packets
2023-02-13T09:44:05.966863+08:00 232113022 [Note] While initializing dump thread for slave with UUID <9b1ee63e-ebba-11ec-83a2-84656961b909>, found a zombie dump thread with the same UUID. Master is killing the zombie dump thread(232112972).
2023-02-13T09:44:05.966897+08:00 232112972 [Note] Stop semi-sync binlog_dump to slave (server_id: 30165)
2023-02-13T09:44:05.966916+08:00 232112972 [Note] Semi-sync replication switched OFF.
2023-02-13T09:44:05.966948+08:00 232113022 [Note] Start binlog_dump to master_thread_id(232113022) slave_server(30165), pos(, 4)

PS: MySQL参数log_warnings用于控制错误日志的输出详细情况。

主节点产生BINLOG速度较慢,约10天才产生300MB的BINLOG日志。

解决办法

经排查发现,该问题主要由MySQL参数slave_compressed_protocol再半同步场景下引发的BUG,在主从节点上关闭该参数并重启复制即可解决。

相关连接

标签:02,00,slave,--,08,compressed,2023,13T09,44
From: https://www.cnblogs.com/gaogao67/p/17115632.html

相关文章

  • 在低代码开发平台 ILLA Cloud 中使用 Hugging Face 上的模型
    ILLACloud是一个面向开发者的开源低代码开发平台,平台专注于帮助开发者快速建立企业内部应用,为开发者节约数据调用与页面设计的时间。平台具有面向开发者、数据整合、协......
  • AD22 PCB导出Gerber文件详细步骤
    PCB绘制好,检查完成后,就可以把文件交给PCB工厂生产了,一般有两种方式:第一种最简单就是直接将PCB文件压缩打包,发给工厂。第二种生成Gerber等相关资料,再压缩打包,发给......
  • 用Promise封装一个ajax
    <!DOCTYPEhtml><htmllang="en"><head><metacharset="UTF-8"/><metahttp-equiv="X-UA-Compatible"content="IE=edge"/><metaname="viewport"co......
  • redis概述与redis下载&安装
     redis概述与redis下载&安装redis概述 redis是一款高性能的NOSQL系列的非关系型数据库什么是NOSQLNoSQL(NoSQL=NotOnlySQL),意即“不仅仅是SQL”,是一项......
  • 虚拟DOM
    虚拟DOM就是用JS来模拟DOM结构。当用传统的api或jQuery去操作DOM时,浏览器会从构建DOM树开始从头到尾执行一遍流程。比如当你在一次操作时,需要更新10个DOM节点,理想状......
  • CesiumJS PrimitiveAPI 高级着色入门 - 从参数化几何与 Fabric 材质到着色器 - 下篇
    目录3.使用GLSL着色器3.1.为Fabric材质添加自定义着色代码-Fabric材质的本质3.2.社区实现案例-泛光墙体和流动线材质3.3.直接定义外观对象的两个着色器3.4.*......
  • 面向对象和面向过程的区别
    前言壹哥相信,经过你对前面文章中技术点的学习,现在的你应该已经对Java具备了初步的了解和掌握,这为我们继续往后学习奠定了良好的基础。我们知道,Java是面向对象的编程语言,......
  • 复杂条件查询功能
    复杂条件查询功能-分析  复杂条件查询功能-代码实现-每页数据条件查询packagecom.example.day17_case.service.impl;importcom.example.day17_case.dao.UserDa......
  • Arrays.asList报错:java.lang.UnsupportedOperationException
    问题描述以下代码中,给List对象添加元素的时候,会报错packagecom.example;importjava.util.Arrays;importjava.util.List;publicclassDemo{publicstaticvoidmain......
  • Java:SpringBoot整合Sharding-Jdbc实现数据库读写分离
    读写分离实现效果:写操作使用master主库,读操作使用slave从库依赖<dependency><groupId>com.baomidou</groupId><artifactId>mybatis-plus-boot-starter</artifactId>......