Kaynağa Gözat

AMBARI-4261. Enable running Falcon and Storm service checks (aonishuk)

Andrew Onischuk 11 yıl önce
ebeveyn
işleme
63a08d09ca

+ 2 - 0
ambari-server/src/main/java/org/apache/ambari/server/Role.java

@@ -101,6 +101,8 @@ public class Role {
   public static final Role ZOOKEEPER_CLIENT = valueOf("ZOOKEEPER_CLIENT");
   public static final Role ZOOKEEPER_QUORUM_SERVICE_CHECK = valueOf("ZOOKEEPER_QUORUM_SERVICE_CHECK");
   public static final Role ZOOKEEPER_SERVER = valueOf("ZOOKEEPER_SERVER");
+  public static final Role FALCON_SERVICE_CHECK = valueOf("FALCON_SERVICE_CHECK");
+  public static final Role STORM_SERVICE_CHECK = valueOf("STORM_SERVICE_CHECK");
   
 
   private String name = null;

+ 6 - 0
ambari-server/src/main/java/org/apache/ambari/server/metadata/ActionMetadata.java

@@ -76,6 +76,8 @@ public class ActionMetadata {
     serviceActions.put("pig"        , Arrays.asList(Role.PIG_SERVICE_CHECK.toString()));
     serviceActions.put("sqoop"      , Arrays.asList(Role.SQOOP_SERVICE_CHECK.toString()));
     serviceActions.put("webhcat"  , Arrays.asList(Role.WEBHCAT_SERVICE_CHECK.toString()));
+    serviceActions.put("storm"  , Arrays.asList(Role.STORM_SERVICE_CHECK.toString()));
+    serviceActions.put("falcon"  , Arrays.asList(Role.FALCON_SERVICE_CHECK.toString()));
   }
 
   private void fillServiceCheckActions() {
@@ -97,6 +99,10 @@ public class ActionMetadata {
     serviceCheckActions.put("sqoop", Role.SQOOP_SERVICE_CHECK.toString());
     serviceCheckActions.put("webhcat",
         Role.WEBHCAT_SERVICE_CHECK.toString());
+    serviceCheckActions.put("storm",
+            Role.STORM_SERVICE_CHECK.toString());
+    serviceCheckActions.put("falcon",
+            Role.FALCON_SERVICE_CHECK.toString());
   }
 
   public List<String> getActions(String serviceName) {

+ 31 - 0
ambari-server/src/main/resources/stacks/HDP/2.0.8/services/STORM/package/scripts/service_check.py

@@ -0,0 +1,31 @@
+#!/usr/bin/env python
+"""
+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 agreed to 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 *
+
+class ServiceCheck(Script):
+  def service_check(self, env):
+    import params
+    env.set_params(params)
+
+    print "Service check."
+
+if __name__ == "__main__":
+  ServiceCheck().execute()

+ 4 - 0
ambari-web/app/utils/helper.js

@@ -326,6 +326,10 @@ App.format = {
         return 'WebHCat Server';
       case 'WEBHCAT_SERVICE_CHECK':
         return 'WebHCat Service Check';
+      case 'STORM_SERVICE_CHECK':
+          return 'Storm Service Check';
+      case 'FALCON_SERVICE_CHECK':
+          return 'Falcon Service Check';
       case 'NAGIOS_SERVER':
         return 'Nagios Server';
       case 'GANGLIA_SERVER':