1
This commit is contained in:
parent
1f208b8fbd
commit
367bb814dd
9
tools/migratedb/6000/mysql.json
Normal file
9
tools/migratedb/6000/mysql.json
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
[
|
||||||
|
{
|
||||||
|
"instance_id" : 1,
|
||||||
|
"host" : "127.0.0.1",
|
||||||
|
"port" : 3306,
|
||||||
|
"user" : "root",
|
||||||
|
"passwd" : "keji178"
|
||||||
|
}
|
||||||
|
]
|
9
tools/migratedb/6000/redis.json
Normal file
9
tools/migratedb/6000/redis.json
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
[
|
||||||
|
{
|
||||||
|
"instance_id" : 1,
|
||||||
|
"host" : "127.0.0.1",
|
||||||
|
"port" : 3306,
|
||||||
|
"user" : "root",
|
||||||
|
"passwd" : "keji178"
|
||||||
|
}
|
||||||
|
]
|
3
tools/migratedb/common/mysql_rule.json
Normal file
3
tools/migratedb/common/mysql_rule.json
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
[
|
||||||
|
|
||||||
|
]
|
3
tools/migratedb/common/redis_rule.json
Normal file
3
tools/migratedb/common/redis_rule.json
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
[
|
||||||
|
|
||||||
|
]
|
@ -10,9 +10,10 @@ import time
|
|||||||
import datetime
|
import datetime
|
||||||
import redis
|
import redis
|
||||||
import os
|
import os
|
||||||
|
import sys
|
||||||
import functools
|
import functools
|
||||||
|
|
||||||
CONFIG_DIR = '.'
|
CONFIG_DIR = './'
|
||||||
context = {
|
context = {
|
||||||
'channel': 0,
|
'channel': 0,
|
||||||
'dbname_prefix': ''
|
'dbname_prefix': ''
|
||||||
@ -55,11 +56,16 @@ def exportRedis(context, redis_conf, redis_rule_conf):
|
|||||||
|
|
||||||
def main():
|
def main():
|
||||||
global context
|
global context
|
||||||
db_conf = json.loads(open(CONFIG_DIR + '/mysql_list.json', 'r').read())
|
if not os.path.exists(CONFIG_DIR + 'out/'):
|
||||||
redis_conf = json.loads(open(CONFIG_DIR + '/redis_list.json', 'r').read())
|
os.mkdir(CONFIG_DIR + 'out/')
|
||||||
db_rule_conf = json.loads(open(CONFIG_DIR + '/mysql_rule.json', 'r').read())
|
if not os.path.exists(CONFIG_DIR + 'out/' + context['channel']):
|
||||||
redis_rule_conf = json.loads(open(CONFIG_DIR + '/redis_rule.json', 'r').read())
|
os.mkdir(CONFIG_DIR + 'out/' + context['channel'])
|
||||||
|
db_conf = json.loads(open(CONFIG_DIR + context['channel'] + '/mysql.json', 'r').read())
|
||||||
|
redis_conf = json.loads(open(CONFIG_DIR + context['channel'] + '/redis.json', 'r').read())
|
||||||
|
db_rule_conf = json.loads(open(CONFIG_DIR + 'common/mysql_rule.json', 'r').read())
|
||||||
|
redis_rule_conf = json.loads(open(CONFIG_DIR + 'common/redis_rule.json', 'r').read())
|
||||||
exportRedis(context, redis_conf, redis_rule_conf)
|
exportRedis(context, redis_conf, redis_rule_conf)
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
context['channel'] = sys.argv[1]
|
||||||
main()
|
main()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user