Explorar o código

AMBARI-4246. Storm: Update Summary / Quicklinks to support Storm. (Denis Buzhor via onechiporenko)

Oleg Nechiporenko %!s(int64=11) %!d(string=hai) anos
pai
achega
c95c7f75cf

+ 19 - 0
ambari-web/ambari-web/app/templates/main/service/info/summary/storm.hbs

@@ -0,0 +1,19 @@
+{{!
+* 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.
+}}
+{{!<!-- @todo create correct view after api implementing-->}}
+{{view view.sumMasterComponentView}}

+ 17 - 1
ambari-web/app/assets/data/alerts/HDP2/alerts.json

@@ -632,6 +632,22 @@
               "is_flapping" : "0",
               "last_check" : "1375308415",
               "service_type" : "ZOOKEEPER"
+            },
+            {
+              "service_description" : "Storm process down",
+              "host_name" : "dev01.hortonworks.com",
+              "current_attempt" : "1",
+              "current_state" : "0",
+              "plugin_output" : "TCP OK - 0.001 second response time on port 2181",
+              "last_hard_state_change" : "1375291434",
+              "last_hard_state" : "0",
+              "last_time_ok" : "1375308415",
+              "last_time_warning" : "0",
+              "last_time_unknown" : "0",
+              "last_time_critical" : "1375289980",
+              "is_flapping" : "0",
+              "last_check" : "1375308415",
+              "service_type" : "STORM"
             }
           ],
           "hostcounts" : {
@@ -653,4 +669,4 @@
       }
     }
   ]
-}
+}

+ 3 - 1
ambari-web/app/data/service_components.js

@@ -330,6 +330,7 @@ module.exports = new Ember.Set([
     isClient: true, 
     description: 'Client component for GLUSTERFS'
   },
+  // @todo change with real info about service component
   {
     service_name: 'STORM',
     component_name: 'NIMBUS',
@@ -338,6 +339,7 @@ module.exports = new Ember.Set([
     isClient: false,
     description: 'Master component for STORM'
   },
+  // @todo change with real info about service component
   {
     service_name: 'STORM',
     component_name: 'SUPERVISOR',
@@ -346,4 +348,4 @@ module.exports = new Ember.Set([
     isClient: false,
     description: 'Client component for STORM'
   }
-]);
+]);

+ 13 - 0
ambari-web/app/models/quick_links.js

@@ -388,5 +388,18 @@ App.QuickLinks.FIXTURES = [
     site: 'mapred-site',
     regex: portRegex,
     default_http_port: 19888
+  },
+  /* @todo Add real info about links */
+  {
+    id:31,
+    label:'Nimbus UI',
+    url:'%@://%@:%@/stacks',
+    service_id: 'STORM',
+    template:'%@://%@:%@/nimbus',
+    http_config: 'mapreduce.jobhistory.webapp.address',
+    https_config: 'mapreduce.jobhistory.webapp.https.address',
+    site: 'storm-site',
+    regex: portRegex,
+    default_http_port: 9292
   }
 ];

+ 1 - 1
ambari-web/app/models/service.js

@@ -28,7 +28,7 @@ App.Service = DS.Model.extend({
   rand: DS.attr('string'),
   toolTipContent: DS.attr('string'),
   alerts: DS.hasMany('App.Alert'),
-  quickLinks: DS.hasMany('App.QuickLinks'),
+  quickLinks: DS.hasMany('App.QuickLinks'),  // mapped in app/mappers/service_metrics_mapper.js method - mapQuickLinks
   hostComponents: DS.hasMany('App.HostComponent'),
   serviceConfigsTemplate: App.config.get('preDefinedServiceConfigs'),
 

+ 1 - 0
ambari-web/app/templates.js

@@ -26,4 +26,5 @@ require('templates/main/service/info/summary/zookeeper');
 require('templates/main/service/info/summary/mapreduce2');
 require('templates/main/service/info/summary/hive');
 require('templates/main/service/info/summary/hue');
+require('templates/main/service/info/summary/storm');
 require('templates/main/admin/highAvailability/progress');

+ 3 - 0
ambari-web/app/templates/main/service/info/summary.hbs

@@ -62,6 +62,9 @@
             {{#if view.serviceStatus.flume}}
               {{view App.MainDashboardServiceFlumeView showOnlyRows=true serviceBinding="view.service"}}
             {{/if}}
+            {{#if view.serviceStatus.storm}}
+              {{template "templates/main/service/info/summary/storm"}}
+            {{/if}}
           </tbody>
         </table>
       </div>

+ 11 - 4
ambari-web/app/views/common/quick_view_link_view.js

@@ -74,6 +74,11 @@ App.QuickViewLinks = Em.View.extend({
     this.setQuickLinks();
   },
 
+  findComponentHost: function (componentName) {
+    var components = this.get('content.hostComponents');
+    return App.singleNodeInstall ? App.singleNodeAlias : components.findProperty('componentName', componentName).get('host.publicHostName')
+  },
+
   setQuickLinks: function () {
     this.loadTags();
     var serviceName = this.get('content.serviceName');
@@ -85,7 +90,7 @@ App.QuickViewLinks = Em.View.extend({
     switch (serviceName) {
       case "HDFS":
         if (this.get('content.snameNode')) { // not HA
-          host = App.singleNodeInstall ? App.singleNodeAlias : components.findProperty('componentName', 'NAMENODE').get('host.publicHostName');
+          host = this.findComponentHost('NAMENODE');
         } else {
           // HA
           if (this.get('content.activeNameNode')) {
@@ -118,13 +123,15 @@ App.QuickViewLinks = Em.View.extend({
         }
         break;
       case "YARN":
-        host = App.singleNodeInstall ? App.singleNodeAlias : components.findProperty('componentName', 'RESOURCEMANAGER').get('host.publicHostName');
+        host = this.findComponentHost('RESOURCEMANAGER');
         break;
       case "MAPREDUCE2":
-        host = App.singleNodeInstall ? App.singleNodeAlias : components.findProperty('componentName', 'HISTORYSERVER').get('host.publicHostName');
+        host = this.findComponentHost('HISTORYSERVER');
+        break;
+      case "STORM":
+        host = this.findComponentHost('NIMBUS');
         break;
     }
-
     if (!host) {
       quickLinks = [
         {

+ 2 - 1
ambari-web/app/views/main/service/info/summary.js

@@ -46,7 +46,8 @@ App.MainServiceInfoSummaryView = Em.View.extend({
     ganglia:false,
     nagios:false,
     hue: false,
-    flume: false
+    flume: false,
+    storm: false
   },
 
   sumMasterComponentView : Em.View.extend({