浏览代码

AMBARI-4686. App Timeline Server start fails in Security Wizard.(Andrii Babiichuk)

Xi Wang 11 年之前
父节点
当前提交
03a5ca8ebe

+ 2 - 2
ambari-web/app/controllers/main/admin/highAvailability/rollback_controller.js

@@ -383,7 +383,7 @@ App.HighAvailabilityRollbackController = App.HighAvailabilityProgressPageControl
     var hostName = this.get("content.hdfsClientHostNames");
     var hostName = this.get("content.hdfsClientHostNames");
     for (var i = 0; i < hostName.length; i++) {
     for (var i = 0; i < hostName.length; i++) {
       App.ajax.send({
       App.ajax.send({
-        name: 'admin.high_availability.delete_component',
+        name: 'admin.delete_component',
         sender: this,
         sender: this,
         data: {
         data: {
           componentName: 'HDFS_CLIENT',
           componentName: 'HDFS_CLIENT',
@@ -475,7 +475,7 @@ App.HighAvailabilityRollbackController = App.HighAvailabilityProgressPageControl
     this.set('numOfDelOperations', hostName.length);
     this.set('numOfDelOperations', hostName.length);
     for (var i = 0; i < hostName.length; i++) {
     for (var i = 0; i < hostName.length; i++) {
       App.ajax.send({
       App.ajax.send({
-        name: 'admin.high_availability.delete_component',
+        name: 'admin.delete_component',
         sender: this,
         sender: this,
         data: {
         data: {
           componentName: componentName,
           componentName: componentName,

+ 1 - 1
ambari-web/app/controllers/main/admin/highAvailability/step9_controller.js

@@ -97,7 +97,7 @@ App.HighAvailabilityWizardStep9Controller = App.HighAvailabilityProgressPageCont
   deleteSNameNode: function () {
   deleteSNameNode: function () {
     var hostName = this.get('content.masterComponentHosts').findProperty('component', 'SECONDARY_NAMENODE').hostName;
     var hostName = this.get('content.masterComponentHosts').findProperty('component', 'SECONDARY_NAMENODE').hostName;
     App.ajax.send({
     App.ajax.send({
-      name: 'admin.high_availability.delete_component',
+      name: 'admin.delete_component',
       sender: this,
       sender: this,
       data: {
       data: {
         componentName: 'SECONDARY_NAMENODE',
         componentName: 'SECONDARY_NAMENODE',

+ 27 - 0
ambari-web/app/controllers/main/admin/security/security_progress_controller.js

@@ -95,6 +95,12 @@ App.MainAdminSecurityProgressController = Em.Controller.extend({
         currentStage = startedStages.findProperty('isCompleted', false);
         currentStage = startedStages.findProperty('isCompleted', false);
       }
       }
       if (currentStage && currentStage.get('isPolling') === true) {
       if (currentStage && currentStage.get('isPolling') === true) {
+        if (currentStage.get('name') === 'START_SERVICES' && !App.router.get('addSecurityController.securityEnabled')) {
+          var timeLineServer = App.Service.find('YARN').get('hostComponents').findProperty('componentName', 'APP_TIMELINE_SERVER');
+          if (timeLineServer) {
+            this.deleteComponents('APP_TIMELINE_SERVER', timeLineServer.get('host.hostName'));
+          }
+        }
         currentStage.set('isStarted', true);
         currentStage.set('isStarted', true);
         currentStage.start();
         currentStage.start();
       } else if (currentStage && currentStage.get('stage') === 'stage3') {
       } else if (currentStage && currentStage.get('stage') === 'stage3') {
@@ -162,6 +168,27 @@ App.MainAdminSecurityProgressController = Em.Controller.extend({
     });
     });
   },
   },
 
 
+  deleteComponents: function(componentName, hostName) {
+    App.ajax.send({
+      name: 'admin.delete_component',
+      sender: this,
+      data: {
+        componentName: componentName,
+        hostName: hostName
+      },
+      success: 'onDeleteComplete',
+      error: 'onDeleteError'
+    });
+  },
+
+  onDeleteComplete: function () {
+    console.warn('APP_TIMELINE_SERVER doesn\'t support security mode. It has been removed from YARN service ');
+  },
+
+  onDeleteError: function () {
+    console.warn('Error: Can\'t delete APP_TIMELINE_SERVER');
+  },
+
   loadClusterConfigsSuccessCallback: function (data) {
   loadClusterConfigsSuccessCallback: function (data) {
     var self = this;
     var self = this;
     //prepare tags to fetch all configuration for a service
     //prepare tags to fetch all configuration for a service

+ 1 - 0
ambari-web/app/routes/add_security.js

@@ -231,6 +231,7 @@ module.exports = App.WizardRoute.extend({
       if (!controller.get('isSubmitDisabled')) {
       if (!controller.get('isSubmitDisabled')) {
         $(context.currentTarget).parents("#modal").find(".close").trigger('click');
         $(context.currentTarget).parents("#modal").find(".close").trigger('click');
       }
       }
+      location.reload();
     }
     }
   }),
   }),
 
 

+ 1 - 1
ambari-web/app/utils/ajax.js

@@ -1029,7 +1029,7 @@ var urls = {
     'mock': '',
     'mock': '',
     'type': 'GET'
     'type': 'GET'
   },
   },
-  'admin.high_availability.delete_component': {
+  'admin.delete_component': {
     'real': '/clusters/{clusterName}/hosts/{hostName}/host_components/{componentName}',
     'real': '/clusters/{clusterName}/hosts/{hostName}/host_components/{componentName}',
     'mock': '',
     'mock': '',
     'type': 'DELETE'
     'type': 'DELETE'