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错误----现在生产库中好多数据,在从库误删了, ...
随机推荐
- nodejs--express安装失败的原因
1.检查更新所有的npm ,jade,或者ejs. 2.在用jade或ejs也是有区别的,jade适合个人秀,ejs更实用与商务. 3.express在4.+之后的版本都分离了,推荐用3.+的版本稳定 ...
- Southern African 2001 Stockbroker Grapevine /// Floyd oj1345
题目大意: 输入n 接下来n行 每行输入m 接下来m对a,b 若干个人之间会传播谣言,但每个人传播给其他人的速度都不一样, 问最快的传播路线(即耗时最短的)中最耗时的一个传播环节. 如果其中有人不在这 ...
- ThreadPoolTaskExecutor的配置使用
版权声明:本文为博主原创文章,遵循CC 4.0 by-sa版权协议,转载请附上原文出处链接和本声明. 本文链接:https://blog.csdn.net/ft305977550/article/de ...
- arm-linux-copydump 的使用
生成可以执行的 2 进制代码 [arm@localhost gcc]#armlinuxcopydump O binary hello hello.bin
- Android开发 了解ViewModel
前言 ViewModel是google推出的一个数据处理框架,ViewModel类是被设计用来以可感知生命周期的方式存储和管理 UI 相关数据ViewModel中数据会一直存活即使 activity ...
- JAVA算法之高级排序
本章介绍两种高级排序,希尔排序和快速排序,这两种排序比之前讲到的简单排序都要快很多:希尔排序大约需要O(N*(logN)2)的时间,快速排序的时间复杂度为(N*logN),这两种算法和我们在讲递归的时 ...
- 使用Element的upload上传组件,不使用action属性上传
1.需要实现的效果如下图,在点击提交的时候再提交file数据,和其他数据统一上传,我把file转换成了base64的格式,可以再上传之前显示缩略图 2.代码分析 action属性值为"#&q ...
- jq给页面添加覆盖层遮罩的实例
先引入jq代码,然后代码如下: $(function(){ var docHeight = $(document).height(); //获取窗口高度 $('body').append('<d ...
- Mysql ---Sqlserver数据迁移到Mysql(Mysql建表迁移数据)
1 试用了MysqlWorkBench的数据迁移功能 以为能实现:建立跟Sqlserver一样的表结构和视图的功能,sqlserver的数据迁移到mysql 实际上发现:即使勾选了表和视图,实际上却只 ...
- thinkphp 字段定义
通常每个模型类是操作某个数据表,在大多数情况下,系统会自动获取当前数据表的字段信息. 系统会在模型首次实例化的时候自动获取数据表的字段信息(而且只需要一次,以后会永久缓存字段信息,除非设置不缓存或者删 ...