1
This commit is contained in:
parent
d4b35ec5ce
commit
381be643c7
@ -1,46 +1,60 @@
|
|||||||
========================================check combine data=========================================
|
========================================check combine data=========================================
|
||||||
mysql -uroot -p0usmUwROtWjf -h10.10.6.2 legend_844 -e"select count(1),server_id from user group by server_id;"
|
mysql -uroot -p0usmUwROtWjf -h10.10.6.2 legend_852 -e"select count(1),server_id from user group by server_id;"
|
||||||
==========================================step 1===============================================
|
==========================================step 1===============================================
|
||||||
10.10.6.203-204
|
10.10.6.207-208
|
||||||
python wjtx.py changestatus -m maintain -o add -s 844-847
|
python wjtx.py changestatus -m maintain -o add -s 852-855
|
||||||
|
mysqldump --default-character-set=utf8 -uwjtx -pmMWA4DKCfeOL -h10.10.6.2 legend_852 >legend_852.sql
|
||||||
|
mysqldump --default-character-set=utf8 -uwjtx -pmMWA4DKCfeOL -h10.10.6.2 legend_853 >legend_853.sql
|
||||||
|
mysqldump --default-character-set=utf8 -uwjtx -pmMWA4DKCfeOL -h10.10.6.2 legend_854 >legend_854.sql
|
||||||
|
mysqldump --default-character-set=utf8 -uwjtx -pmMWA4DKCfeOL -h10.10.6.2 legend_855 >legend_855.sql
|
||||||
|
|
||||||
|
python wjtx.py initdb -s 852
|
||||||
|
mysql -uroot -p0usmUwROtWjf -h10.10.6.2 legend_852 -e"source all.sql"
|
||||||
|
|
||||||
|
python import_redis.py 10.10.6.207 6381 out/game_redis.script
|
||||||
|
python import_redis.py 10.10.6.4 6379 out/global_redis.script
|
||||||
|
close 10.10.6.208
|
||||||
|
python wjtx.py changestatus -m maintain -o remove -s 852-855
|
||||||
|
==========================================step 2===============================================
|
||||||
|
10.10.6.209-210
|
||||||
|
python wjtx.py changestatus -m maintain -o add -s 856-859
|
||||||
|
mysqldump --default-character-set=utf8 -uwjtx -pmMWA4DKCfeOL -h10.10.6.2 legend_856 >legend_856.sql
|
||||||
|
mysqldump --default-character-set=utf8 -uwjtx -pmMWA4DKCfeOL -h10.10.6.2 legend_857 >legend_857.sql
|
||||||
|
mysqldump --default-character-set=utf8 -uwjtx -pmMWA4DKCfeOL -h10.10.6.2 legend_858 >legend_858.sql
|
||||||
|
mysqldump --default-character-set=utf8 -uwjtx -pmMWA4DKCfeOL -h10.10.6.2 legend_859 >legend_859.sql
|
||||||
|
|
||||||
|
python wjtx.py initdb -s 856
|
||||||
|
mysql -uroot -p0usmUwROtWjf -h10.10.6.2 legend_856 -e"source all.sql"
|
||||||
|
|
||||||
|
python import_redis.py 10.10.6.209 6381 out/game_redis.script
|
||||||
|
python import_redis.py 10.10.6.4 6379 out/global_redis.script
|
||||||
|
close 10.10.6.210
|
||||||
|
python wjtx.py changestatus -m maintain -o remove -s 856-859
|
||||||
|
==========================================step 3===============================================
|
||||||
|
10.10.6.185,199
|
||||||
|
python wjtx.py changestatus -m maintain -o add -s 808-843
|
||||||
|
mysqldump --default-character-set=utf8 -uwjtx -pmMWA4DKCfeOL -h10.10.6.2 legend_808 >legend_808.sql
|
||||||
|
mysqldump --default-character-set=utf8 -uwjtx -pmMWA4DKCfeOL -h10.10.6.2 legend_836 >legend_836.sql
|
||||||
|
|
||||||
|
python wjtx.py initdb -s 808
|
||||||
|
mysql -uroot -p0usmUwROtWjf -h10.10.6.2 legend_808 -e"source all.sql"
|
||||||
|
python import_redis.py 10.10.6.185 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 808
|
||||||
|
redis-cli -h 10.10.6.4 hdel hefu_info 836
|
||||||
|
close 10.10.6.199
|
||||||
|
python wjtx.py changestatus -m maintain -o remove -s 808-843
|
||||||
|
==========================================step 4===============================================
|
||||||
|
10.10.6.203,205
|
||||||
|
python wjtx.py changestatus -m maintain -o add -s 844-851
|
||||||
mysqldump --default-character-set=utf8 -uwjtx -pmMWA4DKCfeOL -h10.10.6.2 legend_844 >legend_844.sql
|
mysqldump --default-character-set=utf8 -uwjtx -pmMWA4DKCfeOL -h10.10.6.2 legend_844 >legend_844.sql
|
||||||
mysqldump --default-character-set=utf8 -uwjtx -pmMWA4DKCfeOL -h10.10.6.2 legend_845 >legend_845.sql
|
mysqldump --default-character-set=utf8 -uwjtx -pmMWA4DKCfeOL -h10.10.6.2 legend_848 >legend_848.sql
|
||||||
mysqldump --default-character-set=utf8 -uwjtx -pmMWA4DKCfeOL -h10.10.6.2 legend_846 >legend_846.sql
|
|
||||||
mysqldump --default-character-set=utf8 -uwjtx -pmMWA4DKCfeOL -h10.10.6.2 legend_847 >legend_847.sql
|
|
||||||
|
|
||||||
python wjtx.py initdb -s 844
|
python wjtx.py initdb -s 844
|
||||||
mysql -uroot -p0usmUwROtWjf -h10.10.6.2 legend_844 -e"source all.sql"
|
mysql -uroot -p0usmUwROtWjf -h10.10.6.2 legend_844 -e"source all.sql"
|
||||||
|
|
||||||
python import_redis.py 10.10.6.203 6381 out/game_redis.script
|
python import_redis.py 10.10.6.203 6381 out/game_redis.script
|
||||||
python import_redis.py 10.10.6.4 6379 out/global_redis.script
|
python import_redis.py 10.10.6.4 6379 out/global_redis.script
|
||||||
close 10.10.6.204
|
redis-cli -h 10.10.6.4 hdel hefu_info 844
|
||||||
python wjtx.py changestatus -m maintain -o remove -s 844-847
|
redis-cli -h 10.10.6.4 hdel hefu_info 848
|
||||||
==========================================step 2===============================================
|
close 10.10.6.205
|
||||||
10.10.6.205-206
|
python wjtx.py changestatus -m maintain -o remove -s 844-851
|
||||||
python wjtx.py changestatus -m maintain -o add -s 848-851
|
|
||||||
mysqldump --default-character-set=utf8 -uwjtx -pmMWA4DKCfeOL -h10.10.6.2 legend_848 >legend_848.sql
|
|
||||||
mysqldump --default-character-set=utf8 -uwjtx -pmMWA4DKCfeOL -h10.10.6.2 legend_849 >legend_849.sql
|
|
||||||
mysqldump --default-character-set=utf8 -uwjtx -pmMWA4DKCfeOL -h10.10.6.2 legend_850 >legend_850.sql
|
|
||||||
mysqldump --default-character-set=utf8 -uwjtx -pmMWA4DKCfeOL -h10.10.6.2 legend_851 >legend_851.sql
|
|
||||||
|
|
||||||
python wjtx.py initdb -s 848
|
|
||||||
mysql -uroot -p0usmUwROtWjf -h10.10.6.2 legend_848 -e"source all.sql"
|
|
||||||
|
|
||||||
python import_redis.py 10.10.6.205 6381 out/game_redis.script
|
|
||||||
python import_redis.py 10.10.6.4 6379 out/global_redis.script
|
|
||||||
close 10.10.6.206
|
|
||||||
python wjtx.py changestatus -m maintain -o remove -s 848-851
|
|
||||||
==========================================step 3===============================================
|
|
||||||
10.10.6.199,201
|
|
||||||
python wjtx.py changestatus -m maintain -o add -s 836-843
|
|
||||||
mysqldump --default-character-set=utf8 -uwjtx -pmMWA4DKCfeOL -h10.10.6.2 legend_836 >legend_836.sql
|
|
||||||
mysqldump --default-character-set=utf8 -uwjtx -pmMWA4DKCfeOL -h10.10.6.2 legend_840 >legend_840.sql
|
|
||||||
|
|
||||||
python wjtx.py initdb -s 836
|
|
||||||
mysql -uroot -p0usmUwROtWjf -h10.10.6.2 legend_836 -e"source all.sql"
|
|
||||||
python import_redis.py 10.10.6.199 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 836
|
|
||||||
redis-cli -h 10.10.6.4 hdel hefu_info 840
|
|
||||||
close 10.10.6.201
|
|
||||||
python wjtx.py changestatus -m maintain -o remove -s 836-843
|
|
||||||
|
@ -11,38 +11,39 @@ from create_conf import create_conf_work
|
|||||||
|
|
||||||
|
|
||||||
def get_csv():
|
def get_csv():
|
||||||
with open('1009.csv', 'r') as f:
|
with open("1009.csv", "r") as f:
|
||||||
data = f.read()
|
data = f.read()
|
||||||
csv_data = list()
|
csv_data = list()
|
||||||
for line in data.split('\n'):
|
for line in data.split("\n"):
|
||||||
tt = dict()
|
tt = dict()
|
||||||
if line:
|
if line:
|
||||||
tt['serverid'], tt['redis_host'], tt['redis_port'] = line.split()
|
tt["serverid"], tt["redis_host"], tt["redis_port"] = line.split()
|
||||||
csv_data.append(tt)
|
csv_data.append(tt)
|
||||||
return csv_data
|
return csv_data
|
||||||
|
|
||||||
|
|
||||||
def read_json(filename):
|
def read_json(filename):
|
||||||
json_data = json.loads(open(filename, 'r').read())
|
json_data = json.loads(open(filename, "r").read())
|
||||||
return json_data
|
return json_data
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
create_conf_work()
|
create_conf_work()
|
||||||
csv_data = get_csv()
|
csv_data = get_csv()
|
||||||
for i in range(1, 4):
|
for i in range(1, 5):
|
||||||
check_file = f"server_list_{i}.json"
|
check_file = f"server_list_{i}.json"
|
||||||
json_data = read_json(check_file)
|
json_data = read_json(check_file)
|
||||||
print(f"check {check_file}")
|
print(f"check {check_file}")
|
||||||
for line in json_data:
|
for line in json_data:
|
||||||
for csv_line in csv_data:
|
for csv_line in csv_data:
|
||||||
if int(line['serverid']) == int(csv_line['serverid']):
|
if int(line["serverid"]) == int(csv_line["serverid"]):
|
||||||
if line['redis_host'] == csv_line['redis_host'] and int(
|
if line["redis_host"] == csv_line["redis_host"] and int(
|
||||||
line['redis_port']) == int(csv_line['redis_port']):
|
line["redis_port"]
|
||||||
|
) == int(csv_line["redis_port"]):
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
print(line, csv_line, check_file)
|
print(line, csv_line, check_file)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == "__main__":
|
||||||
main()
|
main()
|
||||||
|
@ -1,22 +1,22 @@
|
|||||||
[
|
[
|
||||||
{
|
{
|
||||||
"serverid": 844,
|
"serverid": 852,
|
||||||
"redis_host": "10.10.6.203",
|
"redis_host": "10.10.6.207",
|
||||||
"redis_port": 6381
|
"redis_port": 6381
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"serverid": 845,
|
"serverid": 853,
|
||||||
"redis_host": "10.10.6.203",
|
"redis_host": "10.10.6.207",
|
||||||
"redis_port": 6382
|
"redis_port": 6382
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"serverid": 846,
|
"serverid": 854,
|
||||||
"redis_host": "10.10.6.204",
|
"redis_host": "10.10.6.208",
|
||||||
"redis_port": 6381
|
"redis_port": 6381
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"serverid": 847,
|
"serverid": 855,
|
||||||
"redis_host": "10.10.6.204",
|
"redis_host": "10.10.6.208",
|
||||||
"redis_port": 6382
|
"redis_port": 6382
|
||||||
}
|
}
|
||||||
]
|
]
|
@ -1,22 +1,22 @@
|
|||||||
[
|
[
|
||||||
{
|
{
|
||||||
"serverid": 848,
|
"serverid": 856,
|
||||||
"redis_host": "10.10.6.205",
|
"redis_host": "10.10.6.209",
|
||||||
"redis_port": 6381
|
"redis_port": 6381
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"serverid": 849,
|
"serverid": 857,
|
||||||
"redis_host": "10.10.6.205",
|
"redis_host": "10.10.6.209",
|
||||||
"redis_port": 6382
|
"redis_port": 6382
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"serverid": 850,
|
"serverid": 858,
|
||||||
"redis_host": "10.10.6.206",
|
"redis_host": "10.10.6.210",
|
||||||
"redis_port": 6381
|
"redis_port": 6381
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"serverid": 851,
|
"serverid": 859,
|
||||||
"redis_host": "10.10.6.206",
|
"redis_host": "10.10.6.210",
|
||||||
"redis_port": 6382
|
"redis_port": 6382
|
||||||
}
|
}
|
||||||
]
|
]
|
@ -1,12 +1,12 @@
|
|||||||
[
|
[
|
||||||
|
{
|
||||||
|
"serverid": 808,
|
||||||
|
"redis_host": "10.10.6.185",
|
||||||
|
"redis_port": 6381
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"serverid": 836,
|
"serverid": 836,
|
||||||
"redis_host": "10.10.6.199",
|
"redis_host": "10.10.6.199",
|
||||||
"redis_port": 6381
|
"redis_port": 6381
|
||||||
},
|
|
||||||
{
|
|
||||||
"serverid": 840,
|
|
||||||
"redis_host": "10.10.6.201",
|
|
||||||
"redis_port": 6381
|
|
||||||
}
|
}
|
||||||
]
|
]
|
12
tools/combine_db/tools_conf/server_list_4.json
Normal file
12
tools/combine_db/tools_conf/server_list_4.json
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
[
|
||||||
|
{
|
||||||
|
"serverid": 844,
|
||||||
|
"redis_host": "10.10.6.203",
|
||||||
|
"redis_port": 6381
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"serverid": 848,
|
||||||
|
"redis_host": "10.10.6.205",
|
||||||
|
"redis_port": 6381
|
||||||
|
}
|
||||||
|
]
|
Loading…
x
Reference in New Issue
Block a user