Ver código fonte

AMBARI-2989 UI needs ability to categorize, name and describe non-global configurations. (atkach)

atkach 11 anos atrás
pai
commit
cfa2f7f304

+ 1 - 1
ambari-web/app/controllers/main/admin/security/add/step4.js

@@ -366,7 +366,7 @@ App.MainAdminSecurityAddStep4Controller = Em.Controller.extend({
   loadGlobals: function () {
     var globals = this.get('content.serviceConfigProperties').filterProperty('id', 'puppet var');
     this.set('globalProperties', globals);
-    this.loadStaticGlobal(); //Hack for properties which are declared in config_properties.js and not able to retrieve values declared in secure_properties.js
+    this.loadStaticGlobal(); //Hack for properties which are declared in global_properties.js and not able to retrieve values declared in secure_properties.js
     this.loadUsersToGlobal();
     this.loadHostNamesToGlobal();
     this.loadPrimaryNamesToGlobals();

+ 2 - 2
ambari-web/app/controllers/main/service/info/configs.js

@@ -39,8 +39,8 @@ App.MainServiceInfoConfigsController = Em.Controller.extend({
     return App.config.get('configMapping');
   }.property('App.config.configMapping'),
   configs: function() {
-    return  App.config.get('preDefinedConfigProperties');
-  }.property('App.config.preDefinedConfigProperties'),
+    return  App.config.get('preDefinedGlobalProperties');
+  }.property('App.config.preDefinedGlobalProperties'),
 
   secureConfigs: require('data/secure_mapping'),
 

+ 106 - 81
ambari-web/app/data/HDP2/config_properties.js → ambari-web/app/data/HDP2/global_properties.js

@@ -93,7 +93,7 @@ module.exports =
     },
     {
       "id": "puppet var",
-      "name": "dfs_namenode_name_dir",
+      "name": "dfs_name_dir",
       "displayName": "NameNode directories",
       "description": "NameNode directories for HDFS to store the file system image",
       "defaultValue": "",
@@ -153,7 +153,7 @@ module.exports =
     },
     {
       "id": "puppet var",
-      "name": "dfs_namenode_checkpoint_dir",
+      "name": "fs_checkpoint_dir",
       "displayName": "SecondaryNameNode Checkpoint directory",
       "description": "Directory on the local filesystem where the Secondary NameNode should store the temporary images to merge",
       "defaultValue": "",
@@ -184,7 +184,7 @@ module.exports =
     },
     {
       "id": "puppet var",
-      "name": "dfs_datanode_data_dir",
+      "name": "dfs_data_dir",
       "displayName": "DataNode directories",
       "description": "DataNode directories for HDFS to store the data blocks",
       "defaultValue": "",
@@ -264,7 +264,7 @@ module.exports =
     },
     {
       "id": "puppet var",
-      "name": "dfs_namenode_checkpoint_period",
+      "name": "fs_checkpoint_period",
       "displayName": "HDFS Maximum Checkpoint Delay",
       "description": "Maximum delay between two consecutive checkpoints for HDFS",
       "defaultValue": "21600",
@@ -345,6 +345,19 @@ module.exports =
       "serviceName": "HDFS",
       "category": "Advanced"
     },
+    {
+      "id": "puppet var",
+      "name": "dfs_include",
+      "displayName": "Include hosts",
+      "description": "Names a file that contains a list of hosts that are permitted to connect to the namenode.  This file will be placed inside the Hadoop conf directory.",
+      "defaultValue": "dfs.include",
+      "displayType": "advanced",
+      "isVisible": true,
+      "filename": "hdfs-site.xml",
+      "domain": "global",
+      "serviceName": "HDFS",
+      "category": "Advanced"
+    },
     {
       "id": "puppet var",
       "name": "dfs_replication",
@@ -427,19 +440,6 @@ module.exports =
       "serviceName": "HDFS",
       "category": "Advanced"
     },
-    {
-      "id": "puppet var",
-      "name": "hdfs_enable_shortcircuit_read",
-      "displayName": "HDFS Short-circuit read",
-      "description": "",
-      "defaultValue": true,
-      "isRequired": false,
-      "displayType": "checkbox",
-      "isVisible": true,
-      "domain": "global",
-      "serviceName": "HDFS",
-      "category": "Advanced"
-    },
 
   /**********************************************MAPREDUCE2***************************************/
     {
@@ -458,7 +458,32 @@ module.exports =
     },
     {
       "id": "puppet var",
-      "name": "mapreduce_tasktracker_map_tasks_maximum",
+      "name": "mapred_local_dir",
+      "displayName": "MapReduce local directories",
+      "description": "Directories for MapReduce to store intermediate data files",
+      "defaultValue": "",
+      "defaultDirectory": "/hadoop/mapred",
+      "displayType": "directories",
+      "isReconfigurable": true,
+      "isVisible": true,
+      "domain": "global",
+      "serviceName": "MAPREDUCE2"
+    },
+    {
+      "id": "puppet var",
+      "name": "mapred_cluster_red_mem_mb",
+      "displayName": "Cluster's Reduce slot size (virtual memory)",
+      "description": "The virtual memory size of a single Reduce slot in the MapReduce framework",
+      "defaultValue": "2048",
+      "displayType": "int",
+      "unit": "MB",
+      "isVisible": true,
+      "domain": "global",
+      "serviceName": "MAPREDUCE2"
+    },
+    {
+      "id": "puppet var",
+      "name": "mapred_map_tasks_max",
       "displayName": "Number of Map slots per node",
       "description": "Number of slots that Map tasks that run simultaneously can occupy on a TaskTracker",
       "defaultValue": "4",
@@ -469,7 +494,7 @@ module.exports =
     },
     {
       "id": "puppet var",
-      "name": "mapreduce_map_memory_mb",
+      "name": "mapred_job_map_mem_mb",
       "displayName": "Default virtual memory for a job's map-task",
       "description": "Virtual memory for single Map task",
       "defaultValue": "1536",
@@ -481,7 +506,7 @@ module.exports =
     },
     {
       "id": "puppet var",
-      "name": "mapreduce_reduce_memory_mb",
+      "name": "mapred_job_red_mem_mb",
       "displayName": "Default virtual memory for a job's reduce-task",
       "description": "Virtual memory for single Reduce task",
       "defaultValue": "2048",
@@ -526,6 +551,30 @@ module.exports =
       "domain": "global",
       "serviceName": "MAPREDUCE2"
     },
+    {
+      "id": "puppet var",
+      "name": "mapred_cluster_max_map_mem_mb",
+      "displayName": "Upper limit on virtual memory for single Map task",
+      "description": "Upper limit on virtual memory size for a single Map task of any MapReduce job",
+      "defaultValue": "6144",
+      "displayType": "int",
+      "unit": "MB",
+      "isVisible": true,
+      "domain": "global",
+      "serviceName": "MAPREDUCE2"
+    },
+    {
+      "id": "puppet var",
+      "name": "mapred_cluster_max_red_mem_mb",
+      "displayName": "Upper limit on virtual memory for single Reduce task",
+      "description": "Upper limit on virtual memory size for a single Reduce task of any MapReduce job",
+      "defaultValue": "4096",
+      "displayType": "int",
+      "unit": "MB",
+      "isVisible": true,
+      "domain": "global",
+      "serviceName": "MAPREDUCE2"
+    },
     {
       "id": "puppet var",
       "name": "scheduler_name",
@@ -539,7 +588,19 @@ module.exports =
     },
     {
       "id": "puppet var",
-      "name": "mapreduce_jobtracker_system_dir",
+      "name": "mapred_cluster_map_mem_mb",
+      "displayName": "Cluster's Map slot size (virtual memory)",
+      "description": "The virtual memory size of a single Map slot in the MapReduce framework",
+      "defaultValue": "1536",
+      "displayType": "int",
+      "unit": "MB",
+      "isVisible": true,
+      "domain": "global",
+      "serviceName": "MAPREDUCE2"
+    },
+    {
+      "id": "puppet var",
+      "name": "mapred_system_dir",
       "displayName": "MapReduce system directories",
       "description": "",
       "defaultValue": "/mapred/system",
@@ -558,7 +619,6 @@ module.exports =
       "defaultValue": "/var/log/hadoop-mapreduce",
       "displayType": "directory",
       "isVisible": true,
-      "isReconfigurable": false,
       "domain": "global",
       "serviceName": "MAPREDUCE2",
       "category": "Advanced"
@@ -571,7 +631,6 @@ module.exports =
       "defaultValue": "/var/run/hadoop-mapreduce",
       "displayType": "directory",
       "isVisible": true,
-      "isReconfigurable": false,
       "domain": "global",
       "serviceName": "MAPREDUCE2",
       "category": "Advanced"
@@ -625,26 +684,11 @@ module.exports =
       "category": "Advanced"
     },
   /**********************************************YARN***************************************/
-    {
-      "id": "puppet var",
-      "name": "yarn_heapsize",
-      "displayName": "Yarn Java heap size",
-      "description": "Max heapsize for all YARN components",
-      "defaultValue": "1024",
-      "isOverridable": false,
-      "displayType": "int",
-      "unit": "MB",
-      "isVisible": true,
-      "domain": "global",
-      "serviceName": "YARN",
-      "category": "General",
-      "index": 0
-    },
     {
       "id": "puppet var",
       "name": "rm_host",
-      "displayName": "ResourceManager",
-      "description": "ResourceManager",
+      "displayName": "Resource Manager",
+      "description": "Resource Manager",
       "defaultValue": "",
       "isOverridable": false,
       "displayType": "masterHost",
@@ -654,26 +698,11 @@ module.exports =
       "category": "ResourceManager",
       "index": 0
     },
-    {
-      "id": "puppet var",
-      "name": "resourcemanager_heapsize",
-      "displayName": "ResourceManager Java heap size",
-      "description": "Max heapsize for ResourceManager",
-      "defaultValue": "1024",
-      "isOverridable": false,
-      "displayType": "int",
-      "unit": "MB",
-      "isVisible": true,
-      "domain": "global",
-      "serviceName": "YARN",
-      "category": "ResourceManager",
-      "index": 0
-    },
     {
       "id": "puppet var",
       "name": "nm_hosts",
-      "displayName": "NodeManager",
-      "description": "List of NodeManager Hosts.",
+      "displayName": "Node Manager",
+      "description": "List of Node Manager Hosts.",
       "defaultValue": "",
       "isOverridable": false,
       "displayType": "slaveHosts",
@@ -683,21 +712,6 @@ module.exports =
       "category": "NodeManager",
       "index": 0
     },
-    {
-      "id": "puppet var",
-      "name": "nodemanager_heapsize",
-      "displayName": "NodeManager Java heap size",
-      "description": "Max heapsize for NodeManager",
-      "defaultValue": "1024",
-      "isOverridable": false,
-      "displayType": "int",
-      "unit": "MB",
-      "isVisible": true,
-      "domain": "global",
-      "serviceName": "YARN",
-      "category": "NodeManager",
-      "index": 0
-    },
     {
       "id": "puppet var",
       "name": "yarn_log_dir_prefix",
@@ -705,7 +719,6 @@ module.exports =
       "description": "",
       "defaultValue": "/var/log/hadoop-yarn",
       "displayType": "directory",
-      "isReconfigurable": false,
       "isVisible": true,
       "domain": "global",
       "serviceName": "YARN",
@@ -719,7 +732,6 @@ module.exports =
       "defaultValue": "/var/run/hadoop-yarn",
       "displayType": "directory",
       "isVisible": true,
-      "isReconfigurable": false,
       "domain": "global",
       "serviceName": "YARN",
       "category": "Advanced"
@@ -981,6 +993,19 @@ module.exports =
       "serviceName": "HBASE",
       "category": "Advanced"
     },
+    {
+      "id": "puppet var",
+      "name": "hdfs_enable_shortcircuit_read",
+      "displayName": "HDFS Short-circuit read",
+      "description": "",
+      "defaultValue": true,
+      "isRequired": false,
+      "displayType": "checkbox",
+      "isVisible": true,
+      "domain": "global",
+      "serviceName": "HBASE",
+      "category": "Advanced"
+    },
     {
       "id": "puppet var",
       "name": "hdfs_support_append",
@@ -1216,7 +1241,7 @@ module.exports =
       "displayName": "Database Name",
       "description": "Database name used as the Hive Metastore",
       "defaultValue": "hive",
-      "isReconfigurable": true,
+      "isReconfigurable": false,
       "displayType": "host",
       "isOverridable": false,
       "isVisible": true,
@@ -1232,7 +1257,7 @@ module.exports =
       "displayName": "Database Username",
       "description": "Database user name to use to connect to the database",
       "defaultValue": "hive",
-      "isReconfigurable": true,
+      "isReconfigurable": false,
       "displayType": "user",
       "isOverridable": false,
       "isVisible": true,
@@ -1247,7 +1272,7 @@ module.exports =
       "displayName": "Database Password",
       "description": "Database password to use to connect to the PostgreSQL database",
       "defaultValue": "",
-      "isReconfigurable": true,
+      "isReconfigurable": false,
       "displayType": "password",
       "isOverridable": false,
       "isVisible": true,
@@ -1548,7 +1573,7 @@ module.exports =
       "displayName": "Database Name",
       "description": "Database name used for the Oozie",
       "defaultValue": "oozie",
-      "isReconfigurable": true,
+      "isReconfigurable": false,
       "isOverridable": false,
       "displayType": "host",
       "isVisible": true,
@@ -1564,7 +1589,7 @@ module.exports =
       "displayName": "Database Username",
       "description": "Database user name to use to connect to the database",
       "defaultValue": "oozie",
-      "isReconfigurable": true,
+      "isReconfigurable": false,
       "isOverridable": false,
       "displayType": "user",
       "isVisible": true,
@@ -1579,7 +1604,7 @@ module.exports =
       "displayName": "Database Password",
       "description": "Database password to use to connect to the database",
       "defaultValue": "",
-      "isReconfigurable": true,
+      "isReconfigurable": false,
       "isOverridable": false,
       "displayType": "password",
       "isVisible": true,
@@ -1609,7 +1634,7 @@ module.exports =
       "description": "Data directory in which the Oozie DB exists",
       "defaultValue": "",
       "defaultDirectory": "/hadoop/oozie/data",
-      "isReconfigurable": true,
+      "isReconfigurable": false,
       "displayType": "directory",
       "isOverridable": false,
       "isVisible": true,

+ 22 - 0
ambari-web/app/data/HDP2/site_properties.js

@@ -0,0 +1,22 @@
+/**
+ * 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 =
+{
+  "configProperties": [
+  ]
+};

+ 16 - 16
ambari-web/app/data/config_properties.js → ambari-web/app/data/global_properties.js

@@ -1860,22 +1860,22 @@ module.exports =
       "index": 7
     },
     {
-      "id": "puppet var",
-      "name": "oozie_data_dir",
-      "displayName": "Oozie Data Dir",
-      "description": "Data directory in which the Oozie DB exists",
-      "defaultValue": "",
-      "defaultDirectory": "/hadoop/oozie/data",
-      "isReconfigurable": true,
-      "displayType": "directory",
-      "isOverridable": false,
-      "isVisible": true,
-      "isRequired": false,
-      "domain": "global",
-      "serviceName": "OOZIE",
-      "category": "Oozie Server",
-      "index": 8
-    },
+          "id": "puppet var",
+          "name": "oozie_data_dir",
+          "displayName": "Oozie Data Dir",
+          "description": "Data directory in which the Oozie DB exists",
+          "defaultValue": "",
+          "defaultDirectory": "/hadoop/oozie/data",
+          "isReconfigurable": false,
+          "displayType": "directory",
+          "isOverridable": false,
+          "isVisible": true,
+          "isRequired": false,
+          "domain": "global",
+          "serviceName": "OOZIE",
+          "category": "Oozie Server",
+          "index": 8
+      },
 
     {
       "id": "puppet var",

+ 22 - 0
ambari-web/app/data/site_properties.js

@@ -0,0 +1,22 @@
+/**
+ * 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 =
+{
+  "configProperties": [
+  ]
+};

+ 15 - 9
ambari-web/app/utils/config.js

@@ -26,25 +26,31 @@ var globalPropertyToServicesMap = null;
 App.config = Em.Object.create({
 
   preDefinedServiceConfigs: function(){
-    var configs = this.get('preDefinedConfigProperties');
+    var configs = this.get('preDefinedGlobalProperties');
     var services = [];
     require('data/service_configs').forEach(function(service){
       service.configs = configs.filterProperty('serviceName', service.serviceName);
       services.push(service);
     });
     return services;
-  }.property('preDefinedConfigProperties'),
+  }.property('preDefinedGlobalProperties'),
   configMapping: function() {
       if (App.get('isHadoop2Stack')) {
         return require('data/HDP2/config_mapping');
       }
     return require('data/config_mapping');
   }.property('App.isHadoop2Stack'),
-  preDefinedConfigProperties: function() {
+  preDefinedGlobalProperties: function() {
     if (App.get('isHadoop2Stack')) {
-      return require('data/HDP2/config_properties').configProperties;
+      return require('data/HDP2/global_properties').configProperties;
     }
-    return require('data/config_properties').configProperties;
+    return require('data/global_properties').configProperties;
+  }.property('App.isHadoop2Stack'),
+  preDefinedSiteProperties: function() {
+    if (App.get('isHadoop2Stack')) {
+      return require('data/HDP2/site_properties').configProperties;
+    }
+    return require('data/site_properties').configProperties;
   }.property('App.isHadoop2Stack'),
   preDefinedCustomConfigs: function () {
     if (App.get('isHadoop2Stack')) {
@@ -162,7 +168,7 @@ App.config = Em.Object.create({
   mergePreDefinedWithLoaded: function (configGroups, advancedConfigs, tags, serviceName) {
     var configs = [];
     var globalConfigs = [];
-    var preDefinedConfigs = this.get('preDefinedConfigProperties');
+    var preDefinedConfigs = this.get('preDefinedGlobalProperties').concat(this.get('preDefinedSiteProperties'));
     var mappingConfigs = [];
 
     tags.forEach(function (_tag) {
@@ -206,7 +212,7 @@ App.config = Em.Object.create({
           if (configsPropertyDef) {
             this.handleSpecialProperties(serviceConfigObj);
           } else {
-            serviceConfigObj.isVisible = false;  // if the global property is not defined on ui metadata config_properties.js then it shouldn't be a part of errorCount
+            serviceConfigObj.isVisible = false;  // if the global property is not defined on ui metadata global_properties.js then it shouldn't be a part of errorCount
           }
           serviceConfigObj.id = 'puppet var';
           serviceConfigObj.displayName = configsPropertyDef ? configsPropertyDef.displayName : null;
@@ -240,14 +246,14 @@ App.config = Em.Object.create({
    */
   mergePreDefinedWithStored: function (storedConfigs, advancedConfigs) {
     var mergedConfigs = [];
-    var preDefinedConfigs = $.extend(true, [], this.get('preDefinedConfigProperties'));
+    var preDefinedConfigs = $.extend(true, [], this.get('preDefinedGlobalProperties').concat(this.get('preDefinedSiteProperties')));
     var preDefinedNames = [];
     var storedNames = [];
     var names = [];
     var categoryMetaData = null;
     storedConfigs = (storedConfigs) ? storedConfigs : [];
 
-    preDefinedNames = this.get('preDefinedConfigProperties').mapProperty('name');
+    preDefinedNames = preDefinedConfigs.mapProperty('name');
     storedNames = storedConfigs.mapProperty('name');
     names = preDefinedNames.concat(storedNames).uniq();
     names.forEach(function (name) {