Browse Source

AMBARI-980. Allow installation of various service components. (yusaku)

git-svn-id: https://svn.apache.org/repos/asf/incubator/ambari/branches/AMBARI-666@1406458 13f79535-47bb-0310-9956-ffa450edef68
Yusaku Sako 12 năm trước cách đây
mục cha
commit
e326e13c32

+ 2 - 0
AMBARI-666-CHANGES.txt

@@ -12,6 +12,8 @@ AMBARI-666 branch (unreleased changes)
 
   NEW FEATURES
 
+  AMBARI-980. Allow installation of various service components. (yusaku)
+
   AMBARI-949. Provide metric graphs for individual hosts. (Srimanth
   Gunturi via yusaku)
 

+ 1 - 1
ambari-web/app/controllers/wizard/step5_controller.js

@@ -322,7 +322,7 @@ App.WizardStep5Controller = Em.Controller.extend({
       return this.getKerberosServer(noOfHosts).host_name;
     } else if (componentName === 'NAMENODE') {
       return this.getNameNode(noOfHosts).host_name;
-    } else if (componentName === 'SNAMENODE') {
+    } else if (componentName === 'SECONDARY_NAMENODE') {
       return this.getSNameNode(noOfHosts).host_name;
     } else if (componentName === 'JOBTRACKER') {
       return this.getJobTracker(noOfHosts).host_name;

+ 19 - 8
ambari-web/app/controllers/wizard/step8_controller.js

@@ -511,7 +511,10 @@ App.WizardStep8Controller = Em.Controller.extend({
       var components = serviceComponents.filterProperty('service_name', _service);
       components.forEach(function (_component) {
         console.log("value of component is: " + _component.component_name);
-        this.createComponent(_service, _component.component_name);
+        // TODO: Skipping CLIENT components as we have issues on the server side for integration purposes
+        if (!_component.component_name.match(/CLIENT$/)) {
+          this.createComponent(_service, _component.component_name);
+        }
       }, this);
     }, this);
     //TODO: Remove below code after hooking up with all services.
@@ -600,7 +603,8 @@ App.WizardStep8Controller = Em.Controller.extend({
           slaveObj.component = _client.component_name;
           _slaveHosts.hosts.forEach(function (_slaveHost) {
             slaveObj.hostName = _slaveHost.hostname;
-            this.createHostComponent(slaveObj);
+            // TODO: Skip creation of clients for integration purposes
+            // this.createHostComponent(slaveObj);
           }, this);
         }, this);
       }
@@ -659,7 +663,7 @@ App.WizardStep8Controller = Em.Controller.extend({
     $.ajax({
       type: 'POST',
       url: url,
-      data: data,
+      data: JSON.stringify(data),
       async: false,
       dataType: 'text',
       timeout: 5000,
@@ -682,7 +686,7 @@ App.WizardStep8Controller = Em.Controller.extend({
   },
 
   createCoreSiteObj: function () {
-    return '{"type": "core-site", "tag": "version1", "properties": { "fs.default.name": "localhost:8020"}}';
+    return {"type": "core-site", "tag": "version1", "properties": { "fs.default.name": "localhost:8020"}};
   },
 
   createHdfsSiteObj: function (serviceName) {
@@ -691,8 +695,9 @@ App.WizardStep8Controller = Em.Controller.extend({
     configs.forEach(function (_configProperty) {
       hdfsProperties[_configProperty.name] = _configProperty.value;
     }, this);
+    // TODO: Using hardcoded params until meta data API becomes available
     hdfsProperties = {"dfs.datanode.data.dir.perm": "750"};
-    return '{"type": "hdfs-site", "tag": "version1", "properties":' + JSON.stringify(hdfsProperties) + '}';
+    return {"type": "hdfs-site", "tag": "version1", "properties": hdfsProperties };
   },
 
   createMrSiteObj: function (serviceName) {
@@ -701,7 +706,13 @@ App.WizardStep8Controller = Em.Controller.extend({
     configs.forEach(function (_configProperty) {
       mrProperties[_configProperty.name] = _configProperty.value;
     }, this);
-    return{type: 'mapred-site', tag: 'version1', properties: mrProperties};
+    // TODO: Using hardcoded params until meta data API becomes available
+    mrProperties = {
+      "mapred.job.tracker": "localhost:50300",
+      "mapreduce.history.server.embedded": "false",
+      "mapreduce.history.server.http.address": "localhost:51111"
+    };
+    return {type: 'mapred-site', tag: 'version1', properties: mrProperties};
   },
 
   createHbaseSiteObj: function (serviceName) {
@@ -710,7 +721,7 @@ App.WizardStep8Controller = Em.Controller.extend({
     configs.forEach(function (_configProperty) {
       hbaseProperties[_configProperty.name] = _configProperty.value;
     }, this);
-    return{type: 'hbase-site', tag: 'version1', properties: hbaseProperties};
+    return {type: 'hbase-site', tag: 'version1', properties: hbaseProperties};
   },
 
   createHiveSiteObj: function (serviceName) {
@@ -719,7 +730,7 @@ App.WizardStep8Controller = Em.Controller.extend({
     configs.forEach(function (_configProperty) {
       hiveProperties[_configProperty.name] = _configProperty.value;
     }, this);
-    return{type: 'hbase-site', tag: 'version1', properties: hiveProperties};
+    return {type: 'hbase-site', tag: 'version1', properties: hiveProperties};
   },
 
   applyCreatedConfToServices: function () {

+ 13 - 13
ambari-web/app/controllers/wizard/step9_controller.js

@@ -345,9 +345,9 @@ App.WizardStep9Controller = Em.Controller.extend({
     return hostArr;
   },
 
-  setHostsStatus: function (hosts, status) {
-    hosts.forEach(function (_host) {
-      var host = this.hosts.findProperty('name', _host.Tasks.host_name);
+  setHostsStatus: function (hostNames, status) {
+    hostNames.forEach(function (_hostName) {
+      var host = this.hosts.findProperty('name', _hostName);
       host.set('status', status);
       host.set('progress', '100');
     }, this);
@@ -391,7 +391,7 @@ App.WizardStep9Controller = Em.Controller.extend({
           this.set('progress', '100');
           this.set('status', 'failed');
           this.setHostsStatus(this.getFailedHostsForFailedRoles(polledData), 'failed');
-	  App.router.get('installerController').saveClusterStatus(clusterStatus);
+          App.router.get('installerController').saveClusterStatus(clusterStatus);
           this.set('isStepCompleted', true);
         } else {
           clusterStatus.status = 'INSTALLED';
@@ -407,7 +407,7 @@ App.WizardStep9Controller = Em.Controller.extend({
 
   getCompletedTasksForHost: function (host) {
     var hostname = host.get('name');
-    var tasksPerHost = host.tasks.filterProperty('Tasks.host_name',hostname);
+    var tasksPerHost = host.tasks.filterProperty('Tasks.host_name', hostname);
     var succededTasks = tasksPerHost.filterProperty('Tasks.status', 'COMPLETED');
     var inProgressTasks = tasksPerHost.filterProperty('Tasks.status', 'IN_PROGRESS');
     var listedTasksPerHost = succededTasks.concat(inProgressTasks).uniq();
@@ -415,16 +415,16 @@ App.WizardStep9Controller = Em.Controller.extend({
   },
 
   // This is done at HostRole level.
-  setTasksStatePerHost: function(tasksPerHost,host) {
+  setTasksStatePerHost: function (tasksPerHost, host) {
     var tasks = [];
-    tasksPerHost.forEach(function(_taskPerHost){
-      if(_taskPerHost.Tasks.status !== 'PENDING' &&_taskPerHost.Tasks.status !== 'QUEUED') {
-        var task =  host.tasks.findProperty('Tasks.id',_taskPerHost.Tasks.id);
-        if(!(task && (task.Tasks.command === _taskPerHost.Tasks.command))) {
-        host.tasks.pushObject(_taskPerHost);
+    tasksPerHost.forEach(function (_taskPerHost) {
+      if (_taskPerHost.Tasks.status !== 'PENDING' && _taskPerHost.Tasks.status !== 'QUEUED') {
+        var task = host.tasks.findProperty('Tasks.id', _taskPerHost.Tasks.id);
+        if (!(task && (task.Tasks.command === _taskPerHost.Tasks.command))) {
+          host.tasks.pushObject(_taskPerHost);
         }
       }
-    },this);
+    }, this);
   },
 
   parseHostInfo: function (polledData) {
@@ -452,7 +452,7 @@ App.WizardStep9Controller = Em.Controller.extend({
         this.onSuccessPerHost(actionsPerHost, _host);    // every action should be a success
         this.onWarningPerHost(actionsPerHost, _host);    // any action should be a faliure
         this.onInProgressPerHost(actionsPerHost, _host); // current running action for a host
-        this.setTasksStatePerHost(actionsPerHost,_host);
+        this.setTasksStatePerHost(actionsPerHost, _host);
         totalProgress = self.progressPerHost(actionsPerHost, _host);
       }
     }, this);

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

@@ -28,7 +28,7 @@ module.exports = new Ember.Set([
   },
   {
     service_name: 'HDFS',
-    component_name: 'SNAMENODE',
+    component_name: 'SECONDARY_NAMENODE',
     display_name: 'SNameNode',
     isMaster: true,
     isClient: false,

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

@@ -114,7 +114,7 @@ App.ServiceConfigProperty = Ember.Object.extend({
         this.set('value', temp.hostName);
         break;
       case 'snamenode.host':
-        this.set('value', masterComponentHostsInDB.findProperty('component','SNAMENODE').hostName);
+        this.set('value', masterComponentHostsInDB.findProperty('component','SECONDARY_NAMENODE').hostName);
         break;
       case 'jobtracker.host':
         this.set('value', masterComponentHostsInDB.findProperty('component','JOBTRACKER').hostName);