112 lines
5.9 KiB
Plaintext
112 lines
5.9 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_704 -e"select count(1),server_id from user group by server_id;"
|
|
==========================================step 1===============================================
|
|
10.10.6.132,133
|
|
python wjtx.py changestatus -m maintain -o add -s 704-707
|
|
|
|
mysqldump --default-character-set=utf8 -uwjtx -pmMWA4DKCfeOL -h10.10.6.2 legend_704 >legend_704.sql
|
|
mysqldump --default-character-set=utf8 -uwjtx -pmMWA4DKCfeOL -h10.10.6.2 legend_705 >legend_705.sql
|
|
mysqldump --default-character-set=utf8 -uwjtx -pmMWA4DKCfeOL -h10.10.6.2 legend_706 >legend_706.sql
|
|
mysqldump --default-character-set=utf8 -uwjtx -pmMWA4DKCfeOL -h10.10.6.2 legend_707 >legend_707.sql
|
|
|
|
python wjtx.py initdb -s 704
|
|
mysql -uroot -p0usmUwROtWjf -h10.10.6.2 legend_704 -e"source all.sql"
|
|
python import_redis.py 10.10.6.132 6381 out/game_redis.script
|
|
python import_redis.py 10.10.6.4 6379 out/global_redis.script
|
|
close 10.10.6.133
|
|
python wjtx.py changestatus -m maintain -o remove -s 704-707
|
|
==========================================step 2===============================================
|
|
10.10.6.135,136
|
|
python wjtx.py changestatus -m maintain -o add -s 708-711
|
|
|
|
mysqldump --default-character-set=utf8 -uwjtx -pmMWA4DKCfeOL -h10.10.6.2 legend_708 >legend_708.sql
|
|
mysqldump --default-character-set=utf8 -uwjtx -pmMWA4DKCfeOL -h10.10.6.2 legend_709 >legend_709.sql
|
|
mysqldump --default-character-set=utf8 -uwjtx -pmMWA4DKCfeOL -h10.10.6.2 legend_710 >legend_710.sql
|
|
mysqldump --default-character-set=utf8 -uwjtx -pmMWA4DKCfeOL -h10.10.6.2 legend_711 >legend_711.sql
|
|
|
|
python wjtx.py initdb -s 708
|
|
mysql -uroot -p0usmUwROtWjf -h10.10.6.2 legend_708 -e"source all.sql"
|
|
python import_redis.py 10.10.6.135 6381 out/game_redis.script
|
|
python import_redis.py 10.10.6.4 6379 out/global_redis.script
|
|
close 10.10.6.136
|
|
python wjtx.py changestatus -m maintain -o remove -s 708-711
|
|
=======================================step 3===============================================
|
|
10.10.6.134,230
|
|
python wjtx.py changestatus -m maintain -o add -s 520-615
|
|
|
|
mysqldump --default-character-set=utf8 -uwjtx -pmMWA4DKCfeOL -h10.10.6.2 legend_520 >legend_520.sql
|
|
mysqldump --default-character-set=utf8 -uwjtx -pmMWA4DKCfeOL -h10.10.6.2 legend_584 >legend_584.sql
|
|
|
|
python wjtx.py initdb -s 520
|
|
mysql -uroot -p0usmUwROtWjf -h10.10.6.2 legend_520 -e"source all.sql"
|
|
python import_redis.py 10.10.6.134 6382 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 520
|
|
redis-cli -h 10.10.6.4 hdel hefu_info 584
|
|
close 10.10.6.230
|
|
python wjtx.py changestatus -m maintain -o remove -s 520-615
|
|
=======================================step 4===============================================
|
|
10.10.6.246,122
|
|
python wjtx.py changestatus -m maintain -o add -s 616-691
|
|
|
|
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_684 >legend_684.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 684
|
|
python wjtx.py changestatus -m maintain -o remove -s 616-691
|
|
=======================================step 5===============================================
|
|
10.10.6.126,130
|
|
python wjtx.py changestatus -m maintain -o add -s 692-703
|
|
|
|
mysqldump --default-character-set=utf8 -uwjtx -pmMWA4DKCfeOL -h10.10.6.2 legend_692 >legend_692.sql
|
|
mysqldump --default-character-set=utf8 -uwjtx -pmMWA4DKCfeOL -h10.10.6.2 legend_700 >legend_700.sql
|
|
|
|
python wjtx.py initdb -s 692
|
|
mysql -uroot -p0usmUwROtWjf -h10.10.6.2 legend_692 -e"source all.sql"
|
|
python import_redis.py 10.10.6.126 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 692
|
|
redis-cli -h 10.10.6.4 hdel hefu_info 700
|
|
close 10.10.6.130
|
|
python wjtx.py changestatus -m maintain -o remove -s 692-703 |