Esempio n. 1
0
 def _show_info(self):
     """
     显示swall信息
     """
     keeper = Keeper(self.config)
     valid_nodes = keeper.get_valid_nodes()
     info = {"config": self.config, "node_list": valid_nodes}
     print format_obj(info)
Esempio n. 2
0
 def main(self):
     """
     init zookeeper
     """
     self.parse_args()
     keeper = Keeper(self.config)
     if keeper.init_db(self.options.force):
         sys.stdout.write(c("init zookeeper db ok\n", 'g'))
     else:
         sys.stdout.write(c("init zookeeper db fail\n", 'r'))
     sys.stdout.flush()
Esempio n. 3
0
 def _show_info(self):
     """
     显示swall信息
     """
     keeper = Keeper(self.config)
     valid_nodes = keeper.get_valid_nodes()
     info = {
         "config": self.config,
         "node_list": valid_nodes
     }
     print format_obj(info)
Esempio n. 4
0
 def main(self):
     """
     init zookeeper
     """
     self.parse_args()
     keeper = Keeper(self.config)
     if keeper.init_db(self.options.force):
         sys.stdout.write(c("init zookeeper db ok\n", 'g'))
     else:
         sys.stdout.write(c("init zookeeper db fail\n", 'r'))
     sys.stdout.flush()
Esempio n. 5
0
 def __init__(self, config, jid="", env="clear", timeout=60, retry_times=3):
     self.fs_conf = Conf(config["fs"])
     self.main_conf = Conf(config["swall"])
     self.keeper = Keeper(config)
     self.mq = MQ(config)
     self.jid = jid
     self.env = env
     self.timeout = timeout
     self.retry_times = retry_times
Esempio n. 6
0
    def __init__(self, config, jid="", env="clear", timeout=60, retry_times=3):
        #初始化下ZKDb的init方法
        super(Job, self).__init__()

        self.fs_conf = Conf(config["fs"])
        self.main_conf = Conf(config["swall"])
        self.zookeeper_conf = Conf(config["zk"])
        self.keeper = Keeper(config)
        self.jid = jid
        self.env = env
        self.timeout = timeout
        self.retry_times = retry_times