diff options
author | Dipayan Bhowmick <dipayan.bhowmick@gmail.com> | 2016-10-27 22:44:51 +0530 |
---|---|---|
committer | Dipayan Bhowmick <dipayan.bhowmick@gmail.com> | 2016-10-27 22:45:35 +0530 |
commit | 294a2df5f31f6500fac5679aaa9ff7a5fbaa4579 (patch) | |
tree | 123d4b4ab29555404b6285d9c9c8ca18cd2e059c | |
parent | dd7b3b9323f2c4b2bc2dcad60b1329bedb35cbc9 (diff) |
AMBARI-18690. Zeppelin fails to start after deployment due to timing issue. (Renjith Kamath via dipayanb)
-rw-r--r-- | ambari-server/src/main/resources/common-services/ZEPPELIN/0.6.0.2.5/package/scripts/master.py | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/ambari-server/src/main/resources/common-services/ZEPPELIN/0.6.0.2.5/package/scripts/master.py b/ambari-server/src/main/resources/common-services/ZEPPELIN/0.6.0.2.5/package/scripts/master.py index 4583d8199b..080fcd6b46 100644 --- a/ambari-server/src/main/resources/common-services/ZEPPELIN/0.6.0.2.5/package/scripts/master.py +++ b/ambari-server/src/main/resources/common-services/ZEPPELIN/0.6.0.2.5/package/scripts/master.py @@ -178,7 +178,7 @@ class Master(Script): not os.path.exists(params.conf_dir + "/interpreter.json"): Execute(params.zeppelin_dir + '/bin/zeppelin-daemon.sh start >> ' + params.zeppelin_log_file, user=params.zeppelin_user) - time.sleep(20) + self.check_zeppelin_server() self.update_zeppelin_interpreter() self.update_kerberos_properties() @@ -310,5 +310,21 @@ class Master(Script): notebook['properties']['master'] = "yarn-client" self.set_interpreter_settings(config_data) + def check_zeppelin_server(self, retries=10): + import params + import time + path = params.conf_dir + "/interpreter.json" + if os.path.exists(path) and os.path.getsize(path): + Logger.info("interpreter.json found. Zeppelin server started.") + return True + else: + if retries > 0: + Logger.info("interpreter.json not found. waiting for zeppelin server to start...") + time.sleep(5) + self.check_zeppelin_server(retries - 1) + else: + return False + return False + if __name__ == "__main__": Master().execute() |