فهرست منبع

AMBARI-8331. Update categories for YARN configs on UI. (jaimin)

Jaimin Jetly 10 سال پیش
والد
کامیت
9f27e084b6

+ 11 - 4
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

+ 5 - 0
ambari-web/app/controllers/main/admin/security/add/step2.js

@@ -121,6 +121,11 @@ App.MainAdminSecurityAddStep2Controller = Em.Controller.extend({
       configName: 'resourcemanager_host',
       components: ['RESOURCEMANAGER']
     },
+    {
+      serviceName: 'YARN',
+      configName: 'apptimelineserver_host',
+      components: ['APP_TIMELINE_SERVER']
+    },
     {
       serviceName: 'HBASE',
       configName: 'hbasemaster_host',

+ 2 - 1
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;

+ 53 - 0
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;

+ 5 - 13
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')
   },
   {

+ 242 - 1
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;

+ 13 - 0
ambari-web/app/data/HDP2/secure_properties.js

@@ -471,6 +471,19 @@ var props = {
       "category": "ResourceManager"
     },
     // 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",

+ 0 - 1
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",

+ 3 - 1
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;

+ 7 - 1
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 () {