You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by sr...@apache.org on 2013/07/03 03:34:03 UTC

svn commit: r1499171 - in /incubator/ambari/trunk/ambari-web/app: controllers/main/admin/security/add/step2.js data/secure_configs.js data/secure_properties.js

Author: srimanth
Date: Wed Jul  3 01:34:03 2013
New Revision: 1499171

URL: http://svn.apache.org/r1499171
Log:
AMBARI-2507. Security wizard can show the list of hosts (e.g. all datanodes when configuring the name and keytab file path for DN) on the tab itself. (Andrii Tkach via srimanth)

Modified:
    incubator/ambari/trunk/ambari-web/app/controllers/main/admin/security/add/step2.js
    incubator/ambari/trunk/ambari-web/app/data/secure_configs.js
    incubator/ambari/trunk/ambari-web/app/data/secure_properties.js

Modified: incubator/ambari/trunk/ambari-web/app/controllers/main/admin/security/add/step2.js
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/controllers/main/admin/security/add/step2.js?rev=1499171&r1=1499170&r2=1499171&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/controllers/main/admin/security/add/step2.js (original)
+++ incubator/ambari/trunk/ambari-web/app/controllers/main/admin/security/add/step2.js Wed Jul  3 01:34:03 2013
@@ -42,6 +42,7 @@ App.MainAdminSecurityAddStep2Controller 
     console.log("TRACE: Loading addSecurity step2: Configure Services");
     this.clearStep();
     this.addMasterHostToGlobals(this.get('content.services'));
+    this.addSlaveHostToGlobals(this.get('content.services'));
     this.renderServiceConfigs(this.get('content.services'));
     var storedServices = this.get('content.serviceConfigProperties');
     if (storedServices) {
@@ -108,6 +109,32 @@ App.MainAdminSecurityAddStep2Controller 
     }, this);
   },
 
+  /**
+   * fill config with hosts of component
+   * @param service
+   * @param configName
+   * @param componentName
+   */
+  setHostsToConfig: function(service, configName, componentName){
+    if(service){
+      var hosts = service.configs.findProperty('name', configName);
+      if(hosts){
+        hosts.defaultValue = App.Service.find(service.serviceName)
+          .get('hostComponents')
+          .filterProperty('componentName', componentName)
+          .mapProperty('host.hostName');
+      }
+    }
+  },
+
+  addSlaveHostToGlobals: function(serviceConfigs){
+    var hdfsService = serviceConfigs.findProperty('serviceName', 'HDFS');
+    var mapReduceService = serviceConfigs.findProperty('serviceName', 'MAPREDUCE');
+    var hbaseService = serviceConfigs.findProperty('serviceName', 'HBASE');
+    this.setHostsToConfig(hdfsService, 'datanode_hosts', 'DATANODE');
+    this.setHostsToConfig(mapReduceService, 'tasktracker_hosts', 'TASKTRACKER');
+    this.setHostsToConfig(hbaseService, 'regionserver_hosts', 'HBASE_REGIONSERVER');
+  },
 
   addMasterHostToGlobals: function (serviceConfigs) {
     var oozieService = serviceConfigs.findProperty('serviceName', 'OOZIE');
@@ -115,6 +142,10 @@ App.MainAdminSecurityAddStep2Controller 
     var webHcatService = App.Service.find().mapProperty('serviceName').contains('WEBHCAT');
     var nagiosService = serviceConfigs.findProperty('serviceName', 'NAGIOS');
     var generalService = serviceConfigs.findProperty('serviceName', 'GENERAL');
+    var hbaseService = serviceConfigs.findProperty('serviceName', 'HBASE');
+    var zooKeeperService = serviceConfigs.findProperty('serviceName', 'ZOOKEEPER');
+    var hdfsService = serviceConfigs.findProperty('serviceName', 'HDFS');
+    var mapReduceService = serviceConfigs.findProperty('serviceName', 'MAPREDUCE');
     if (oozieService) {
       var oozieServerHost = oozieService.configs.findProperty('name', 'oozie_servername');
       var oozieServerPrincipal = oozieService.configs.findProperty('name', 'oozie_principal_name');
@@ -150,6 +181,22 @@ App.MainAdminSecurityAddStep2Controller 
         nagiosServerPrincipal.defaultValue = 'nagios/' + nagiosServerHost.defaultValue;
       }
     }
