2021-12-20 14:12:46 +08:00

106 lines
6.1 KiB
Plaintext

combine setp:
1、maintain server
cd /data/git/dev_ops/wjtx_tools/ops_tools
python wjtx.py changestatus -m maintain -o add -s 616-619
python wjtx.py changestatus -m maintain -o add -s 1-91
python wjtx.py changestatus -m maintain -o add -s 209-642
python wjtx.py changestatus -m maintain -o remove -s 1-91
python wjtx.py changestatus -m maintain -o remove -s 209-642
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.py initdb -s 616
cd /root/opensource/migrate_server/wjtx/tools/combine_db/script/out
mysql -uroot -p0usmUwROtWjf -h10.10.6.2 legend_616 -e"source all.sql"
cd ..
python import_redis.py 10.10.6.246 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.py changestatus -m maintain -o remove -s 616-619
cd /data/git/dev_ops/wjtx_tools/ops_tools && python wjtx.py autoload
========================================clear old data============================================
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)
========================================check combine data=========================================
mysql -uroot -p0usmUwROtWjf -h10.10.6.2 legend_636 -e"select count(1),server_id from user group by server_id;"
==========================================step 1===============================================
10.10.6.114-117
python wjtx.py changestatus -m maintain -o add -s 668-675
mysqldump --default-character-set=utf8 -uwjtx -pmMWA4DKCfeOL -h10.10.6.2 legend_668 >legend_668.sql
mysqldump --default-character-set=utf8 -uwjtx -pmMWA4DKCfeOL -h10.10.6.2 legend_669 >legend_669.sql
mysqldump --default-character-set=utf8 -uwjtx -pmMWA4DKCfeOL -h10.10.6.2 legend_670 >legend_670.sql
mysqldump --default-character-set=utf8 -uwjtx -pmMWA4DKCfeOL -h10.10.6.2 legend_671 >legend_671.sql
mysqldump --default-character-set=utf8 -uwjtx -pmMWA4DKCfeOL -h10.10.6.2 legend_672 >legend_672.sql
mysqldump --default-character-set=utf8 -uwjtx -pmMWA4DKCfeOL -h10.10.6.2 legend_673 >legend_673.sql
mysqldump --default-character-set=utf8 -uwjtx -pmMWA4DKCfeOL -h10.10.6.2 legend_674 >legend_674.sql
mysqldump --default-character-set=utf8 -uwjtx -pmMWA4DKCfeOL -h10.10.6.2 legend_675 >legend_675.sql
python wjtx.py initdb -s 668
mysql -uroot -p0usmUwROtWjf -h10.10.6.2 legend_668 -e"source all.sql"
python import_redis.py 10.10.6.114 6381 out/game_redis.script
python import_redis.py 10.10.6.4 6379 out/global_redis.script
close 10.10.6.115,116,117
python wjtx.py changestatus -m maintain -o remove -s 668-675
==========================================step 2===============================================
10.10.6.118-121
python wjtx.py changestatus -m maintain -o add -s 676-683
mysqldump --default-character-set=utf8 -uwjtx -pmMWA4DKCfeOL -h10.10.6.2 legend_676 >legend_676.sql
mysqldump --default-character-set=utf8 -uwjtx -pmMWA4DKCfeOL -h10.10.6.2 legend_677 >legend_677.sql
mysqldump --default-character-set=utf8 -uwjtx -pmMWA4DKCfeOL -h10.10.6.2 legend_678 >legend_678.sql
mysqldump --default-character-set=utf8 -uwjtx -pmMWA4DKCfeOL -h10.10.6.2 legend_679 >legend_679.sql
mysqldump --default-character-set=utf8 -uwjtx -pmMWA4DKCfeOL -h10.10.6.2 legend_680 >legend_680.sql
mysqldump --default-character-set=utf8 -uwjtx -pmMWA4DKCfeOL -h10.10.6.2 legend_681 >legend_681.sql
mysqldump --default-character-set=utf8 -uwjtx -pmMWA4DKCfeOL -h10.10.6.2 legend_682 >legend_682.sql
mysqldump --default-character-set=utf8 -uwjtx -pmMWA4DKCfeOL -h10.10.6.2 legend_683 >legend_683.sql
python wjtx.py initdb -s 676
mysql -uroot -p0usmUwROtWjf -h10.10.6.2 legend_676 -e"source all.sql"
python import_redis.py 10.10.6.118 6381 out/game_redis.script
python import_redis.py 10.10.6.4 6379 out/global_redis.script
close 10.10.6.119,120,121
python wjtx.py changestatus -m maintain -o remove -s 676-683
=======================================step 3===============================================
10.10.6.230 246
python wjtx.py changestatus -m maintain -o add -s 616-651
mysqldump --default-character-set=utf8 -uwjtx -pmMWA4DKCfeOL -h10.10.6.2 legend_616 >legend_616.sql
mysqldump --default-character-set=utf8 -uwjtx -pmMWA4DKCfeOL -h10.10.6.2 legend_636 >legend_636.sql
python wjtx.py initdb -s 616
mysql -uroot -p0usmUwROtWjf -h10.10.6.2 legend_616 -e"source all.sql"
python import_redis.py 10.10.6.246 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 616
redis-cli -h 10.10.6.4 hdel hefu_info 636
python wjtx.py changestatus -m maintain -o remove -s 616-651
=======================================step 4===============================================
10.10.6.106,108,112
python wjtx.py changestatus -m maintain -o add -s 652-667
mysqldump --default-character-set=utf8 -uwjtx -pmMWA4DKCfeOL -h10.10.6.2 legend_652 >legend_652.sql
mysqldump --default-character-set=utf8 -uwjtx -pmMWA4DKCfeOL -h10.10.6.2 legend_656 >legend_656.sql
mysqldump --default-character-set=utf8 -uwjtx -pmMWA4DKCfeOL -h10.10.6.2 legend_664 >legend_664.sql
python wjtx.py initdb -s 652
mysql -uroot -p0usmUwROtWjf -h10.10.6.2 legend_652 -e"source all.sql"
python import_redis.py 10.10.6.106 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 652
redis-cli -h 10.10.6.4 hdel hefu_info 656
redis-cli -h 10.10.6.4 hdel hefu_info 664
python wjtx.py changestatus -m maintain -o remove -s 652-667