122 lines
6.5 KiB
Plaintext
122 lines
6.5 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)
|
|
|
|
mysql -uroot -p0usmUwROtWjf -h10.10.6.2 legend_584 -e"select count(1),server_id from user group by server_id;"
|
|
mysql -uroot -p0usmUwROtWjf -h10.10.6.2 legend_592 -e"select count(1),server_id from user group by server_id;"
|
|
mysql -uroot -p0usmUwROtWjf -h10.10.6.2 legend_392 -e"select count(1),server_id from user group by server_id;"
|
|
mysql -uroot -p0usmUwROtWjf -h10.10.6.2 legend_460 -e"select count(1),server_id from user group by server_id;"
|
|
mysql -uroot -p0usmUwROtWjf -h10.10.6.2 legend_576 -e"select count(1),server_id from user group by server_id;"
|
|
==========================================step 1===============================================
|
|
10.10.6.230-233
|
|
python wjtx.py changestatus -m maintain -o add -s 584-591
|
|
|
|
mysqldump --default-character-set=utf8 -uwjtx -pmMWA4DKCfeOL -h10.10.6.2 legend_584 >legend_584.sql
|
|
mysqldump --default-character-set=utf8 -uwjtx -pmMWA4DKCfeOL -h10.10.6.2 legend_585 >legend_585.sql
|
|
mysqldump --default-character-set=utf8 -uwjtx -pmMWA4DKCfeOL -h10.10.6.2 legend_586 >legend_586.sql
|
|
mysqldump --default-character-set=utf8 -uwjtx -pmMWA4DKCfeOL -h10.10.6.2 legend_587 >legend_587.sql
|
|
mysqldump --default-character-set=utf8 -uwjtx -pmMWA4DKCfeOL -h10.10.6.2 legend_588 >legend_588.sql
|
|
mysqldump --default-character-set=utf8 -uwjtx -pmMWA4DKCfeOL -h10.10.6.2 legend_589 >legend_589.sql
|
|
mysqldump --default-character-set=utf8 -uwjtx -pmMWA4DKCfeOL -h10.10.6.2 legend_590 >legend_590.sql
|
|
mysqldump --default-character-set=utf8 -uwjtx -pmMWA4DKCfeOL -h10.10.6.2 legend_591 >legend_591.sql
|
|
|
|
python wjtx.py initdb -s 584
|
|
mysql -uroot -p0usmUwROtWjf -h10.10.6.2 legend_584 -e"source all.sql"
|
|
python import_redis.py 10.10.6.230 6381 out/game_redis.script
|
|
python import_redis.py 10.10.6.4 6379 out/global_redis.script
|
|
close 10.10.6.231-233
|
|
python wjtx.py changestatus -m maintain -o remove -s 584-591
|
|
==========================================step 2===============================================
|
|
10.10.6.234,235
|
|
python wjtx.py changestatus -m maintain -o add -s 592-595
|
|
|
|
mysqldump --default-character-set=utf8 -uwjtx -pmMWA4DKCfeOL -h10.10.6.2 legend_592 >legend_592.sql
|
|
mysqldump --default-character-set=utf8 -uwjtx -pmMWA4DKCfeOL -h10.10.6.2 legend_593 >legend_593.sql
|
|
mysqldump --default-character-set=utf8 -uwjtx -pmMWA4DKCfeOL -h10.10.6.2 legend_594 >legend_594.sql
|
|
mysqldump --default-character-set=utf8 -uwjtx -pmMWA4DKCfeOL -h10.10.6.2 legend_595 >legend_595.sql
|
|
|
|
python wjtx.py initdb -s 592
|
|
mysql -uroot -p0usmUwROtWjf -h10.10.6.2 legend_592 -e"source all.sql"
|
|
python import_redis.py 10.10.6.234 6381 out/game_redis.script
|
|
python import_redis.py 10.10.6.4 6379 out/global_redis.script
|
|
close 10.10.6.235
|
|
python wjtx.py changestatus -m maintain -o remove -s 592-595
|
|
=======================================step 3===============================================
|
|
10.10.6.134
|
|
python wjtx.py changestatus -m maintain -o add -s 392-459
|
|
|
|
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_432 >legend_432.sql
|
|
|
|
python wjtx.py initdb -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 432
|
|
python wjtx.py changestatus -m maintain -o remove -s 392-459
|
|
=======================================step 4===============================================
|
|
10.10.6.168
|
|
change 460 config to 10.10.6.134 6382
|
|
python wjtx.py changestatus -m maintain -o add -s 460-519
|
|
|
|
mysqldump --default-character-set=utf8 -uwjtx -pmMWA4DKCfeOL -h10.10.6.2 legend_460 >legend_460.sql
|
|
mysqldump --default-character-set=utf8 -uwjtx -pmMWA4DKCfeOL -h10.10.6.2 legend_488 >legend_488.sql
|
|
|
|
python wjtx.py initdb -s 460
|
|
mysql -uroot -p0usmUwROtWjf -h10.10.6.2 legend_460 -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 460
|
|
redis-cli -h 10.10.6.4 hdel hefu_info 488
|
|
close 10.10.6.168
|
|
python wjtx.py changestatus -m maintain -o remove -s 460-519
|
|
=======================================step 5===============================================
|
|
10.10.6.226 228
|
|
python wjtx.py changestatus -m maintain -o add -s 576-583
|
|
|
|
mysqldump --default-character-set=utf8 -uwjtx -pmMWA4DKCfeOL -h10.10.6.2 legend_576 >legend_576.sql
|
|
mysqldump --default-character-set=utf8 -uwjtx -pmMWA4DKCfeOL -h10.10.6.2 legend_580 >legend_580.sql
|
|
|
|
python wjtx.py initdb -s 576
|
|
mysql -uroot -p0usmUwROtWjf -h10.10.6.2 legend_576 -e"source all.sql"
|
|
python import_redis.py 10.10.6.226 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 576
|
|
redis-cli -h 10.10.6.4 hdel hefu_info 580
|
|
close 10.10.6.228
|
|
python wjtx.py changestatus -m maintain -o remove -s 576-583
|
|
=======================================step 6===============================================
|
|
move 556 to 10.10.6.198
|
|
ssh 10.10.6.216
|
|
close ->back to 10.10.6.198
|
|
change 556 config to 10.10.6.198 6382
|
|
restart
|
|
close 10.10.6.216 |