This commit is contained in:
Yatsishin Ilya 2021-05-20 21:19:45 +03:00
parent d07b3763ef
commit 1f8d43235f

View File

@ -1186,6 +1186,15 @@ class ClickHouseCluster:
if self.with_zookeeper and self.base_zookeeper_cmd:
logging.debug('Setup ZooKeeper')
logging.debug(f'Creating internal ZooKeeper dirs: {self.zookeeper_dirs_to_create}')
if self.use_keeper:
for i in range(1,4):
if os.path.exists(self.keeper_instance_dir_prefix + f"{i}"):
shutil.rmtree(self.keeper_instance_dir_prefix + f"{i}")
else:
for i in range(1,3):
if os.path.exists(self.zookeeper_instance_dir_prefix + f"{i}"):
shutil.rmtree(self.zookeeper_instance_dir_prefix + f"{i}")
for dir in self.zookeeper_dirs_to_create:
os.makedirs(dir)