Bladeren bron

AMBARI-8177. ATS should remain enabled after kerberization, and keytab owner should be yarn (alejandro)

Alejandro Fernandez 10 jaren geleden
bovenliggende
commit
662ce6007a

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

@@ -38,7 +38,13 @@ App.MainAdminSecurityController = Em.Controller.extend({
   getDisableSecurityStatus: function (status) {
     return App.db.getDisableSecurityStatus();
   },
-
+  content: Em.Object.create({
+    isATSInstalled: function() {
+      // Because the ATS component can be installed/removed at will, the check has to happen every time that security is added.
+      var yarnService = App.Service.find().findProperty('serviceName','YARN');
+      return !!yarnService && yarnService.get('hostComponents').someProperty('componentName', 'APP_TIMELINE_SERVER');
+    }.property('App.router.clusterController.isLoaded')
+  }),
   notifySecurityOff: false,
   notifySecurityAdd: false,
 
@@ -64,6 +70,12 @@ App.MainAdminSecurityController = Em.Controller.extend({
       secureServices = $.extend(true, [], require('data/secure_configs'));
     }
 
+    // Typically, ATS will support Kerberos in HDP 2.2 and higher
+    if (this.get('content.isATSInstalled') && App.get('doesATSSupportKerberos')) {
+      var yarnConfigCategories = secureServices.findProperty('serviceName', 'YARN').configCategories;
+      yarnConfigCategories.push(App.ServiceConfigCategory.create({ name: 'AppTimelineServer', displayName : 'Application Timeline Service'}));
+    }
+
     var installedServices = App.Service.find().mapProperty('serviceName');
     //General (only non service tab) tab is always displayed
     services.push(secureServices.findProperty('serviceName', 'GENERAL'));

+ 5 - 11
ambari-web/app/controllers/main/admin/security/add/step3.js

@@ -46,7 +46,8 @@ App.MainAdminSecurityAddStep3Controller = Em.Controller.extend({
       'NIMBUS': 'storm_user',
       'STORM_UI_SERVER': 'storm_user',
       'FALCON_SERVER': 'falcon_user',
-      'KNOX_GATEWAY': 'knox_user'
+      'KNOX_GATEWAY': 'knox_user',
+      'APP_TIMELINE_SERVER': 'yarn_user'
     };
     if (App.get('isHadoop22Stack')) {
       map['DRPC_SERVER'] = 'storm_user'
@@ -118,13 +119,6 @@ App.MainAdminSecurityAddStep3Controller = Em.Controller.extend({
         displayName: Em.I18n.t('admin.addSecurity.nm.user.httpUser'),
         isHadoop2Stack: true
       },
-      {
-        componentName: 'APP_TIMELINE_SERVER',
-        principal: 'apptimelineserver_principal_name',
-        keytab: 'apptimelineserver_keytab',
-        displayName: Em.I18n.t('admin.addSecurity.user.yarn.atsUser'),
-        isHadoop2Stack: true
-      },
       {
         componentName: 'APP_TIMELINE_SERVER',
         principal: 'apptimelineserver_http_principal_name',
@@ -262,8 +256,8 @@ App.MainAdminSecurityAddStep3Controller = Em.Controller.extend({
     var componentToOwnerMap = {};
     for (var component in componentToUserMap) {
       var user = componentToUserMap[component];
-      var secutityUser = securityUsers.findProperty('name', user);
-      componentToOwnerMap[component] = secutityUser.value;
+      var securityUser = securityUsers.findProperty('name', user);
+      componentToOwnerMap[component] = securityUser.value;
     }
     return componentToOwnerMap;
   },
@@ -351,7 +345,7 @@ App.MainAdminSecurityAddStep3Controller = Em.Controller.extend({
   setHostComponentsSecureValue: function (result, host, addedPrincipalsHost, securityUsers, hadoopGroupId) {
     var componentsToDisplay = ['NAMENODE', 'SECONDARY_NAMENODE', 'DATANODE', 'JOBTRACKER', 'ZOOKEEPER_SERVER', 'HIVE_SERVER', 'TASKTRACKER',
       'OOZIE_SERVER', 'NAGIOS_SERVER', 'HBASE_MASTER', 'HBASE_REGIONSERVER', 'HISTORYSERVER', 'RESOURCEMANAGER', 'NODEMANAGER', 'JOURNALNODE',
-      'SUPERVISOR', 'NIMBUS', 'STORM_UI_SERVER', 'FALCON_SERVER', 'KNOX_GATEWAY'];
+      'SUPERVISOR', 'NIMBUS', 'STORM_UI_SERVER', 'FALCON_SERVER', 'KNOX_GATEWAY', 'APP_TIMELINE_SERVER'];
     if (App.get('isHadoop22Stack')) {
       componentsToDisplay.push('DRPC_SERVER');
     }

+ 1 - 1
ambari-web/app/data/HDP2/secure_mapping.js

@@ -204,7 +204,7 @@ var props = [
     "name": "yarn.timeline-service.enabled",
     "templateName": [],
     "foreignKey": null,
-    "value": "false",
+    "value": App.get('isHadoop22Stack') ? "true" : "false",
     "nonSecureValue": "false",
     "filename": "yarn-site.xml",
     "serviceName": "YARN"

+ 2 - 4
ambari-web/app/data/HDP2/secure_properties.js

@@ -523,8 +523,7 @@ var props = {
       "isVisible": true,
       "isOverridable": true,
       "serviceName": "YARN",
-      "category": "AppTimelineServer",
-      "component": "APP_TIMELINE_SERVER"
+      "category": "AppTimelineServer"
     },
     {
       "id": "puppet var",
@@ -537,8 +536,7 @@ var props = {
       "isVisible": true,
       "isOverridable": true,
       "serviceName": "YARN",
-      "category": "AppTimelineServer",
-      "component": "APP_TIMELINE_SERVER"
+      "category": "AppTimelineServer"
     },
 
     // YARN Resource Manager

+ 0 - 1
ambari-web/app/messages.js

@@ -1107,7 +1107,6 @@ Em.I18n.translations = {
   'admin.addSecurity.hive.user.httpUser': 'Hive SPNEGO User',
   'admin.addSecurity.oozie.user.httpUser': 'Oozie SPNEGO User',
   'admin.addSecurity.falcon.user.httpUser': 'Falcon SPNEGO User',
-  'admin.addSecurity.user.yarn.atsUser': 'YARN ATS User',
   'admin.addSecurity.user.yarn.atsHTTPUser': 'YARN ATS HTTP User',
   'admin.addSecurity.knox.user': 'Knox Gateway',
   'admin.addSecurity.enable.onClose': 'You are in the process of enabling security on your cluster. ' +