Repository: ambari
Updated Branches:
  refs/heads/trunk 9dccb666f -> e758bbecc


AMBARI-16702 Zeppelin cluster deployment fails due to unavailability of 
zeppelin service check script (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/e758bbec
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/e758bbec
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/e758bbec

Branch: refs/heads/trunk
Commit: e758bbecc4e1b8eedb313e5a409d66f2ba6a72a8
Parents: 9dccb66
Author: Dipayan Bhowmick <[email protected]>
Authored: Wed May 18 01:13:01 2016 +0530
Committer: Dipayan Bhowmick <[email protected]>
Committed: Wed May 18 01:13:01 2016 +0530

----------------------------------------------------------------------
 .../ZEPPELIN/0.6.0.2.5/metainfo.xml             |  6 ++++
 .../0.6.0.2.5/package/scripts/service_check.py  | 36 ++++++++++++++++++++
 2 files changed, 42 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/e758bbec/ambari-server/src/main/resources/common-services/ZEPPELIN/0.6.0.2.5/metainfo.xml
----------------------------------------------------------------------
diff --git 
a/ambari-server/src/main/resources/common-services/ZEPPELIN/0.6.0.2.5/metainfo.xml
 
b/ambari-server/src/main/resources/common-services/ZEPPELIN/0.6.0.2.5/metainfo.xml
index 866d746..1b760ac 100644
--- 
a/ambari-server/src/main/resources/common-services/ZEPPELIN/0.6.0.2.5/metainfo.xml
+++ 
b/ambari-server/src/main/resources/common-services/ZEPPELIN/0.6.0.2.5/metainfo.xml
@@ -51,6 +51,12 @@ limitations under the License.
         </osSpecific>
       </osSpecifics>
 
+      <commandScript>
+        <script>scripts/service_check.py</script>
+        <scriptType>PYTHON</scriptType>
+        <timeout>300</timeout>
+      </commandScript>
+
       <requiredServices>
         <service>SPARK</service>
       </requiredServices>

http://git-wip-us.apache.org/repos/asf/ambari/blob/e758bbec/ambari-server/src/main/resources/common-services/ZEPPELIN/0.6.0.2.5/package/scripts/service_check.py
----------------------------------------------------------------------
diff --git 
a/ambari-server/src/main/resources/common-services/ZEPPELIN/0.6.0.2.5/package/scripts/service_check.py
 
b/ambari-server/src/main/resources/common-services/ZEPPELIN/0.6.0.2.5/package/scripts/service_check.py
new file mode 100644
index 0000000..2a88a2c
--- /dev/null
+++ 
b/ambari-server/src/main/resources/common-services/ZEPPELIN/0.6.0.2.5/package/scripts/service_check.py
@@ -0,0 +1,36 @@
+"""
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agree in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+"""
+
+from resource_management import *
+from resource_management.libraries.script.script import Script
+from resource_management.libraries.functions.format import format
+from resource_management.core.resources.system import Execute
+
+class ZeppelinServiceCheck(Script):
+    def service_check(self, env):
+        import params
+        env.set_params(params)
+
+        print ()
+        Execute(format("curl -s -o /dev/null -w'%{{http_code}}' --negotiate 
-u: -k {zeppelin_host}:{zeppelin_port} | grep 200"),
+                tries = 10,
+                try_sleep=3,
+                logoutput=True)
+
+if __name__ == "__main__":
+    ZeppelinServiceCheck().execute()

Reply via email to