Kaynağa Gözat

AMBARI-4239. Storm: Update Hosts / Host Detail pages to support Storm (Denys Buzhor via alexantonenko)

Alex Antonenko 11 yıl önce
ebeveyn
işleme
d025b06e68

+ 19 - 1
ambari-web/app/assets/data/hosts/HDP2/hc_host_status.json

@@ -197,8 +197,26 @@
             "host_name" : "dev01.hortonworks.com",
             "state" : "STARTED"
           }
+        },
+        {
+          "href" : "http://192.168.56.101:8080/api/v1/clusters/perf/hosts/dev01.hortonworks.com/host_components/NIMBUS",
+          "HostRoles" : {
+            "cluster_name" : "perf",
+            "component_name" : "NIMBUS",
+            "host_name" : "dev01.hortonworks.com",
+            "state" : "STARTED"
+          }
+        },
+        {
+          "href" : "http://192.168.56.101:8080/api/v1/clusters/perf/hosts/dev01.hortonworks.com/host_components/NIMBUS",
+          "HostRoles" : {
+            "cluster_name" : "perf",
+            "component_name" : "SUPERVISOR",
+            "host_name" : "dev01.hortonworks.com",
+            "state" : "STARTED"
+          }
         }
       ]
     }
   ]
-}
+}

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

@@ -275,8 +275,24 @@
             "component_name" : "ZOOKEEPER_SERVER",
             "host_name" : "dev01.hortonworks.com"
           }
+        },
+        {
+          "href" : "http://dev01.hortonworks.com:8080/api/v1/clusters/c1/hosts/dev01.hortonworks.com/host_components/NIMBUS",
+          "HostRoles" : {
+            "cluster_name" : "c1",
+            "component_name" : "NIMBUS",
+            "host_name" : "dev01.hortonworks.com"
+          }
+        },
+        {
+          "href" : "http://dev01.hortonworks.com:8080/api/v1/clusters/c1/hosts/dev01.hortonworks.com/host_components/SUPERVISOR",
+          "HostRoles" : {
+            "cluster_name" : "c1",
+            "component_name" : "SUPERVISOR",
+            "host_name" : "dev01.hortonworks.com"
+          }
         }
       ]
     }
   ]
-}
+}

+ 12 - 1
ambari-web/app/assets/data/wizard/stack/stacks.json

@@ -873,8 +873,19 @@
             "stack_version" : "2.0.5",
             "user_name" : "root"
           }
+        },
+        {
+          "href" : "http://192.168.56.101:8080/api/v1/stacks2/HDP/versions/2.0.5/stackServices/STORM",
+          "StackServices" : {
+            "comments" : "Storm makes it easy to reliably process unbounded streams of data.",
+            "service_name" : "STORM",
+            "service_version" : "0.9.0.1",
+            "stack_name" : "HDP",
+            "stack_version" : "2.0.5",
+            "user_name" : "root"
+          }
         }
       ]
     }
   ]
-}
+}

+ 16 - 0
ambari-web/app/data/service_components.js

@@ -329,5 +329,21 @@ module.exports = new Ember.Set([
     isMaster: false, 
     isClient: true, 
     description: 'Client component for GLUSTERFS'
+  },
+  {
+    service_name: 'STORM',
+    component_name: 'NIMBUS',
+    display_name: 'Nimbus',
+    isMaster: true,
+    isClient: false,
+    description: 'Master component for STORM'
+  },
+  {
+    service_name: 'STORM',
+    component_name: 'SUPERVISOR',
+    display_name: 'Supervisor',
+    isMaster: false,
+    isClient: false,
+    description: 'Client component for STORM'
   }
 ]);

+ 8 - 0
ambari-web/app/data/services.js

@@ -155,5 +155,13 @@ module.exports = [
     isSelected: App.supports.hue,
     canBeSelected: App.supports.hue,
     isHidden: !App.supports.hue
+  },
+  {
+    serviceName: 'STORM',
+    displayName: 'Storm',
+    isDisabled: false,
+    isSelected: App.testMode,
+    canBeSelected: App.testMode,
+    isHidden: !App.testMode
   }
 ]

+ 3 - 1
ambari-web/app/mappers/server_data_mapper.js

@@ -211,5 +211,7 @@ App.QuickDataMapper.componentServiceMap = {
   'KERBEROS_ADMIN_CLIENT': 'KERBEROS',
   'KERBEROS_CLIENT': 'KERBEROS',
   'HUE_SERVER': 'HUE',
-  'GLUSTERFS_CLIENT': 'GLUSTERFS'
+  'GLUSTERFS_CLIENT': 'GLUSTERFS',
+  'NIMBUS': 'STORM',
+  'SUPERVISOR': 'STORM'
 };

+ 3 - 0
ambari-web/app/models/host_component.js

@@ -77,6 +77,7 @@ App.HostComponent = DS.Model.extend({
       case 'HUE_SERVER':
       case 'HISTORYSERVER':
       case 'FLUME_SERVER':
+      case 'NIMBUS':
       case 'RESOURCEMANAGER':
         return true;
       default:
@@ -96,6 +97,7 @@ App.HostComponent = DS.Model.extend({
       case 'GANGLIA_MONITOR':
       case 'NODEMANAGER':
       case 'ZKFC':
+      case 'SUPERVISOR':
         return true;
       default:
         return false;
@@ -116,6 +118,7 @@ App.HostComponent = DS.Model.extend({
       case 'ZOOKEEPER_SERVER':
       case 'HBASE_REGIONSERVER':
       case 'GANGLIA_MONITOR':
+      case 'SUPERVISOR':
       case 'NODEMANAGER':
         canDelete = true;
         break;

+ 2 - 2
ambari-web/app/templates/main/host/summary.hbs

@@ -95,8 +95,8 @@
                       </li>
                     {{/if}}
                   {{/if}}
-                  {{#if view.isHBaseMaster}}
-                    <li {{bindAttr class="view.isDeleteHBaseMasterDisabled:disabled"}}>
+                  {{#if view.isDeletableComponent}}
+                    <li {{bindAttr class="view.isDeleteComponentDisabled:disabled"}}>
                       <a href="javascript:void(null)" data-toggle="modal" {{action "deleteComponent" view.content target="controller"}}>
                         {{t common.delete}}
                       </a>

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

@@ -348,6 +348,10 @@ App.format = {
         return 'Flume Agent';
       case 'ZKFC':
         return 'ZKFailoverController';
+      case 'NIMBUS':
+        return 'Nimbus';
+      case 'SUPERVISOR':
+        return 'Supervisor';
     }
   },
 

+ 11 - 3
ambari-web/app/views/main/host/summary.js

@@ -478,10 +478,18 @@ App.MainHostSummaryView = Em.View.extend({
     /**
      * Shows whether we need to show Delete button
      */
-    isHBaseMaster: function () {
-      return this.get('content.componentName') === 'HBASE_MASTER';
+    isDeletableComponent: function () {
+      var canDelete = false;
+      switch (this.get('content.componentName')) {
+        case 'HBASE_MASTER':
+        case 'SUPERVISOR':
+          canDelete = true;
+          break;
+        default:
+      }
+      return canDelete;
     }.property('content'),
-    isDeleteHBaseMasterDisabled: function () {
+    isDeleteComponentDisabled: function () {
       return !(this.get('workStatus') == App.HostComponentStatus.stopped || this.get('workStatus') == App.HostComponentStatus.unknown ||
         this.get('workStatus') == App.HostComponentStatus.install_failed || this.get('workStatus') == App.HostComponentStatus.upgrade_failed);
     }.property('workStatus'),