This commit is contained in:
aozhiwei 2020-08-31 19:03:00 +08:00
parent 1f208b8fbd
commit 367bb814dd
5 changed files with 35 additions and 5 deletions

View File

@ -0,0 +1,9 @@
[
{
"instance_id" : 1,
"host" : "127.0.0.1",
"port" : 3306,
"user" : "root",
"passwd" : "keji178"
}
]

View File

@ -0,0 +1,9 @@
[
{
"instance_id" : 1,
"host" : "127.0.0.1",
"port" : 3306,
"user" : "root",
"passwd" : "keji178"
}
]

View File

@ -0,0 +1,3 @@
[
]

View File

@ -0,0 +1,3 @@
[
]

View File

@ -10,9 +10,10 @@ import time
import datetime
import redis
import os
import sys
import functools
CONFIG_DIR = '.'
CONFIG_DIR = './'
context = {
'channel': 0,
'dbname_prefix': ''
@ -55,11 +56,16 @@ def exportRedis(context, redis_conf, redis_rule_conf):
def main():
global context
db_conf = json.loads(open(CONFIG_DIR + '/mysql_list.json', 'r').read())
redis_conf = json.loads(open(CONFIG_DIR + '/redis_list.json', 'r').read())
db_rule_conf = json.loads(open(CONFIG_DIR + '/mysql_rule.json', 'r').read())
redis_rule_conf = json.loads(open(CONFIG_DIR + '/redis_rule.json', 'r').read())
if not os.path.exists(CONFIG_DIR + 'out/'):
os.mkdir(CONFIG_DIR + 'out/')
if not os.path.exists(CONFIG_DIR + 'out/' + context['channel']):
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)
if __name__ == "__main__":
context['channel'] = sys.argv[1]
main()