Repository: ambari Updated Branches: refs/heads/trunk 57fcb878d -> 9f27e084b
AMBARI-8331. Update categories for YARN configs on UI. (jaimin) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/9f27e084 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/9f27e084 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/9f27e084 Branch: refs/heads/trunk Commit: 9f27e084b64fc86526a19537011e8aa19fde5482 Parents: 57fcb87 Author: Jaimin Jetly <[email protected]> Authored: Tue Nov 4 03:06:12 2014 -0800 Committer: Jaimin Jetly <[email protected]> Committed: Tue Nov 4 03:06:12 2014 -0800 ---------------------------------------------------------------------- .../security/add/addSecurity_controller.js | 15 +- .../main/admin/security/add/step2.js | 5 + ambari-web/app/data/HDP2.2/site_properties.js | 3 +- ambari-web/app/data/HDP2.2/yarn_properties.js | 53 ++++ ambari-web/app/data/HDP2/secure_configs.js | 18 +- ambari-web/app/data/HDP2/secure_mapping.js | 243 ++++++++++++++++++- ambari-web/app/data/HDP2/secure_properties.js | 13 + ambari-web/app/data/HDP2/site_properties.js | 1 - ambari-web/app/models/stack_service.js | 4 +- .../security/add/addSecurity_controller_test.js | 8 +- 10 files changed, 341 insertions(+), 22 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/9f27e084/ambari-web/app/controllers/main/admin/security/add/addSecurity_controller.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/controllers/main/admin/security/add/addSecurity_controller.js b/ambari-web/app/controllers/main/admin/security/add/addSecurity_controller.js index 6fd7bc2..fc18f45 100644 --- a/ambari-web/app/controllers/main/admin/security/add/addSecurity_controller.js +++ b/ambari-web/app/controllers/main/admin/security/add/addSecurity_controller.js @@ -47,10 +47,17 @@ App.AddSecurityController = App.WizardController.extend({ * services with security configurations */ secureServices: function () { - return (App.get('isHadoop2Stack')) ? - $.extend(true, [], require('data/HDP2/secure_configs')) : - $.extend(true, [], require('data/secure_configs')); - }.property('App.isHadoop2Stack'), + if (App.get('isHadoop2Stack')) { + var configCategories = require('data/HDP2/secure_configs'); + if (this.get('content.isATSInstalled') && App.get('doesATSSupportKerberos')) { + var yarnConfigCategories = configCategories.findProperty('serviceName', 'YARN').configCategories; + yarnConfigCategories.push(App.ServiceConfigCategory.create({ name: 'AppTimelineServer', displayName : 'Application Timeline Service'})); + } + return configCategories; + } else { + return require('data/secure_configs'); + } + }.property('App.isHadoop2Stack', 'App.router.clusterController.isLoaded'), /** * Loads all prior steps on refresh http://git-wip-us.apache.org/repos/asf/ambari/blob/9f27e084/ambari-web/app/controllers/main/admin/security/add/step2.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/controllers/main/admin/security/add/step2.js b/ambari-web/app/controllers/main/admin/security/add/step2.js index dbe99dc..8ccd301 100644 --- a/ambari-web/app/controllers/main/admin/security/add/step2.js +++ b/ambari-web/app/controllers/main/admin/security/add/step2.js @@ -122,6 +122,11 @@ App.MainAdminSecurityAddStep2Controller = Em.Controller.extend({ components: ['RESOURCEMANAGER'] }, { + serviceName: 'YARN', + configName: 'apptimelineserver_host', + components: ['APP_TIMELINE_SERVER'] + }, + { serviceName: 'HBASE', configName: 'hbasemaster_host', components: ['HBASE_MASTER'] http://git-wip-us.apache.org/repos/asf/ambari/blob/9f27e084/ambari-web/app/data/HDP2.2/site_properties.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/data/HDP2.2/site_properties.js b/ambari-web/app/data/HDP2.2/site_properties.js index 979d16a..e1ea601 100644 --- a/ambari-web/app/data/HDP2.2/site_properties.js +++ b/ambari-web/app/data/HDP2.2/site_properties.js @@ -18,6 +18,7 @@ var App = require('app'); +var yarnProperties = require('data/HDP2.2/yarn_properties'); var tezProperties = require('data/HDP2.2/tez_properties'); var hdp2properties = require('data/HDP2/site_properties').configProperties; var excludedConfigs = [ @@ -82,7 +83,7 @@ hdp22properties.push( var additionalProperties = []; -tezProperties.forEach(function(config) { +yarnProperties.concat(tezProperties).forEach(function(config) { if (!hdp22properties.findProperty('name', config.name)) additionalProperties.push(config); else { hdp22properties.findProperty('name', config.name).category = config.category; http://git-wip-us.apache.org/repos/asf/ambari/blob/9f27e084/ambari-web/app/data/HDP2.2/yarn_properties.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/data/HDP2.2/yarn_properties.js b/ambari-web/app/data/HDP2.2/yarn_properties.js new file mode 100644 index 0000000..401ff08 --- /dev/null +++ b/ambari-web/app/data/HDP2.2/yarn_properties.js @@ -0,0 +1,53 @@ +/** + * 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. + */ +var App = require('app'); + +var yarnPropsToCategory = { + + 'FaultTolerance': [ + 'yarn.nodemanager.recovery.enabled', + 'yarn.resourcemanager.recovery.enabled', + 'yarn.resourcemanager.work-preserving-recovery.enabled', + 'yarn.resourcemanager.zk-address', + 'yarn.resourcemanager.connect.retry-interval.ms', + 'yarn.resourcemanager.connect.max-wait.ms', + 'yarn.resourcemanager.ha.enabled' + ], + + 'Isolation': [ + 'yarn.nodemanager.linux-container-executor.group', + 'yarn.nodemanager.linux-container-executor.resources-handler.class', + 'yarn.nodemanager.linux-container-executor.cgroups.hierarchy', + 'yarn.nodemanager.linux-container-executor.cgroups.mount', + 'yarn.nodemanager.linux-container-executor.cgroups.strict-resource-usage' + ], + + 'CapacityScheduler': [ + 'yarn.nodemanager.resource.cpu-vcores', + 'yarn.nodemanager.resource.percentage-physical-cpu-limit' + ] +}; + +var yarnProps = []; + +for (var category in yarnPropsToCategory) { + yarnProps = yarnProps.concat(App.config.generateConfigPropertiesByName(yarnPropsToCategory[category], + { category: category, serviceName: 'YARN', filename: 'yarn-site.xml'})); +} + +module.exports = yarnProps; http://git-wip-us.apache.org/repos/asf/ambari/blob/9f27e084/ambari-web/app/data/HDP2/secure_configs.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/data/HDP2/secure_configs.js b/ambari-web/app/data/HDP2/secure_configs.js index 6ece4af..c6600fe 100644 --- a/ambari-web/app/data/HDP2/secure_configs.js +++ b/ambari-web/app/data/HDP2/secure_configs.js @@ -25,17 +25,6 @@ App.SecureConfigProperties = Ember.ArrayProxy.extend({ var configProperties = App.SecureConfigProperties.create(); -// Dynamically create YARN properties -var yarnConfigProperties = [ - App.ServiceConfigCategory.create({ name: 'ResourceManager', displayName : 'ResourceManager'}), - App.ServiceConfigCategory.create({ name: 'NodeManager', displayName : 'NodeManager'}) -]; -var isATSInstalled = App.Service.find('YARN').get('hostComponents').someProperty('componentName', 'APP_TIMELINE_SERVER'); -var doesATSSupportKerberos = App.get("doesATSSupportKerberos"); -if (isATSInstalled && doesATSSupportKerberos) { - yarnConfigProperties.push(App.ServiceConfigCategory.create({ name: 'AppTimelineServer', displayName : 'ApplicationTimelineService'})); -} - var configs = [ { serviceName: 'GENERAL', @@ -75,8 +64,11 @@ var configs = [ serviceName: 'YARN', displayName: 'YARN', filename: 'yarn-site', - configCategories: yarnConfigProperties, // these properties can be dynamic - sites: ['yarn-site'], + configCategories: [ + App.ServiceConfigCategory.create({ name: 'ResourceManager', displayName : 'ResourceManager'}), + App.ServiceConfigCategory.create({ name: 'NodeManager', displayName : 'NodeManager'}) + ], // these properties can be dynamic + sites: ['yarn-site', 'core-site'], configs: configProperties.filterProperty('serviceName', 'YARN') }, { http://git-wip-us.apache.org/repos/asf/ambari/blob/9f27e084/ambari-web/app/data/HDP2/secure_mapping.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/data/HDP2/secure_mapping.js b/ambari-web/app/data/HDP2/secure_mapping.js index 27af72f..191bb63 100644 --- a/ambari-web/app/data/HDP2/secure_mapping.js +++ b/ambari-web/app/data/HDP2/secure_mapping.js @@ -18,7 +18,7 @@ // All of the "name" properties have to coincide with how they will appear in the *-site.xml file // The "template" properties can come from the config properties in site_properties.js or secure_properties.js . -module.exports = [ +var props = [ { "name": "hadoop.security.authentication", "templateName": [], @@ -786,3 +786,244 @@ module.exports = [ } ]; +var yarn22Mapping = [ + { + "name": 'hadoop.http.authentication.kerberos.principal', + "templateName": ["hadoop_http_principal_name", "kerberos_domain"], + "foreignKey": null, + "value": "<templateName[0]>@<templateName[1]>", + "serviceName": "HDFS", + "filename": "core-site.xml" + }, + { + "name": 'hadoop.http.authentication.kerberos.keytab', + "foreignKey": null, + "templateName": ["hadoop_http_keytab"], + "value": "<templateName[0]>", + "serviceName": "HDFS", + "filename": "core-site.xml" + }, + { + name: 'hadoop.http.authentication.kerberos.name.rules', + templateName: [], + foreignKey: null, + value: "", + "serviceName": "HDFS", + "filename": "core-site.xml" + }, + { + "name": 'yarn.timeline-service.http-authentication.signature.secret', + "templateName": [], + "foreignKey": null, + "value": "", + "serviceName": "YARN", + "filename": "yarn-site.xml" + }, + { + "name": 'yarn.timeline-service.http-authentication.signature.secret.file', + "value": "", + "templateName": [], + "foreignKey": null, + "serviceName": "YARN", + "filename": "yarn-site.xml" + }, + { + "name": 'yarn.timeline-service.http-authentication.signer.secret.provider', + "value": "", + "templateName": [], + "foreignKey": null, + "serviceName": "YARN", + "filename": "yarn-site.xml" + }, + { + "name": 'yarn.timeline-service.http-authentication.signer.secret.provider.object', + "value": "", + "templateName": [], + "foreignKey": null, + "serviceName": "YARN", + "filename": "yarn-site.xml" + }, + { + + "name": 'yarn.timeline-service.http-authentication.token.validity', + "templateName": [], + "foreignKey": null, + "value": "", + "serviceName": "YARN", + "filename": "yarn-site.xml" + }, + { + "name": 'yarn.timeline-service.http-authentication.cookie.domain', + "value": "", + "templateName": [], + "foreignKey": null, + "serviceName": "YARN", + "filename": "yarn-site.xml" + }, + { + "name": 'yarn.timeline-service.http-authentication.cookie.path', + "value": "", + "templateName": [], + "foreignKey": null, + "serviceName": "YARN", + "filename": "yarn-site.xml" + }, + { + "name": 'yarn.timeline-service.http-authentication.simple.anonymous.allowed', + "value": "true", + "templateName": [], + "foreignKey": null, + "serviceName": "YARN", + "filename": "yarn-site.xml" + }, + { + "name": 'yarn.timeline-service.http-authentication.proxyusers.*.hosts', + "value": "", + "templateName": [], + "foreignKey": null, + "serviceName": "YARN", + "filename": "yarn-site.xml" + }, + { + "name": 'yarn.timeline-service.http-authentication.proxyusers.*.users', + "value": "", + "serviceName": "YARN", + "templateName": [], + "foreignKey": null, + "filename": "yarn-site.xml" + }, + { + "name": 'yarn.timeline-service.http-authentication.proxyusers.*.groups', + "value": "", + "templateName": [], + "foreignKey": null, + "serviceName": "YARN", + "filename": "yarn-site.xml" + }, + { + "name": 'hadoop.http.filter.initializers', + "value": "", + "templateName": [], + "foreignKey": null, + "serviceName": "HDFS", + "filename": "core-site.xml" + }, + { + "name": 'hadoop.http.authentication.type', + "value": "simple", + "templateName": [], + "foreignKey": null, + "serviceName": "HDFS", + "filename": "core-site.xml" + }, + { + "name": 'hadoop.http.authentication.signature.secret', + "value": "", + "templateName": [], + "foreignKey": null, + "serviceName": "YARN", + "filename": "core-site.xml" + }, + { + "name": 'hadoop.http.authentication.signature.secret.file', + "value": "", + "templateName": [], + "foreignKey": null, + "serviceName": "HDFS", + "filename": "core-site.xml" + }, + { + "name": 'hadoop.http.authentication.signer.secret.provider', + "value": "", + "templateName": [], + "foreignKey": null, + "serviceName": "HDFS", + "filename": "core-site.xml" + }, + { + "name": 'hadoop.http.authentication.signer.secret.provider.object', + "value": "", + "templateName": [], + "foreignKey": null, + "serviceName": "HDFS", + "filename": "core-site.xml" + }, + { + "name": 'hadoop.http.authentication.token.validity', + "value": "", + "templateName": [], + "foreignKey": null, + "serviceName": "HDFS", + "filename": "core-site.xml" + }, + { + "name": 'hadoop.http.authentication.cookie.domain', + "value": "", + "templateName": [], + "foreignKey": null, + "serviceName": "HDFS", + "filename": "core-site.xml" + }, + { + "name": 'hadoop.http.authentication.cookie.path', + "value": "", + "templateName": [], + "foreignKey": null, + "serviceName": "HDFS", + "filename": "core-site.xml" + }, + { + "name": 'yarn.timeline-service.http-authentication.kerberos.name.rules', + "value": "", + "templateName": [], + "foreignKey": null, + "serviceName": "YARN", + "filename": "yarn-site.xml" + }, + { + "name": 'yarn.resourcemanager.proxyusers.*.hosts', + "value": "", + "templateName": [], + "foreignKey": null, + "serviceName": "YARN", + "filename": "yarn-site.xml" + }, + { + "name": 'yarn.resourcemanager.proxyusers.*.users', + "value": "", + "templateName": [], + "foreignKey": null, + "serviceName": "YARN", + "filename": "yarn-site.xml" + }, + { + "name": 'yarn.resourcemanager.proxyusers.*.groups', + "value": "", + "templateName": [], + "foreignKey": null, + "serviceName": "YARN", + "filename": "yarn-site.xml" + }, + { + "name": 'yarn.resourcemanager.proxy-user-privileges.enabled', + "value": "true", + "templateName": [], + "foreignKey": null, + "serviceName": "YARN", + "filename": "yarn-site.xml" + }, + { + "name": 'yarn.nodemanager.linux-container-executor.cgroups.mount-path', + "value": "", + "templateName": [], + "foreignKey": null, + "serviceName": "YARN", + "filename": "yarn-site.xml" + } +]; + +if (App.get('isHadoop22Stack')) { + props.pushObjects(yarn22Mapping); +} + +module.exports = props; http://git-wip-us.apache.org/repos/asf/ambari/blob/9f27e084/ambari-web/app/data/HDP2/secure_properties.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/data/HDP2/secure_properties.js b/ambari-web/app/data/HDP2/secure_properties.js index bba5582..ccc942e 100644 --- a/ambari-web/app/data/HDP2/secure_properties.js +++ b/ambari-web/app/data/HDP2/secure_properties.js @@ -473,6 +473,19 @@ var props = { // YARN Application Timeline Server { "id": "puppet var", + "name": "apptimelineserver_host", + "displayName": "Application Timeline Server host", + "value": "", + "defaultValue": "", + "description": "The host that has been assigned to run AppTimelineServer", + "displayType": "masterHost", + "isOverridable": false, + "isVisible": true, + "serviceName": "YARN", + "category": "AppTimelineServer" + }, + { + "id": "puppet var", "name": "apptimelineserver_principal_name", "displayName": "App Timeline Server Principal name", "value": "", http://git-wip-us.apache.org/repos/asf/ambari/blob/9f27e084/ambari-web/app/data/HDP2/site_properties.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/data/HDP2/site_properties.js b/ambari-web/app/data/HDP2/site_properties.js index d066cae..c8a59f4 100644 --- a/ambari-web/app/data/HDP2/site_properties.js +++ b/ambari-web/app/data/HDP2/site_properties.js @@ -646,7 +646,6 @@ module.exports = "displayType": "directory", "category": "Advanced hbase-site", "serviceName": "HBASE" - }, { "id": "site property", http://git-wip-us.apache.org/repos/asf/ambari/blob/9f27e084/ambari-web/app/models/stack_service.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/models/stack_service.js b/ambari-web/app/models/stack_service.js index 423d0f1..06a5f92 100644 --- a/ambari-web/app/models/stack_service.js +++ b/ambari-web/app/models/stack_service.js @@ -155,7 +155,7 @@ App.StackService = DS.Model.extend({ var configTypes = this.get('configTypes'); var serviceComponents = this.get('serviceComponents'); if (configTypes && Object.keys(configTypes).length) { - var pattern = ["General", "CapacityScheduler", "^Advanced", "Env$", "^Custom", "Falcon - Oozie integration", "FalconStartupSite", "FalconRuntimeSite"]; + var pattern = ["General", "CapacityScheduler", "FaultTolerance", "Isolation", "^Advanced", "Env$", "^Custom", "Falcon - Oozie integration", "FalconStartupSite", "FalconRuntimeSite"]; configCategories = App.StackService.configCategories.call(this).filter(function (_configCategory) { var serviceComponentName = _configCategory.get('name'); var isServiceComponent = serviceComponents.someProperty('componentName', serviceComponentName); @@ -251,6 +251,8 @@ App.StackService.configCategories = function () { App.ServiceConfigCategory.create({ name: 'NODEMANAGER', displayName: 'Node Manager'}), App.ServiceConfigCategory.create({ name: 'APP_TIMELINE_SERVER', displayName: 'Application Timeline Server'}), App.ServiceConfigCategory.create({ name: 'General', displayName: 'General'}), + App.ServiceConfigCategory.create({ name: 'FaultTolerance', displayName: 'Fault Tolerance'}), + App.ServiceConfigCategory.create({ name: 'Isolation', displayName: 'Isolation'}), App.ServiceConfigCategory.create({ name: 'CapacityScheduler', displayName: 'Scheduler', siteFileName: 'capacity-scheduler.xml'}) ]); break; http://git-wip-us.apache.org/repos/asf/ambari/blob/9f27e084/ambari-web/test/controllers/main/admin/security/add/addSecurity_controller_test.js ---------------------------------------------------------------------- diff --git a/ambari-web/test/controllers/main/admin/security/add/addSecurity_controller_test.js b/ambari-web/test/controllers/main/admin/security/add/addSecurity_controller_test.js index bdbc146..5b38194 100644 --- a/ambari-web/test/controllers/main/admin/security/add/addSecurity_controller_test.js +++ b/ambari-web/test/controllers/main/admin/security/add/addSecurity_controller_test.js @@ -27,7 +27,13 @@ require('models/service'); describe('App.AddSecurityController', function () { var controller = App.AddSecurityController.create({ - currentStep: null + currentStep: null, + content: Em.Object.create({ + isATSInstalled: true, + services: [], + isNnHa: 'false', + serviceConfigProperties: null + }) }); describe('#installedServices', function () {
