def setup(self, settings):
        '''
        Setup kafka
        '''
        KafkaBaseMonitor.setup(self, settings)

        self.zoo_client = KazooClient(hosts=settings['ZOOKEEPER_HOSTS'])
        self.zoo_client.start()
        self.path = settings['ZOOKEEPER_ASSIGN_PATH'] + settings['ZOOKEEPER_ID']

        if not self.zoo_client.exists(self.path):
            self.zoo_client.ensure_path(self.path)
def setup ( self , settings ) : KafkaBaseMonitor . setup ( self , settings ) self . zoo_client = KazooClient ( hosts = settings [ 'ZOOKEEPER_HOSTS' ] ) self . zoo_client . start ( ) self . path = settings [ 'ZOOKEEPER_ASSIGN_PATH' ] + settings [ 'ZOOKEEPER_ID' ] if not self . zoo_client . exists ( self . path ) : self . zoo_client . ensure_path ( self . path )
Setup kafka