You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by al...@apache.org on 2014/01/10 16:55:25 UTC

git commit: AMBARI-4257. Storm: Update Install Wizard to be able to install Storm as a service (Denys Buzhor via alexantonenko)

Updated Branches:
  refs/heads/trunk 63a08d09c -> 727f082ac


AMBARI-4257. Storm: Update Install Wizard to be able to install Storm as a service (Denys Buzhor via alexantonenko)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/727f082a
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/727f082a
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/727f082a

Branch: refs/heads/trunk
Commit: 727f082ac9a59c1420059cc42c05e1925fb5fd59
Parents: 63a08d0
Author: Alex Antonenko <hi...@gmail.com>
Authored: Fri Jan 10 17:55:36 2014 +0200
Committer: Alex Antonenko <hi...@gmail.com>
Committed: Fri Jan 10 17:55:36 2014 +0200

----------------------------------------------------------------------
 .../app/assets/data/clusters/HDP2/cluster.json  |  6 +++-
 .../app/assets/data/clusters/cluster.json       |  5 ++-
 .../data/wizard/stack/hdp/version/2.0.1.json    | 11 +++++++
 .../data/wizard/stack/hdp/version/2.0.5.json    | 11 +++++++
 .../wizard/stack/hdp/version2.0.1/STORM.json    | 17 +++++++++++
 ambari-web/app/controllers/wizard.js            |  4 +--
 .../app/controllers/wizard/step5_controller.js  |  8 ++++-
 .../app/controllers/wizard/step8_controller.js  | 30 ++++++++++++++++++
 ambari-web/app/data/HDP2/global_properties.js   | 32 +++++++++++++++++++-
 ambari-web/app/data/HDP2/ha_properties.js       | 19 +++++++++++-
 ambari-web/app/data/review_configs.js           | 16 +++++++++-
 ambari-web/app/data/service_components.js       |  2 +-
 ambari-web/app/data/service_configs.js          | 11 ++++++-
 ambari-web/app/data/services.js                 |  3 +-
 ambari-web/app/messages.js                      |  1 +
 ambari-web/app/models/service_config.js         |  5 +--
 16 files changed, 168 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/727f082a/ambari-web/app/assets/data/clusters/HDP2/cluster.json
----------------------------------------------------------------------
diff --git a/ambari-web/app/assets/data/clusters/HDP2/cluster.json b/ambari-web/app/assets/data/clusters/HDP2/cluster.json
index e355e40..9d01a5c 100644
--- a/ambari-web/app/assets/data/clusters/HDP2/cluster.json
+++ b/ambari-web/app/assets/data/clusters/HDP2/cluster.json
@@ -48,7 +48,11 @@
       "yarn-site" : {
         "user" : "admin",
         "tag" : "version1"
+      },
+      "storm-site" : {
+        "user" : "admin",
+        "tag" : "version1"
       }
     }
   }
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/727f082a/ambari-web/app/assets/data/clusters/cluster.json
----------------------------------------------------------------------
diff --git a/ambari-web/app/assets/data/clusters/cluster.json b/ambari-web/app/assets/data/clusters/cluster.json
index 5c58988..873146e 100644
--- a/ambari-web/app/assets/data/clusters/cluster.json
+++ b/ambari-web/app/assets/data/clusters/cluster.json
@@ -32,6 +32,9 @@
       "hue-site" : {
         "tag" : "version1"
       },
+      "storm-site" : {
+        "tag" : "version1"
+      },
       "capacity-scheduler" : {
         "tag" : "version1"
       },
