sys.exit(1) # initialize the etcd table for recovery token = tools.gen_token() tokenfile = open(fs_path + "/global/token", 'w') tokenfile.write(token) tokenfile.write("\n") tokenfile.close() etcdclient.setkey("token", token) etcdclient.setkey("service/master", ipaddr) etcdclient.setkey("service/mode", mode) if etcdclient.isdir("_lock")[0]: etcdclient.deldir("_lock") #init portcontrol portcontrol.init_new() G_ulockmgr = lockmgr.LockMgr() clusternet = env.getenv("CLUSTER_NET") logger.info("using CLUSTER_NET %s" % clusternet) G_sysmgr = sysmgr.SystemManager() G_networkmgr = network.NetworkMgr(clusternet, etcdclient, mode, ipaddr) G_networkmgr.printpools() G_cloudmgr = cloudmgr.CloudMgr() # start NodeMgr and NodeMgr will wait for all nodes to start ... G_nodemgr = nodemgr.NodeMgr(G_networkmgr, etcdclient, addr=ipaddr,
global G_usermgr global G_notificationmgr global G_sysmgr global G_historymgr global G_applicationmgr global G_lockmgr fs_path = env.getenv("FS_PREFIX") logger.info("using FS_PREFIX %s" % fs_path) mode = 'recovery' if len(sys.argv) > 1 and sys.argv[1] == "new": mode = 'new' G_lockmgr = lockmgr.LockMgr() G_usermgr = userManager.userManager('root') #if mode == "new": # G_usermgr.initUsage() G_notificationmgr = notificationmgr.NotificationMgr() #userip = env.getenv('USER_IP') userip = "0.0.0.0" logger.info("using USER_IP %s", userip) #userport = env.getenv('USER_PORT') userport = 9100 logger.info("using USER_PORT %d", int(userport)) G_applicationmgr = beansapplicationmgr.ApplicationMgr() approvalrbt = beansapplicationmgr.ApprovalRobot()