mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-24 08:32:02 +00:00
Merge pull request #25908 from arenadata/ADQM-320
This commit is contained in:
commit
523155a020
@ -1188,15 +1188,18 @@ class ClickHouseCluster:
|
||||
time.sleep(1)
|
||||
|
||||
|
||||
def wait_hdfs_to_start(self, timeout=300):
|
||||
def wait_hdfs_to_start(self, timeout=300, check_marker=False):
|
||||
start = time.time()
|
||||
while time.time() - start < timeout:
|
||||
try:
|
||||
self.hdfs_api.write_data("/somefilewithrandomname222", "1")
|
||||
logging.debug("Connected to HDFS and SafeMode disabled! ")
|
||||
if check_marker:
|
||||
self.hdfs_api.read_data("/preparations_done_marker")
|
||||
|
||||
return
|
||||
except Exception as ex:
|
||||
logging.exception("Can't connect to HDFS " + str(ex))
|
||||
logging.exception("Can't connect to HDFS or preparations are not done yet " + str(ex))
|
||||
time.sleep(1)
|
||||
|
||||
raise Exception("Can't wait HDFS to start")
|
||||
@ -1443,7 +1446,7 @@ class ClickHouseCluster:
|
||||
os.chmod(self.hdfs_kerberized_logs_dir, stat.S_IRWXO)
|
||||
run_and_check(self.base_kerberized_hdfs_cmd + common_opts)
|
||||
self.make_hdfs_api(kerberized=True)
|
||||
self.wait_hdfs_to_start()
|
||||
self.wait_hdfs_to_start(check_marker=True)
|
||||
|
||||
if self.with_mongo and self.base_mongo_cmd:
|
||||
logging.debug('Setup Mongo')
|
||||
|
@ -242,6 +242,7 @@ sleep 3
|
||||
|
||||
/usr/local/hadoop/bin/hdfs dfs -mkdir /user/specuser
|
||||
/usr/local/hadoop/bin/hdfs dfs -chown specuser /user/specuser
|
||||
echo "chown_completed" | /usr/local/hadoop/bin/hdfs dfs -appendToFile - /preparations_done_marker
|
||||
|
||||
kdestroy
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user