combine setp: 1、maintain server cd /data/git/dev_ops/wjtx_tools/ops_tools python wjtx_global_tools.py -m maintain -s 1-3 2、 close auto load in ops: 3、stop service && backup redis && backup mysql mysqldump --default-character-set=utf8 -uwjtx -pmMWA4DKCfeOL -h10.10.6.2 legend_241 >legend_241.sql 4、run scripts cd /root/opensource/migrate_server/wjtx/tools/combine_db/script python combine_db.py python combine_redis.py drop database cd /data/git/dev_ops/wjtx_tools/ops_tools && python wjtx_tools.py -t initdb -s 2008 cd /root/opensource/migrate_server/wjtx/tools/combine_db/script/out mysql -uroot -p0usmUwROtWjf -h10.10.6.2 legend_237 -e"source all.sql" cd .. python import_redis.py 10.10.6.59 6381 out/game_redis.script python import_redis.py 10.10.6.4 6379 out/global_redis.script 5、start service && change service to open && autoload python wjtx_global_tools.py -m open -s 1-3 cd /data/git/dev_ops/wjtx_tools/ops_tools && python wjtx_tools.py -t autoload clear_mysql: select count(1) FROM role WHERE login_time < '2020-11-01 00:00:00' AND total_rmb < 6 AND total_online_millis < 3600000 AND id not in (select role_id from role_marry) select count(id) from item where role_id not in (select id from role) select count(id) from role_mail where role_id not in (select id from role) select count(id) FROM `tribe_member` WHERE role_id NOT IN ( SELECT id FROM role) mysql -uroot -p0usmUwROtWjf -h10.10.6.2 legend_428 -e"select count(1),server_id from user group by server_id;" ====================================================step 1=============================================== 10.10.6.162-163 python wjtx.py change_server_status -m maintain -o add -s 448-451 mysqldump --default-character-set=utf8 -uwjtx -pmMWA4DKCfeOL -h10.10.6.2 legend_448 >legend_448.sql mysqldump --default-character-set=utf8 -uwjtx -pmMWA4DKCfeOL -h10.10.6.2 legend_449 >legend_449.sql mysqldump --default-character-set=utf8 -uwjtx -pmMWA4DKCfeOL -h10.10.6.2 legend_450 >legend_450.sql mysqldump --default-character-set=utf8 -uwjtx -pmMWA4DKCfeOL -h10.10.6.2 legend_451 >legend_451.sql python wjtx.py init_wjtx_mysql -s 448 mysql -uroot -p0usmUwROtWjf -h10.10.6.2 legend_448 -e"source all.sql" python import_redis.py 10.10.6.162 6381 out/game_redis.script python import_redis.py 10.10.6.4 6379 out/global_redis.script python wjtx.py change_server_status -m maintain -o remove -s 448-451 ====================================================step 2=============================================== 10.10.6.164-165 python wjtx.py change_server_status -m maintain -o add -s 452-455 mysqldump --default-character-set=utf8 -uwjtx -pmMWA4DKCfeOL -h10.10.6.2 legend_452 >legend_452.sql mysqldump --default-character-set=utf8 -uwjtx -pmMWA4DKCfeOL -h10.10.6.2 legend_453 >legend_453.sql mysqldump --default-character-set=utf8 -uwjtx -pmMWA4DKCfeOL -h10.10.6.2 legend_454 >legend_454.sql mysqldump --default-character-set=utf8 -uwjtx -pmMWA4DKCfeOL -h10.10.6.2 legend_455 >legend_455.sql python wjtx.py init_wjtx_mysql -s 452 mysql -uroot -p0usmUwROtWjf -h10.10.6.2 legend_452 -e"source all.sql" python import_redis.py 10.10.6.164 6381 out/game_redis.script python import_redis.py 10.10.6.4 6379 out/global_redis.script python wjtx.py change_server_status -m maintain -o remove -s 452-455 ====================================================step 3=============================================== 10.10.6.154,158,160 python wjtx.py change_server_status -m maintain -o add -s 432-447 mysqldump --default-character-set=utf8 -uwjtx -pmMWA4DKCfeOL -h10.10.6.2 legend_432 >legend_432.sql mysqldump --default-character-set=utf8 -uwjtx -pmMWA4DKCfeOL -h10.10.6.2 legend_440 >legend_440.sql mysqldump --default-character-set=utf8 -uwjtx -pmMWA4DKCfeOL -h10.10.6.2 legend_444 >legend_444.sql python wjtx.py init_wjtx_mysql -s 432 mysql -uroot -p0usmUwROtWjf -h10.10.6.2 legend_432 -e"source all.sql" python import_redis.py 10.10.6.154 6381 out/game_redis.script python import_redis.py 10.10.6.4 6379 out/global_redis.script redis-cli -h 10.10.6.4 hdel hefu_info 432 redis-cli -h 10.10.6.4 hdel hefu_info 440 redis-cli -h 10.10.6.4 hdel hefu_info 444 python wjtx.py change_server_status -m maintain -o remove -s 432-447 ====================================================step 3=============================================== 10.10.6.134,148 python wjtx.py change_server_status -m maintain -o add -s 392-431 mysqldump --default-character-set=utf8 -uwjtx -pmMWA4DKCfeOL -h10.10.6.2 legend_392 >legend_392.sql mysqldump --default-character-set=utf8 -uwjtx -pmMWA4DKCfeOL -h10.10.6.2 legend_420 >legend_420.sql python wjtx.py init_wjtx_mysql -s 392 mysql -uroot -p0usmUwROtWjf -h10.10.6.2 legend_392 -e"source all.sql" python import_redis.py 10.10.6.134 6381 out/game_redis.script python import_redis.py 10.10.6.4 6379 out/global_redis.script redis-cli -h 10.10.6.4 hdel hefu_info 392 redis-cli -h 10.10.6.4 hdel hefu_info 420 python wjtx.py change_server_status -m maintain -o remove -s 392-431