+    if(hdfsService){
+      var namenodeHost = hdfsService.configs.findProperty('name', 'namenode_host');
+      var sNamenodeHost = hdfsService.configs.findProperty('name', 'snamenode_host');
+      if (namenodeHost && sNamenodeHost) {
+        namenodeHost.defaultValue = App.Service.find('HDFS').get('hostComponents').findProperty('componentName', 'NAMENODE').get('host.hostName');
+        sNamenodeHost.defaultValue = App.Service.find('HDFS').get('hostComponents').findProperty('componentName', 'SECONDARY_NAMENODE').get('host.hostName');
+      }
+    }
+    if(mapReduceService){
+      var jobTrackerHost = mapReduceService.configs.findProperty('name', 'jobtracker_host');
+      if (jobTrackerHost) {
+        jobTrackerHost.defaultValue = App.Service.find('MAPREDUCE').get('hostComponents').findProperty('componentName', 'JOBTRACKER').get('host.hostName');
+      }
+    }
+    this.setHostsToConfig(hbaseService, 'hbasemaster_host', 'HBASE_MASTER');
+    this.setHostsToConfig(zooKeeperService, 'zookeeperserver_hosts', 'ZOOKEEPER_SERVER');
   },
 
   showHostPrincipalKeytabList: function(){

Modified: incubator/ambari/trunk/ambari-web/app/data/secure_configs.js
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/data/secure_configs.js?rev=1499171&r1=1499170&r2=1499171&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/data/secure_configs.js (original)
+++ incubator/ambari/trunk/ambari-web/app/data/secure_configs.js Wed Jul  3 01:34:03 2013
@@ -40,6 +40,7 @@ module.exports = [
     configCategories: [
       App.ServiceConfigCategory.create({ name: 'General', displayName: 'General'}),
       App.ServiceConfigCategory.create({ name: 'NameNode', displayName: 'NameNode'}),
+      App.ServiceConfigCategory.create({ name: 'SNameNode', displayName: 'Secondary NameNode'}),
       App.ServiceConfigCategory.create({ name: 'DataNode', displayName: 'DataNode'})
     ],
     sites: ['core-site', 'hdfs-site'],

Modified: incubator/ambari/trunk/ambari-web/app/data/secure_properties.js
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/data/secure_properties.js?rev=1499171&r1=1499170&r2=1499171&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/data/secure_properties.js (original)
+++ incubator/ambari/trunk/ambari-web/app/data/secure_properties.js Wed Jul  3 01:34:03 2013
@@ -150,6 +150,19 @@ module.exports =
     //HDFS
     {
       "id": "puppet var",
+      "name": "namenode_host",
+      "displayName": "NameNode host",
+      "value": "",
+      "defaultValue": "",
+      "description": "The host that has been assigned to run NameNode",
+      "displayType": "masterHost",
+      "isOverridable": false,
+      "isVisible": true,
+      "serviceName": "HDFS",
+      "category": "NameNode"
+    },
+    {
+      "id": "puppet var",
       "name": "namenode_principal_name",
       "displayName": "Principal name",
       "value": "",
@@ -178,6 +191,32 @@ module.exports =
     },
     {
       "id": "puppet var",
+      "name": "snamenode_host",
+      "displayName": "SNameNode host",
+      "value": "",
+      "defaultValue": "",
+      "description": "The host that has been assigned to run SecondaryNameNode",
+      "displayType": "masterHost",
+      "isOverridable": false,
+      "isVisible": true,
+      "serviceName": "HDFS",
+      "category": "SNameNode"
+    },
+    {
+      "id": "puppet var",
+      "name": "datanode_hosts", //not in the schema. For UI purpose
+      "displayName": "DataNode hosts",
+      "value": "",
+      "defaultValue": "",
+      "description": "The hosts that have been assigned to run DataNode",
+      "displayType": "slaveHosts",
+      "isOverridable": false,
+      "isVisible": true,
+      "serviceName": "HDFS",
+      "category": "DataNode"
+    },
+    {
+      "id": "puppet var",
       "name": "dfs_datanode_address",
       "displayName": "Datanode address",
       "value": "",
@@ -233,6 +272,19 @@ module.exports =
     //MAPREDUCE
     {
       "id": "puppet var",
+      "name": "jobtracker_host",
+      "displayName": "JobTracker host",
+      "value": "",
+      "defaultValue": "",
+      "description": "The host that has been assigned to run JobTracker",
+      "displayType": "masterHost",
+      "isOverridable": false,
+      "isVisible": true,
+      "serviceName": "MAPREDUCE",
+      "category": "JobTracker"
+    },
+    {
+      "id": "puppet var",
       "name": "jobtracker_principal_name",
       "displayName": "Principal name",
       "value": "",
@@ -261,6 +313,19 @@ module.exports =
     },
     {
       "id": "puppet var",
+      "name": "tasktracker_hosts",
+      "displayName": "TaskTracker hosts",
+      "value": "",
+      "defaultValue": "",
+      "description": "The hosts that have been assigned to run TaskTracker",
+      "displayType": "slaveHosts",
+      "isOverridable": false,
+      "isVisible": true,
+      "serviceName": "MAPREDUCE",
+      "category": "TaskTracker"
+    },
+    {
+      "id": "puppet var",
       "name": "tasktracker_principal_name",
       "displayName": "Principal name",
       "value": "",
@@ -305,6 +370,32 @@ module.exports =
     //HBASE
     {
       "id": "puppet var",
+      "name": "hbasemaster_host",
+      "displayName": "HBase Master hosts",
+      "value": "",
+      "defaultValue": "",
+      "description": "The host that has been assigned to run HBase Master",
+      "displayType": "masterHosts",
+      "isOverridable": false,
+      "isVisible": true,
+      "serviceName": "HBASE",
+      "category": "HBase"
+    },
+    {
+      "id": "puppet var",
+      "name": "regionserver_hosts",
+      "displayName": "RegionServer hosts",
+      "value": "",
+      "defaultValue": "",
+      "description": "The hosts that have been assigned to run RegionServer",
+      "displayType": "slaveHosts",
+      "isOverridable": false,
+      "isVisible": true,
+      "serviceName": "HBASE",
+      "category": "HBase"
+    },
+    {
+      "id": "puppet var",
       "name": "hbase_principal_name",
       "displayName": "Principal name",
       "value": "",
@@ -422,6 +513,19 @@ module.exports =
     //ZooKeeper
     {
       "id": "puppet var",
+      "name": "zookeeperserver_hosts",
+      "displayName": "ZooKeeper Server hosts",
+      "value": "",
+      "defaultValue": "",
+      "description": "The host that has been assigned to run ZooKeeper Server",
+      "displayType": "masterHosts",
+      "isVisible": true,
+      "isOverridable": false,
+      "serviceName": "ZOOKEEPER",
+      "category": "ZooKeeper Server"
+    },
+    {
+      "id": "puppet var",
       "name": "zookeeper_principal_name",
       "displayName": "Principal name",
       "value": "",