2021-02-20 10:39:35 +08:00

110 lines
6.2 KiB
Plaintext

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)
====================================================step 1===============================================
10.10.6.118-121
python wjtx.py change_server_status -m maintain -o add -s 360-367
mysqldump --default-character-set=utf8 -uwjtx -pmMWA4DKCfeOL -h10.10.6.2 legend_360 >legend_360.sql
mysqldump --default-character-set=utf8 -uwjtx -pmMWA4DKCfeOL -h10.10.6.2 legend_361 >legend_361.sql
mysqldump --default-character-set=utf8 -uwjtx -pmMWA4DKCfeOL -h10.10.6.2 legend_362 >legend_362.sql
mysqldump --default-character-set=utf8 -uwjtx -pmMWA4DKCfeOL -h10.10.6.2 legend_363 >legend_363.sql
mysqldump --default-character-set=utf8 -uwjtx -pmMWA4DKCfeOL -h10.10.6.2 legend_364 >legend_364.sql
mysqldump --default-character-set=utf8 -uwjtx -pmMWA4DKCfeOL -h10.10.6.2 legend_365 >legend_365.sql
mysqldump --default-character-set=utf8 -uwjtx -pmMWA4DKCfeOL -h10.10.6.2 legend_366 >legend_366.sql
mysqldump --default-character-set=utf8 -uwjtx -pmMWA4DKCfeOL -h10.10.6.2 legend_367 >legend_367.sql
python wjtx.py init_wjtx_mysql -s 360
mysql -uroot -p0usmUwROtWjf -h10.10.6.2 legend_360 -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
python wjtx.py change_server_status -m maintain -o remove -s 360-367
====================================================step 2===============================================
10.10.6.122-125
python wjtx.py change_server_status -m maintain -o add -s 368-375
mysqldump --default-character-set=utf8 -uwjtx -pmMWA4DKCfeOL -h10.10.6.2 legend_368 >legend_368.sql
mysqldump --default-character-set=utf8 -uwjtx -pmMWA4DKCfeOL -h10.10.6.2 legend_369 >legend_369.sql
mysqldump --default-character-set=utf8 -uwjtx -pmMWA4DKCfeOL -h10.10.6.2 legend_370 >legend_370.sql
mysqldump --default-character-set=utf8 -uwjtx -pmMWA4DKCfeOL -h10.10.6.2 legend_371 >legend_371.sql
mysqldump --default-character-set=utf8 -uwjtx -pmMWA4DKCfeOL -h10.10.6.2 legend_372 >legend_372.sql
mysqldump --default-character-set=utf8 -uwjtx -pmMWA4DKCfeOL -h10.10.6.2 legend_373 >legend_373.sql
mysqldump --default-character-set=utf8 -uwjtx -pmMWA4DKCfeOL -h10.10.6.2 legend_374 >legend_374.sql
mysqldump --default-character-set=utf8 -uwjtx -pmMWA4DKCfeOL -h10.10.6.2 legend_375 >legend_375.sql
python wjtx.py init_wjtx_mysql -s 368
mysql -uroot -p0usmUwROtWjf -h10.10.6.2 legend_368 -e"source all.sql"
python import_redis.py 10.10.6.122 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 368-375
====================================================step 3===============================================
10.10.6.93 102
python wjtx.py change_server_status -m maintain -o add -s 310-335
mysqldump --default-character-set=utf8 -uwjtx -pmMWA4DKCfeOL -h10.10.6.2 legend_310 >legend_310.sql
mysqldump --default-character-set=utf8 -uwjtx -pmMWA4DKCfeOL -h10.10.6.2 legend_328 >legend_328.sql
python wjtx.py init_wjtx_mysql -s 310
mysql -uroot -p0usmUwROtWjf -h10.10.6.2 legend_310 -e"source all.sql"
python import_redis.py 10.10.6.93 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 310
redis-cli -h 10.10.6.4 hdel hefu_info 328
python wjtx.py change_server_status -m maintain -o remove -s 310-335
====================================================step 4===============================================
10.10.6.114 116
python wjtx.py change_server_status -m maintain -o add -s 352-359
mysqldump --default-character-set=utf8 -uwjtx -pmMWA4DKCfeOL -h10.10.6.2 legend_352 >legend_352.sql
mysqldump --default-character-set=utf8 -uwjtx -pmMWA4DKCfeOL -h10.10.6.2 legend_356 >legend_356.sql
python wjtx.py init_wjtx_mysql -s 352
mysql -uroot -p0usmUwROtWjf -h10.10.6.2 legend_352 -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
redis-cli -h 10.10.6.4 hdel hefu_info 352
redis-cli -h 10.10.6.4 hdel hefu_info 356
python wjtx.py change_server_status -m maintain -o remove -s 352-359
====================================================step 5===============================================
10.10.6.45 86
python wjtx.py change_server_status -m maintain -o add -s 266-309
mysqldump --default-character-set=utf8 -uwjtx -pmMWA4DKCfeOL -h10.10.6.2 legend_266 >legend_266.sql
mysqldump --default-character-set=utf8 -uwjtx -pmMWA4DKCfeOL -h10.10.6.2 legend_291 >legend_291.sql
python wjtx.py init_wjtx_mysql -s 266
mysql -uroot -p0usmUwROtWjf -h10.10.6.2 legend_266 -e"source all.sql"
python import_redis.py 10.10.6.45 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 266
redis-cli -h 10.10.6.4 hdel hefu_info 291
python wjtx.py change_server_status -m maintain -o remove -s 266-309