ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dbhowm...@apache.org
Subject ambari git commit: AMBARI-18690. Zeppelin fails to start after deployment due to timing issue. (Renjith Kamath via dipayanb)
Date Thu, 27 Oct 2016 17:16:29 GMT
Repository: ambari
Updated Branches:
  refs/heads/branch-2.4 dd7b3b932 -> 294a2df5f


AMBARI-18690. Zeppelin fails to start after deployment due to timing issue. (Renjith Kamath
via dipayanb)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/294a2df5
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/294a2df5
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/294a2df5

Branch: refs/heads/branch-2.4
Commit: 294a2df5f31f6500fac5679aaa9ff7a5fbaa4579
Parents: dd7b3b9
Author: Dipayan Bhowmick <dipayan.bhowmick@gmail.com>
Authored: Thu Oct 27 22:44:51 2016 +0530
Committer: Dipayan Bhowmick <dipayan.bhowmick@gmail.com>
Committed: Thu Oct 27 22:45:35 2016 +0530

----------------------------------------------------------------------
 .../ZEPPELIN/0.6.0.2.5/package/scripts/master.py  | 18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/294a2df5/ambari-server/src/main/resources/common-services/ZEPPELIN/0.6.0.2.5/package/scripts/master.py
----------------------------------------------------------------------
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 4583d81..080fcd6 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()


Mime
View raw message