소스 검색

AMBARI-5726. Adding Oozie failed at service check. (jaimin)

Jaimin Jetly 11 년 전
부모
커밋
f9f5b2b030

+ 10 - 2
ambari-web/app/controllers/wizard/step10_controller.js

@@ -27,12 +27,20 @@ App.WizardStep10Controller = Em.Controller.extend({
   clusterInfo: [],
 
   /**
-   * Show message about required Nagios restart if installWizard used and Nagios is installed
+   * Show message about required Nagios restart if AddHostWizard or AddServiceWizard used and Nagios is installed
    * @type {bool}
    */
   isNagiosRestartRequired: function () {
     return this.get('content.controllerName') !== 'installerController' && App.Service.find('NAGIOS').get('isLoaded');
-  }.property(),
+  }.property('content.controllerName'),
+
+  /**
+   * is Add service wizard the ongoing wizard
+   * @type {bool}
+   */
+  isAddServiceWizard: function () {
+    return this.get('content.controllerName') === 'addServiceController';
+  }.property('content.controllerName'),
 
   /**
    * Clear <code>clusterInfo</code>

+ 27 - 11
ambari-web/app/controllers/wizard/step9_controller.js

@@ -434,17 +434,12 @@ App.WizardStep9Controller = Em.Controller.extend({
    * @method launchStartServices
    */
   launchStartServices: function () {
-    var data = {
-      "RequestInfo": {
-        "context": Em.I18n.t("requestInfo.startServices")
-      },
-      "Body": {
-        "ServiceInfo": { "state": "STARTED" }
-      }
-    };
-    var name = 'wizard.step9.installer.launch_start_services';
+    var data = {};
+    var name = '';
+    var servicesList = [];
 
     if (this.get('content.controllerName') === 'addHostController') {
+      name = 'wizard.step9.add_host.launch_start_services';
       var hostnames = [];
       for (var hostname in this.get('wizardController').getDBProperty('hosts')) {
         hostnames.push(hostname);
@@ -458,7 +453,27 @@ App.WizardStep9Controller = Em.Controller.extend({
           "HostRoles": { "state": "STARTED" }
         }
       };
-      name = 'wizard.step9.add_host.launch_start_services';
+    } else if (this.get('content.controllerName') === 'addServiceController') {
+      servicesList = this.get('content.services').filterProperty('isSelected', true).filterProperty('isDisabled', false).mapProperty('serviceName');
+      name = 'wizard.step9.add_service.launch_start_services';
+      data = {
+        "RequestInfo": {
+          "context": Em.I18n.t("requestInfo.startAddedServices")
+        },
+        "Body": {
+          "ServiceInfo": { "state": "STARTED" }
+        }
+      };
+    } else {
+      name = 'wizard.step9.installer.launch_start_services';
+      data = {
+        "RequestInfo": {
+          "context": Em.I18n.t("requestInfo.startServices")
+        },
+        "Body": {
+          "ServiceInfo": { "state": "STARTED" }
+        }
+      };
     }
     data = JSON.stringify(data);
     if (App.testMode) {
@@ -470,7 +485,8 @@ App.WizardStep9Controller = Em.Controller.extend({
       sender: this,
       data: {
         data: data,
-        cluster: this.get('content.cluster.name')
+        cluster: this.get('content.cluster.name'),
+        servicesList: servicesList    // used only for Add Service wizard
       },
       success: 'launchStartServicesSuccessCallback',
       error: 'launchStartServicesErrorCallback'

+ 8 - 2
ambari-web/app/messages.js

@@ -176,7 +176,7 @@ Em.I18n.translations = {
   'common.persist.error' : 'Error in persisting web client state at ambari server:',
   'common.update.error' : 'Error in retrieving web client state from ambari server',
   'common.tags': 'Tags',
-  'common.important': 'Important',
+  'common.important': '<strong>Important:</strong>',
   'common.allServices':'All Services',
   'common.move':'Move',
   'common.change': 'Change',
@@ -215,6 +215,7 @@ Em.I18n.translations = {
   'requestInfo.installComponents':'Install Components',
   'requestInfo.installServices':'Install Services',
   'requestInfo.startServices':'Start Services',
+  'requestInfo.startAddedServices':'Start Added Services',
   'requestInfo.stopAllServices':'Stop All Services',
   'requestInfo.startAllServices':'Start All Services',
   'requestInfo.startHostComponent':'Start',
@@ -673,7 +674,12 @@ Em.I18n.translations = {
 
   'installer.step10.header':'Summary',
   'installer.step10.body':'Here is the summary of the install process.',
-  'installer.step10.nagiosRestartRequired':'<b>Important!</b> Restarting Nagios service is required for alerts and notifications to work properly.  After clicking on the Complete button to dismiss this wizard, go to <i>Services -> Nagios</i> to restart the Nagios service.',
+  'installer.step10.nagiosRestartRequired':' Restarting Nagios service is required for alerts and ' +
+    'notifications to work properly.  After clicking on the Complete button to dismiss this wizard, go to ' +
+    '<i>Services -> Nagios</i> to restart the Nagios service.',
+  'installer.step10.staleServicesRestartRequired':' You may also need to restart other services for the newly added ' +
+    'services to function properly (for example, HDFS and YARN/MapReduce need to be restarted after adding Oozie). After closing this ' +
+    'wizard, please restart all services that have the restart indicator <i class="icon-refresh"></i> next to the service name.',
   'installer.step10.hostsSummary':'The cluster consists of {0} hosts',
   'installer.step10.servicesSummary':'Installed and started services successfully on {0} new ',
   'installer.step10.warnings':' warnings',

+ 6 - 0
ambari-web/app/styles/application.less

@@ -5087,6 +5087,12 @@ ul.inline li {
   }
 }
 
+#step10-alert-message {
+  .icon-refresh {
+    color: @restart-indicator-color;
+  }
+}
+
 #step10-content {
   ul {
     li {

+ 3 - 3
ambari-web/app/templates/main/host/details/doDeleteHostPopup.hbs

@@ -33,11 +33,11 @@
     </div>
 {{/if}}
 <br />
-<div class='alert'><strong>{{t common.important}}:</strong>
+<div class='alert'>{{{t common.important}}}
   {{#if unknownComponents}}
     {{t hosts.delete.popup.body.msg.unknownComponents}}
   {{/if}}
   {{t hosts.delete.popup.body.msg1}}
 </div>
-<div class='alert'><strong>{{t common.important}}:</strong> {{t hosts.delete.popup.body.msg2}}</div>
-<div class='alert'><strong>{{t common.important}}:</strong> {{t hosts.delete.popup.body.msg3}}</div>
+<div class='alert'>{{{t common.important}}} {{t hosts.delete.popup.body.msg2}}</div>
+<div class='alert'>{{{t common.important}}} {{t hosts.delete.popup.body.msg3}}</div>

+ 3 - 3
ambari-web/app/templates/wizard/step10.hbs

@@ -17,9 +17,9 @@
 }}
 
 <h2>{{t installer.step10.header}}</h2>
-{{#if isNagiosRestartRequired}}
-  <div class="alert alert-danger">
-    {{t installer.step10.nagiosRestartRequired}}
+{{#if view.serviceRestartText}}
+  <div id="step10-alert-message" class="alert alert-danger">
+    {{{view.serviceRestartText}}}
   </div>
 {{/if}}
 <div class="alert alert-info">

+ 15 - 0
ambari-web/app/utils/ajax/ajax.js

@@ -1420,6 +1420,21 @@ var urls = {
       return d;
     }
   },
+  'wizard.step9.add_service.launch_start_services': {
+    'real': '/clusters/{cluster}/services?ServiceInfo/state=INSTALLED&ServiceInfo/service_name.in({servicesList})&params/reconfigure_client=false',
+    'mock': '/data/wizard/deploy/5_hosts/poll_6.json',
+    'format': function (data) {
+      var d = {
+        type: 'PUT',
+        async: false,
+        data: data.data
+      };
+      if (App.testMode) {
+        d.type = 'GET';
+      }
+      return d;
+    }
+  },
   'wizard.step9.add_host.launch_start_services': {
     'real': '/clusters/{cluster}/host_components',
     'mock': '/data/wizard/deploy/5_hosts/poll_6.json',

+ 12 - 1
ambari-web/app/views/wizard/step10_view.js

@@ -25,6 +25,17 @@ App.WizardStep10View = Em.View.extend({
 
   didInsertElement: function () {
     this.get('controller').loadStep();
-  }
+  },
 
+  serviceRestartText: function () {
+    var controller = this.get('controller');
+    if (controller.get('isNagiosRestartRequired') && controller.get('isAddServiceWizard'))
+      return Em.I18n.t('common.important')  + Em.I18n.t('installer.step10.nagiosRestartRequired') + Em.I18n.t('installer.step10.staleServicesRestartRequired');
+    else if (controller.get('isNagiosRestartRequired'))
+      return Em.I18n.t('common.important') + Em.I18n.t('installer.step10.nagiosRestartRequired');
+    else if (controller.get('isAddServiceWizard'))
+      return Em.I18n.t('common.important') + Em.I18n.t('installer.step10.staleServicesRestartRequired');
+    else
+      return '';
+  }.property('controller.isNagiosRestartRequired','controller.isAddServiceWizard')
 });