@@ -40,4 +43,4 @@
       }
     }
   }
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/727f082a/ambari-web/app/assets/data/wizard/stack/hdp/version/2.0.1.json
----------------------------------------------------------------------
diff --git a/ambari-web/app/assets/data/wizard/stack/hdp/version/2.0.1.json b/ambari-web/app/assets/data/wizard/stack/hdp/version/2.0.1.json
index 7018b27..3a37bc6 100644
--- a/ambari-web/app/assets/data/wizard/stack/hdp/version/2.0.1.json
+++ b/ambari-web/app/assets/data/wizard/stack/hdp/version/2.0.1.json
@@ -143,6 +143,17 @@
         "comments" : "Apache Hadoop Distributed File System",
         "service_version" : "2.0.3.22-1"
       }
+    },
+    {
+      "href" : "http://192.168.56.101:8080/api/v1/stacks2/HDP/versions/2.0.1/stackServices/STORM",
+      "StackServices" : {
+        "user_name" : "root",
+        "stack_version" : "2.0.1",
+        "service_name" : "STORM",
+        "stack_name" : "HDP",
+        "comments" : "Apache Hadoop Stream processing framework",
+        "service_version" : "0.9.0.1"
+      }
     }
   ]
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/727f082a/ambari-web/app/assets/data/wizard/stack/hdp/version/2.0.5.json
----------------------------------------------------------------------
diff --git a/ambari-web/app/assets/data/wizard/stack/hdp/version/2.0.5.json b/ambari-web/app/assets/data/wizard/stack/hdp/version/2.0.5.json
index 7018b27..3a37bc6 100644
--- a/ambari-web/app/assets/data/wizard/stack/hdp/version/2.0.5.json
+++ b/ambari-web/app/assets/data/wizard/stack/hdp/version/2.0.5.json
@@ -143,6 +143,17 @@
         "comments" : "Apache Hadoop Distributed File System",
         "service_version" : "2.0.3.22-1"
       }
