Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 556AE200BAA for ; Thu, 27 Oct 2016 19:16:31 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 54044160AF6; Thu, 27 Oct 2016 17:16:31 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 9A3E2160AE6 for ; Thu, 27 Oct 2016 19:16:30 +0200 (CEST) Received: (qmail 65447 invoked by uid 500); 27 Oct 2016 17:16:29 -0000 Mailing-List: contact commits-help@ambari.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: ambari-dev@ambari.apache.org Delivered-To: mailing list commits@ambari.apache.org Received: (qmail 65438 invoked by uid 99); 27 Oct 2016 17:16:29 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 27 Oct 2016 17:16:29 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 842E6DFDC4; Thu, 27 Oct 2016 17:16:29 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: dbhowmick@apache.org To: commits@ambari.apache.org Message-Id: <48f76f09a99a44c684b8e472105a7504@git.apache.org> X-Mailer: ASF-Git Admin Mailer 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 +0000 (UTC) archived-at: Thu, 27 Oct 2016 17:16:31 -0000 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 Authored: Thu Oct 27 22:44:51 2016 +0530 Committer: Dipayan Bhowmick 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()