2021-08-23 18:45:47 +08:00
..
2020-08-19 14:15:13 +08:00
1
2020-08-19 14:14:08 +08:00
1
2021-06-30 11:31:02 +08:00
2020-12-23 14:49:46 +08:00
2020-03-25 10:37:32 +08:00
2021-08-23 18:45:47 +08:00
2021-01-14 17:35:06 +08:00
2021-07-12 19:26:30 +08:00

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_556 -e"select count(1),server_id from user group by server_id;"
mysql -uroot -p0usmUwROtWjf -h10.10.6.2 legend_560 -e"select count(1),server_id from user group by server_id;"
mysql -uroot -p0usmUwROtWjf -h10.10.6.2 legend_520 -e"select count(1),server_id from user group by server_id;"
==========================================step 1===============================================
10.10.6.216,217
python wjtx.py changestatus -m maintain -o add -s 556-559

mysqldump --default-character-set=utf8  -uwjtx -pmMWA4DKCfeOL -h10.10.6.2 legend_556 >legend_556.sql
mysqldump --default-character-set=utf8  -uwjtx -pmMWA4DKCfeOL -h10.10.6.2 legend_557 >legend_557.sql
mysqldump --default-character-set=utf8  -uwjtx -pmMWA4DKCfeOL -h10.10.6.2 legend_558 >legend_558.sql
mysqldump --default-character-set=utf8  -uwjtx -pmMWA4DKCfeOL -h10.10.6.2 legend_559 >legend_559.sql

python wjtx.py initdb -s 556
mysql -uroot -p0usmUwROtWjf -h10.10.6.2 legend_556 -e"source all.sql"
python import_redis.py 10.10.6.216 6381 out/game_redis.script
python import_redis.py 10.10.6.4 6379 out/global_redis.script
python wjtx.py changestatus  -m maintain -o remove -s 556-559
==========================================step 2===============================================
10.10.6.218 219
python wjtx.py changestatus -m maintain -o add -s 560-563

mysqldump --default-character-set=utf8  -uwjtx -pmMWA4DKCfeOL -h10.10.6.2 legend_560 >legend_560.sql
mysqldump --default-character-set=utf8  -uwjtx -pmMWA4DKCfeOL -h10.10.6.2 legend_561 >legend_561.sql
mysqldump --default-character-set=utf8  -uwjtx -pmMWA4DKCfeOL -h10.10.6.2 legend_562 >legend_562.sql
mysqldump --default-character-set=utf8  -uwjtx -pmMWA4DKCfeOL -h10.10.6.2 legend_563 >legend_563.sql

python wjtx.py initdb -s 560
mysql -uroot -p0usmUwROtWjf -h10.10.6.2 legend_560 -e"source all.sql"
python import_redis.py 10.10.6.218 6381 out/game_redis.script
python import_redis.py 10.10.6.4 6379 out/global_redis.script
python wjtx.py changestatus  -m maintain -o remove -s 560-563
=======================================step 3===============================================
10.10.6.198 210 214
python wjtx.py changestatus -m maintain -o add -s 520-555

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_544 >legend_544.sql
mysqldump --default-character-set=utf8  -uwjtx -pmMWA4DKCfeOL -h10.10.6.2 legend_552 >legend_552.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.198 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 520
redis-cli -h 10.10.6.4 hdel hefu_info 544
redis-cli -h 10.10.6.4 hdel hefu_info 552
python wjtx.py changestatus  -m maintain -o remove -s 520-555