+    },
+    {
+      "href" : "http://192.168.56.101:8080/api/v1/stacks2/HDP/versions/2.0.1/stackServices/STORM",
+      "StackServices" : {
+        "user_name" : "root",
+        "stack_version" : "2.0.1",
+        "service_name" : "STORM",
+        "stack_name" : "HDP",
+        "comments" : "Apache Hadoop Stream processing framework",
+        "service_version" : "0.9.0.1"
+      }
     }
   ]
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/727f082a/ambari-web/app/assets/data/wizard/stack/hdp/version2.0.1/STORM.json
----------------------------------------------------------------------
diff --git a/ambari-web/app/assets/data/wizard/stack/hdp/version2.0.1/STORM.json b/ambari-web/app/assets/data/wizard/stack/hdp/version2.0.1/STORM.json
new file mode 100644
index 0000000..9c3b6d5
--- /dev/null
+++ b/ambari-web/app/assets/data/wizard/stack/hdp/version2.0.1/STORM.json
@@ -0,0 +1,17 @@
+{
+  "href" : "http://dev.hortonworks.com:8080/api/v1/stacks2/HDP/versions/1.3.0/stackServices/STORM/configurations?fields=*",
+  "items" : [
+    {
+      "href" : "http://dev.hortonworks.com:8080/api/v1/stacks2/HDP/versions/1.3.0/stackServices/STORM/configurations/STORM.systemmode",
+      "StackConfigurations" : {
+        "property_description" : "\n     The place where jars are kept.\n     ",
+        "property_value" : "storm-local",
+        "stack_version" : "1.3.0",
+        "property_name" : "storm.local.dir",
+        "filename" : "storm-site.xml",
+        "service_name" : "STORM",
+        "stack_name" : "HDP"
+      }
+    }
+  ]
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/727f082a/ambari-web/app/controllers/wizard.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/wizard.js b/ambari-web/app/controllers/wizard.js
index 2a680dd..fdd9689 100644
--- a/ambari-web/app/controllers/wizard.js
+++ b/ambari-web/app/controllers/wizard.js
@@ -474,11 +474,11 @@ App.WizardController = Em.Controller.extend({
     });
 
     var data = [];
-
     // loop through all the service components
     for (var i = 0; i < displayOrderConfig.length; i++) {
       var entry = jsonData.items.findProperty("StackServices.service_name", displayOrderConfig[i].serviceName);
       if (entry) {
+        if (entry.StackServices.service_name == 'STORM' && !App.testMode) continue; // @todo remove this line after STORM integration
         var myService = Service.create({
           serviceName: entry.StackServices.service_name,
           displayName: displayOrderConfig[i].displayName,
@@ -512,7 +512,7 @@ App.WizardController = Em.Controller.extend({
   loadServicesFromServer: function () {
     var services = this.getDBProperty('service');
     if (services) {
-      return;
+//      return;
     }
     var apiService = this.loadServiceComponents();
     this.set('content.services', apiService);

http://git-wip-us.apache.org/repos/asf/ambari/blob/727f082a/ambari-web/app/controllers/wizard/step5_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/wizard/step5_controller.js b/ambari-web/app/controllers/wizard/step5_controller.js
index e674c18..860b343 100644
--- a/ambari-web/app/controllers/wizard/step5_controller.js
+++ b/ambari-web/app/controllers/wizard/step5_controller.js
@@ -352,6 +352,10 @@ App.WizardStep5Controller = Em.Controller.extend({
   getHueServer:function (noOfHosts) {
     return this.getGangliaServer(noOfHosts);
   },
+
+  getNimbusServer: function(noOfHosts) {
+    return this.getGangliaServer(noOfHosts);
+  },
   /**
    * Return hostName of masterNode for specified service
    * @param componentName
@@ -439,13 +443,15 @@ App.WizardStep5Controller = Em.Controller.extend({
         return this.getNagiosServer(noOfHosts);
       case 'HUE_SERVER':
         return this.getHueServer(noOfHosts);
+      case 'NIMBUS':
+        return this.getNimbusServer(noOfHosts);
+      default:
     }
   },
 
   masterHostMapping:function () {
     var mapping = [], mappingObject, self = this, mappedHosts, hostObj, hostInfo;
     //get the unique assigned hosts and find the master services assigned to them
-
     mappedHosts = this.get("selectedServicesMasters").mapProperty("selectedHost").uniq();
 
     mappedHosts.forEach(function (item) {

http://git-wip-us.apache.org/repos/asf/ambari/blob/727f082a/ambari-web/app/controllers/wizard/step8_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/wizard/step8_controller.js b/ambari-web/app/controllers/wizard/step8_controller.js
index 9089d21..f9853c3 100644
--- a/ambari-web/app/controllers/wizard/step8_controller.js
+++ b/ambari-web/app/controllers/wizard/step8_controller.js
@@ -522,6 +522,10 @@ App.WizardStep8Controller = Em.Controller.extend({
            this.loadSqoop(serviceObj);
            break;
            */
+          case 'STORM':
+            if (App.testMode) {
+              this.loadSTORM(serviceObj);
+            }
           case 'HCATALOG':
             break;
           default:
@@ -893,6 +897,32 @@ App.WizardStep8Controller = Em.Controller.extend({
     this.get('services').pushObject(pigObj);
   },
 
+  loadSTORM: function (stormObj) {
+    stormObj.get('service_components').forEach(function(component) {
+      switch (component.get('display_name')) {
+        case 'Nimbus':
+          this.loadNimbusValue(component);
+          break;
+        case 'SuperVisor':
+          this.loadSuperVisorValue(component);
+          break;
+        default:
+      }
+    }, this);
+    this.get('services').pushObject(stormObj);
+  },
+
+  loadNimbusValue: function(component) {
+    var nimbusHost = this.get('content.masterComponentHosts').filterProperty('display_name', component.get('display_name'));
+    component.set('component_value', nimbusHost[0].hostName);
+  },
+
+  loadSuperVisorValue: function(component) {
+    var hostsCount = this.get('content.slaveComponentHosts').findProperty('componentName', 'CLIENT').hosts.length;
+    var hostsText = hostsCount > 1 ? hostsCount + ' hosts' : hostsCount + ' host'
+    component.set('component_value', hostsText);
+  },
+
   /**
    * Onclick handler for <code>next</code> button
    */

http://git-wip-us.apache.org/repos/asf/ambari/blob/727f082a/ambari-web/app/data/HDP2/global_properties.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/data/HDP2/global_properties.js b/ambari-web/app/data/HDP2/global_properties.js
index 6e5430c..2941f33 100644
--- a/ambari-web/app/data/HDP2/global_properties.js
+++ b/ambari-web/app/data/HDP2/global_properties.js
@@ -1270,6 +1270,21 @@ module.exports =
       "serviceName": "GANGLIA",
       "category": "Advanced"
     },
+  /**********************************************STORM***************************************/
+    // @todo create real properties
+    {
+      "id": "puppet var",
+      "name": "nimbus.thrift.port",
+      "displayName": "nimbus.thrift.port",
+      "description": "",
+      "defaultValue": "6627",
+      "isReconfigurable": false,
+      "displayType": "int",
+      "isVisible": true,
+      "isRequiredByAgent": true,
+      "serviceName": "STORM",
+      "category": "Nimbus"
+    },
   /**********************************************MISC***************************************/
     {
       "id": "puppet var",
@@ -1525,6 +1540,20 @@ module.exports =
     },
     {
       "id": "puppet var",
+      "name": "storm_user",
+      "displayName": "Storm User",
+      "description": "User to run Storm as",
+      "defaultValue": "storm",
+      "isReconfigurable": false,
+      "displayType": "user",
+      "isOverridable": false,
+      "isVisible": true,
+      "serviceName":"MISC",
+      "category": "Users and Groups",
+      "belongsToService":["STORM"]
+    },
+    {
+      "id": "puppet var",
       "name": "rrdcached_base_dir",
       "displayName": "Ganglia rrdcached base directory",
       "description": "Default directory for saving the rrd files on ganglia server",
@@ -1536,6 +1565,7 @@ module.exports =
       "serviceName": "GANGLIA",
       "category": "General",
       "belongsToService":["GANGLIA"]
-    }
+    },
+
   ]
 };

http://git-wip-us.apache.org/repos/asf/ambari/blob/727f082a/ambari-web/app/data/HDP2/ha_properties.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/data/HDP2/ha_properties.js b/ambari-web/app/data/HDP2/ha_properties.js
index 41f94d9..0402a91 100644
--- a/ambari-web/app/data/HDP2/ha_properties.js
+++ b/ambari-web/app/data/HDP2/ha_properties.js
@@ -1,3 +1,20 @@
+/**
+ * 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.
+ */
 module.exports =
 {
   "haConfig": {
@@ -207,4 +224,4 @@ module.exports =
       }
     ]
   }
-};
\ No newline at end of file
+};

http://git-wip-us.apache.org/repos/asf/ambari/blob/727f082a/ambari-web/app/data/review_configs.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/data/review_configs.js b/ambari-web/app/data/review_configs.js
index 8d55cfe..edf0b96 100644
--- a/ambari-web/app/data/review_configs.js
+++ b/ambari-web/app/data/review_configs.js
@@ -212,8 +212,22 @@ module.exports = [
             component_value: ''
           })
         ]
+      }),
+      Ember.Object.create({
+        service_name: 'STORM',
+        display_name: 'Storm',
+        service_components: [
+          Ember.Object.create({
+            display_name: 'Nimbus',
+            component_value: ''
+          }),
+          Ember.Object.create({
+            display_name: 'SuperVisor',
+            component_value: ''
+          })
+        ]
       })
 
     ]
   }
