Mysql 1864 主从错误解决方法
故障描述:
在mysql 主库上增加了一个主键操作,没过5分钟就接受到zabbix报警mysql主从同步异常停止信息,一首凉凉送给自己。。。。
查看现在主从状态
(root@192.168.1.2) [(none)]> show slave status\G
Slave_IO_Running: Yes
Slave_SQL_Running: No
Replicate_Do_DB:
Replicate_Ignore_DB:
Replicate_Do_Table:
Replicate_Ignore_Table:
Replicate_Wild_Do_Table:
Replicate_Wild_Ignore_Table:
Last_Errno:
Last_Error: Cannot schedule event Update_rows, relay-log name ./log-relaynew., position to Worker thread because its size exceeds of slave_pending_jobs_size_max. #从last_sql_error 错误信息,可以看出是因为slave_pending_jobs_size_max 值引起的,默认值16777216,但是接收到的是16777713,所以导致主从同步停止。
处理步骤如下:
1、查看主库max_allowed_packet的大小
(root@192.168.1.1) [(none)]> show variables like 'max_allowed_packet';
+--------------------+----------+
| Variable_name | Value |
+--------------------+----------+
| max_allowed_packet | |
+--------------------+----------+
row in set (0.00 sec)
2、设置从库slave_pending_jobs_size_max的大小,注意,需要大于主库max_allowed_packet的大小
(root@192.168.1.2) [(none)]> stop slave;
Query OK, 0 rows affected (0.00 sec)
(root@192.168.1.2) [(none)]> set global slave_pending_jobs_size_max=52428800;
Query OK, rows affected, warning (0.00 sec)
(root@192.168.1.2) [(none)]> show variables like '%slave_pending_jobs%';
+-----------------------------+----------+
| Variable_name | Value |
+-----------------------------+----------+
| slave_pending_jobs_size_max | 52428800 |
+-----------------------------+----------+
1 row in set (0.01 sec)
(root@192.168.1.2) [(none)]> start slave;
Query OK, 0 rows affected (0.01 sec)
3、查看主从同步状态
(root@192.168.1.2) [(none)]> show slave status\G
*************************** . row ***************************
Slave_IO_State: Waiting for master to send event
Master_Host: 192.168.1.1
Master_User: repl
Master_Port:
Connect_Retry:
Master_Log_File: log-bin.
Read_Master_Log_Pos:
Relay_Log_File: log-relaynew.
Relay_Log_Pos:
Relay_Master_Log_File: log-bin.
Slave_IO_Running: Yes
Slave_SQL_Running: Yes
Replicate_Do_DB:
Replicate_Ignore_DB:
Replicate_Do_Table:
Replicate_Ignore_Table:
Replicate_Wild_Do_Table:
Replicate_Wild_Ignore_Table:
Last_Errno:
Last_Error:
Skip_Counter:
Exec_Master_Log_Pos:
Relay_Log_Space:
Until_Condition: None
Until_Log_File:
Until_Log_Pos:
Master_SSL_Allowed: No
Master_SSL_CA_File:
Master_SSL_CA_Path:
Master_SSL_Cert:
Master_SSL_Cipher:
Master_SSL_Key:
Seconds_Behind_Master:
Master_SSL_Verify_Server_Cert: No
Last_IO_Errno:
Last_IO_Error:
Last_SQL_Errno:
Last_SQL_Error:
Replicate_Ignore_Server_Ids:
Master_Server_Id:
Master_UUID: 872aba0b-b543-11e6-9ce1-0cc47a581d8c
Master_Info_File: mysql.slave_master_info
SQL_Delay:
SQL_Remaining_Delay: NULL
Slave_SQL_Running_State: Slave has read all relay log; waiting for more updates
Master_Retry_Count:
Master_Bind:
Last_IO_Error_Timestamp:
Last_SQL_Error_Timestamp:
Master_SSL_Crl:
Master_SSL_Crlpath:
Retrieved_Gtid_Set: 872aba0b-b543-11e6-9ce1-0cc47a581d8c:-
Executed_Gtid_Set: 1bf68f85-ef7c-11e8-bad9-0cc47abcef86:-,
872aba0b-b543-11e6-9ce1-0cc47a581d8c:-
Auto_Position:
Replicate_Rewrite_DB:
Channel_Name:
Master_TLS_Version:
row in set (0.00 sec)
搞定!!
Tips:
slave_pending_jobs_size_max的用途:
在多线程复制时,在队列中Pending的事件所占用的最大内存,默认为16M,如果内存富余,或者延迟较大时,可以适当调大;注意这个值要比主库的max_allowed_packet大!
Mysql 1864 主从错误解决方法的更多相关文章
- 安装Mysql提示1045错误解决方法
MySQL安装提示一下错误 The security settings could not be applied to the database because the connection has ...
- MySQL or MariaDB 错误解决方法之报错代码1045
phpMyAdmin登录报错:mysqli_real_connect(): (28000/1045): Access denied for user 'root'@'localhost' (using ...
- 解决mysql 1864 主从错误
从字面意思看了一下是因为slave_pending_jobs_size_max默认值为16777216(16MB),但是slave接收到的slave_pending_jobs_size_max为 ...
- django中mysql数据库设置错误解决方法
刚在django中settings.py进行设置mysql数据库. 当进行执行python manage.py shell命令时会报以下错误: 只需要在settings.py中 DATABASES = ...
- MySQL的1067错误解决方法
今天在学校的时候MySQL还运行的好好的,关机来公司后MySQL一直报错,错误为1067,网上找了好多办法,但是大都没效果,因此对这个错误做个总结: 打开你的安装目录下,查看my.ini文件中MySQ ...
- mysql Access denied for user root@localhost错误解决方法总结(转)
mysql Access denied for user root@localhost错误解决方法总结(转) mysql Access denied for user \'root\'@\'local ...
- MySQL程序端启动密码错误解决方法
MySQL程序端启动密码错误解决方法 一般启动MySQL程序端,都是用mysql -uroot -p命令,当然前提是你的环境变量已经配好了. 为了连接服务器,当调用mysql时,通常需要提供一个MyS ...
- mysql创建外链失败1005错误解决方法
mysql创建外链失败1005错误解决方法 错误号:1005错误信息:Can't create table 'webDB.#sql-397_61df' (errno: 150)解决方法 错误原因有四: ...
- 3分钟解决MySQL 1032 主从错误(转)
转自 https://blog.51cto.com/suifu/1845457 3分钟解决MySQL 1032主从错误 Part1:写在最前 1032错误----现在生产库中好多数据,在从库误删了, ...
随机推荐
- Codeforces Round #526 C - The Fair Nut and String /// 组合递推
题目大意: 给定原字符序列 找出其中所有子序列满足 1.序列内字符都为a 2.若有两个以上的字符 则相邻两个字符在原序列中两者之间存在字符b 的数量 将整个字符序列用b分开 此时再得到每个b之间a的数 ...
- QT5+Pylon
VS+QT+Pylon:配置一下包含文件和libs,具体参考pylon说明文档. Windows下 Qtcreator+Pylon:建议把include和libs文件夹拷贝至工作目录,然后修改.pr ...
- 网页布局WEB标准的HTML结构化
您正在学习WEB标准CSS网页布局吗?是不是还不能完全掌握纯CSS布局?通常有两种需要您特别注意: 第一种可能是你还没有理解CSS处理页面的原理.在你考虑你的页面整体表现效果前,你应当先考虑内容的语义 ...
- arm-linux-strip 的使用
3.2.1 1. 移除所有的符号信息 [arm@localhost gcc]#cp hello hello1 [arm@localhost gcc]#armlinuxstrip strip ...
- Erlang学习记录:相关工具和文档
在线工具和文档 网址 说明 OTP Reference Page Index 内置模块查询 Erlang/OTP Applications N Kernel Reference Manual 入门官方 ...
- mysql 数据库 内容的增删改查
/*所有字段插入值*//*注意插入值数目要与字段值一致*/INSERT INTO student VALUES(1,'熊大','123','2019-10-18',1200);INSERT INTO ...
- 廖雪峰Java16函数式编程-2Stream-2创建Stream
1. 方法1:把一个现有的序列变为Stream,它的元素是固定的 //1.直接通过Stream.of()静态方法传入可变参数进行创建 Stream<Integer> s = Stream. ...
- js 实现 map 工具类
/* * MAP对象,实现MAP功能 * * 接口: * size() 获取MAP元素个数 * isEmpty() 判断MAP是否为空 * clear() 删除MAP所有元素 * put(key, v ...
- 云-腾讯云-云点播:云点播(VOD)
ylbtech-云-腾讯云-云点播:云点播(VOD) 提供端到端的一站式VpaaS音视频点播解决方案 1.返回顶部 1. 云点播(Video on Demand,VOD)基于腾讯多年技术积累与基础设施 ...
- MDK 添加芯片支持 以STM32F103ZE为例
问题说明: 新建mdk工程时第一步是选芯片(以STM32F103ZE为例),但是芯片没有的话需要自己手动添加,如图: 解决方法: 下载KEIL MDK5以后是没有安装device的,如果此时创建工程会 ...