MYSQL迁移

mysql迁移

mysql从k8s集群迁移至阿里云RDS

开启源库BINLOG

源库不开启binlog无法使用dts进行增量迁移,5.7以上开启binlog方法(需重启)

log-bin=xxx          #binlog存储路径
expire_logs_days=7   #保留天数
server-id=xxx        #指定serverid

DTS要求binlog_format为row、binlog_row_image为full(默认参数)

开启DTS

 



调整目标库AUTO increment

use webim;
alter table webim_actionlogs AUTO_INCREMENT=10;
alter table webim_adminuser AUTO_INCREMENT=10;
alter table webim_against_rules_log AUTO_INCREMENT=10;
alter table webim_anticheatlog AUTO_INCREMENT=1300;
alter table webim_apilogs AUTO_INCREMENT=10;
alter table webim_blackipaddress AUTO_INCREMENT=200;
alter table webim_blocked AUTO_INCREMENT=10;
alter table webim_buddies AUTO_INCREMENT=1800000;
alter table webim_buddies_new AUTO_INCREMENT=5400000;
alter table webim_chathelperperday AUTO_INCREMENT=2500000;
alter table webim_commonquotations AUTO_INCREMENT=15000;
alter table webim_complaint AUTO_INCREMENT=3800;
alter table webim_complaint_logs AUTO_INCREMENT=1700;
alter table webim_complaint_reason AUTO_INCREMENT=15;
alter table webim_conversation AUTO_INCREMENT=4540000;
alter table webim_customerservice AUTO_INCREMENT=10;
alter table webim_datawarehouse_chatperday AUTO_INCREMENT=2500;
alter table webim_devicetoken AUTO_INCREMENT=7500000;
alter table webim_equallybody AUTO_INCREMENT=6900000;
alter table webim_equallybody_log AUTO_INCREMENT=10;
alter table webim_equallybody_rule AUTO_INCREMENT=15;
alter table webim_event_log AUTO_INCREMENT=1900;
alter table webim_forbiddenwords_everyuser AUTO_INCREMENT=10;
alter table webim_forbiddenwords_logs AUTO_INCREMENT=4500000;
alter table webim_forbiddenwords_perday AUTO_INCREMENT=4500000;
alter table webim_histories AUTO_INCREMENT=62000000;
alter table webim_illegal AUTO_INCREMENT=32000;
alter table webim_illegal_keywords_log AUTO_INCREMENT=600000;
alter table webim_illegalperday AUTO_INCREMENT=14000;
alter table webim_illegalperday_new AUTO_INCREMENT=1300000;
alter table webim_inventedchat_filepath AUTO_INCREMENT=400;
alter table webim_inventedchat_list AUTO_INCREMENT=180000;
alter table webim_inventedchat_task AUTO_INCREMENT=200;
alter table webim_inventedchat_tasktype AUTO_INCREMENT=10;
alter table webim_inventedchat_template AUTO_INCREMENT=100;
alter table webim_members AUTO_INCREMENT=7000000;
alter table webim_messageautorun AUTO_INCREMENT=4000000;
alter table webim_push AUTO_INCREMENT=120000000;
alter table webim_push_log AUTO_INCREMENT=20000000;
alter table webim_push_task_detail AUTO_INCREMENT=200000;
alter table webim_push_task_stat AUTO_INCREMENT=200000;
alter table webim_rooms AUTO_INCREMENT=10;
alter table webim_rule AUTO_INCREMENT=100;
alter table webim_ruletype AUTO_INCREMENT=15;
alter table webim_ruletype_copy AUTO_INCREMENT=10;
alter table webim_sendaudiody_perday AUTO_INCREMENT=2000000;
alter table webim_sendsms001 AUTO_INCREMENT=10000;
alter table webim_sendtimes AUTO_INCREMENT=3000000;
alter table webim_settings AUTO_INCREMENT=10000;
alter table webim_solveillegal AUTO_INCREMENT=150;
alter table webim_solveillegalmx AUTO_INCREMENT=400;
alter table webim_statistics_chatperday AUTO_INCREMENT=10;
alter table webim_timingtasksoneminute AUTO_INCREMENT=4000000;
alter table webim_visitorimei AUTO_INCREMENT=15000000;
alter table webim_visitorpush AUTO_INCREMENT=10;
alter table webim_visitorpushimei AUTO_INCREMENT=40000;
alter table webim_visitors AUTO_INCREMENT=3000000;

应用迁移

应用修改为最新库地址,重启应用,观察旧库有无数据增长。旧库无新增时,停止DTS增量任务。

 
posted @ 2024-10-29 11:09  羊脂玉净瓶  阅读(8)  评论(0)    收藏  举报