-];
\ No newline at end of file
+];

http://git-wip-us.apache.org/repos/asf/ambari/blob/727f082a/ambari-web/app/data/service_components.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/data/service_components.js b/ambari-web/app/data/service_components.js
index eba0c62..8579969 100644
--- a/ambari-web/app/data/service_components.js
+++ b/ambari-web/app/data/service_components.js
@@ -345,7 +345,7 @@ module.exports = new Ember.Set([
     component_name: 'SUPERVISOR',
     display_name: 'Supervisor',
     isMaster: false,
-    isClient: false,
+    isClient: true,
     description: 'Client component for STORM'
   }
 ]);

http://git-wip-us.apache.org/repos/asf/ambari/blob/727f082a/ambari-web/app/data/service_configs.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/data/service_configs.js b/ambari-web/app/data/service_configs.js
index 4cab85f..020d743 100644
--- a/ambari-web/app/data/service_configs.js
+++ b/ambari-web/app/data/service_configs.js
@@ -216,7 +216,16 @@ module.exports = [
     sites: ['pig-log4j'],
     configs: []
   },
-
+  // @todo change to actual info
+  {
+    serviceName: 'STORM',
+    displayName: 'Storm',
+    configCategories: [
+      App.ServiceConfigCategory.create({ name: 'Nimbus', displayName : 'Nimbus'})
+    ],
+    sites: ['storm-site'],
+    configs: []
+  },
   {
     serviceName: 'MISC',
     displayName: 'Misc',

http://git-wip-us.apache.org/repos/asf/ambari/blob/727f082a/ambari-web/app/data/services.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/data/services.js b/ambari-web/app/data/services.js
index d82e64b..837ce70 100644
--- a/ambari-web/app/data/services.js
+++ b/ambari-web/app/data/services.js
@@ -162,6 +162,7 @@ module.exports = [
     isDisabled: false,
     isSelected: App.testMode,
     canBeSelected: App.testMode,
-    isHidden: !App.testMode
+    isHidden: !App.testMode,
+    description: Em.I18n.t('services.storm.description')
   }
 ]
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/727f082a/ambari-web/app/messages.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/messages.js b/ambari-web/app/messages.js
index bd88b18..9b1d6bf 100644
--- a/ambari-web/app/messages.js
+++ b/ambari-web/app/messages.js
@@ -248,6 +248,7 @@ Em.I18n.translations = {
   'services.mapreduce2.description':'Apache Hadoop NextGen MapReduce (client libraries)',
   'services.yarn.description':'Apache Hadoop NextGen MapReduce (YARN)',
   'services.tez.description':'Tez is the next generation Hadoop Query Processing framework written on top of YARN',
+  'services.storm.description': 'Apache Hadoop Stream processing framework',
 
   'services.alerts.head':'You have {0} critical alert notification(s).',
   'services.alerts.OK.timePrefix': 'OK for ',

http://git-wip-us.apache.org/repos/asf/ambari/blob/727f082a/ambari-web/app/models/service_config.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/models/service_config.js b/ambari-web/app/models/service_config.js
index e8ee95e..74f147b 100644
--- a/ambari-web/app/models/service_config.js
+++ b/ambari-web/app/models/service_config.js
@@ -89,8 +89,8 @@ App.ServiceConfigCategory = Ember.Object.extend({
   }.property('name'),
 
   isForSlaveComponent: function () {
-    return this.get('name') === 'DataNode' || this.get('name') === 'TaskTracker' ||
-      this.get('name') === 'RegionServer';
+    var slaveComponents = ['DataNode', 'TaskTracker', 'RegionServer']
+    return (slaveComponents.contains(this.get('name')));
   }.property('name'),
 
   slaveErrorCount: function () {
@@ -402,6 +402,7 @@ App.ServiceConfigProperty = Ember.Object.extend({
         var zkHostPort = zkHosts;
         var regex = "\\w*:(\\d+)";   //regex to fetch the port
         var portValue = this.get('defaultValue').match(new RegExp(regex));
+        if (!portValue) return;
         if (portValue[1]) {
           for ( var i = 0; i < zkHosts.length; i++ ) {
             zkHostPort[i] = zkHosts[i] + ":" + portValue[1];