Mysql 1864 主从错误解决方法
2017年01月01日
从字面意思看了一下是因为slave_pending_jobs_size_max默认值为16777216(16MB),但是slave接收到的slave_pending_jobs_size_max为17085453(17M);
解决方案
从库执行如下SQL
mysql>stop slave; mysql>set global slave_pending_jobs_size_max=20000000; mysql> start slave;#在多线程复制时,在队列中Pending的事件所占用的最大内存,默认为16M,如果内存富余,或者延迟较大时,可以适当调大;注意
这个值要比主库的max_allowed_packet大
故障模拟:
从库设置
mysql> set global slave_parallel_workers=4; mysql> show variables like 'slave_parallel_workers'; +------------------------+-------+ | Variable_name | Value | +------------------------+-------+ |slave_parallel_workers | 4 | +------------------------+-------+ 1 row in set (0.00sec) mysql>set global slave_pending_jobs_size_max=1024; mysql> show variables like 'slave_pend%'; +-----------------------------+-------+ | Variable_name | Value | +-----------------------------+-------+ |slave_pending_jobs_size_max | 1024 | +-----------------------------+-------+ 1 row in set (0.00sec)主库操作:
mysql> update erp_mkpf set usnam='测试1864错误'; ERROR 1197 (HY000):Multi-statement transaction required more than 'max_binlog_cache_size' bytes ofstorage; increase this mysqld variable and try again mysql> set global max_binlog_cache_size=8388608000000; Query OK, 0 rowsaffected (0.00 sec) mysql> begin; Query OK, 0 rowsaffected (0.00 sec) mysql> update erp_mkpf set usnam='测试1864错误'; Query OK, 70466 rowsaffected (0.38 sec) Rows matched:70466 Changed: 70466 Warnings: 0 mysql> commit; Query OK, 0 rowsaffected (0.08 sec)从库查看状态:
mysql> show slavestatus\G Last_SQL_Errno: 1864 Last_SQL_Error: Cannot scheduleevent Update_rows, relay-log name ./HE1-relay-bin.000005, position 494 toWorker thread because its size 8200 exceeds 1024 ofslave_pending_jobs_size_max.以上所述是小编给大家介绍的Mysql 1864 主从错误解决方法,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对网站的支持!
相关阅读
-
熊猫发行30周年1盎司币价格今天多少一克(2024年05月17日)
-
9999千足金今日价格表(2024年5月17日)
-
第19届杭州亚运会纪念币金银套多少钱(2024年5月17日)
-
工商银行筑梦中华金条100克价格今天多少一克(2024年05月17日)
-
金至尊铂金多少钱一克(2024年05月17日)参考价格
-
2024版熊猫纪念币100克精制金币现在市场价是多少(2024年05月17日)
-
香港六福铂金多少钱一克(2024年05月17日)
-
周六福黄金价格今天多少一克(2024年05月17日)参考价格
-
六福珠宝黄金价格今天多少一克(2024年05月17日)
-
上海老庙黄金价格今天多少一克(2024年05月17日)