问题:mysql同步经常会遇到报错目前整理了一下解决可提前避免
现象:同步经常报错停止
解决方案:
 
数据库配置(备端执行)
                               
set global max_allowed_packet=800*1024*1024;
set global max_connections = 1000;
show variables like 'innodb_flush_log_at_trx_commit';
show variables like 'sync_binlog';
set global innodb_flush_log_at_trx_commit=2;
set global sync_binlog=10;
 
配置文件
添加2行启用压缩
src.db.url.options.mysql={"useCompression":"true"}
tgt.db.url.options.mysql={"useCompression":"true"}

2行去掉注释(先同步数据后建索引和约束)
create.table.drop.then.add=pk,uk,fk,index
create.table.reserve.pkoruc1.on.drop=true