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错误----现在生产库中好多数据,在从库误删了, ...
随机推荐
- Lombok 常用注解
Lombok Lombok 能以简单的注解形式来简化 java 代码,提高开发人员的开发效率.例如开发中经常需要写的 javaBean,都需要花时间去添加相应的 getter/setter,也许还要去 ...
- Git创建本地库过程
- SpringCloud学习笔记《---05 Zuul---》基础篇
- bootstrap 幻灯片(轮播)
<!DOCTYPE html><html><head> <meta charset="utf-8"> <titl ...
- keepalived中vrrp_script,track_script,notify的使用方法
keepalived中vrrp_script,track_script,notify的使用方法转自:https://blog.51cto.com/liuzhengwei521/1929589 可以在k ...
- 【JZOJ3422】水叮当的舞步
description 水叮当得到了一块五颜六色的格子形地毯作为生日礼物,更加特别的是,地毯上格子的颜色还能随着踩踏而改变. 为了讨好她的偶像虹猫,水叮当决定在地毯上跳一支轻盈的舞来卖萌~~~ 地毯上 ...
- System.Web.HttpSessionStateBase.cs
ylbtech-System.Web.HttpSessionStateBase.cs 1.程序集 System.Web, Version=4.0.0.0, Culture=neutral, Publi ...
- Linux 中执行Shell 脚本的方式(三种方法)
Shell 脚本的执行方式通常有如下三种: (1)bash script-name 或者 sh script-name:(2)path/script-name或者./script-name:(3)so ...
- SpringBoot--Banner的定制和关闭
SpringBoot项目启动的时候控制台会打印如下信息: 上面红色框框内的“SPRING BOOT”被称为Banner,意为横幅,默认会开启并在控制台打印,其实我们可以修改它的内容和样式,即定制:并选 ...
- PAT甲级——A1127 ZigZagging on a Tree【30】
Suppose that all the keys in a binary tree are distinct positive integers. A unique binary tree can ...