Browse Source

AMBARI-12591-2. Prompt user to save checkpoint before shutdown if last checkpoint is too old.(XIWANG)

Xi Wang 10 năm trước cách đây
mục cha
commit
38230dddd5

+ 2 - 1
ambari-web/app/config.js

@@ -41,7 +41,8 @@ App.hostStatusCountersUpdateInterval = 10000;
 App.alertDefinitionsUpdateInterval = 10000;
 App.alertInstancesUpdateInterval = 10000;
 App.alertGroupsUpdateInterval = 10000;
-App.pageReloadTime=3600000;
+App.pageReloadTime = 3600000;
+App.nnCheckpointAgeAlertThreshold = 12; // in hours
 App.singleNodeInstall = false;
 App.singleNodeAlias = document.location.hostname;
 App.minDiskSpace = 2.0; // minimum disk space required for '/' for each host before install, unit GB

+ 2 - 2
ambari-web/app/controllers/main/host/details.js

@@ -222,7 +222,7 @@ App.MainHostDetailsController = Em.Controller.extend({
         // too old
         self.getHdfsUser().done(function() {
           var msg = Em.Object.create({
-            confirmMsg: Em.I18n.t('services.service.stop.HDFS.warningMsg.checkPointTooOld') +
+            confirmMsg: Em.I18n.t('services.service.stop.HDFS.warningMsg.checkPointTooOld').format(App.nnCheckpointAgeAlertThreshold) +
               Em.I18n.t('services.service.stop.HDFS.warningMsg.checkPointTooOld.instructions').format(isNNCheckpointTooOld, self.get('content.hdfsUser')),
             confirmButton: Em.I18n.t('common.next')
           });
@@ -260,7 +260,7 @@ App.MainHostDetailsController = Em.Controller.extend({
       if (!lastCheckpointTime) {
         this.set("isNNCheckpointTooOld", null);
       } else {
-        var time_criteria = 12; // time in hours to define how many hours ago is too old
+        var time_criteria = App.nnCheckpointAgeAlertThreshold; // time in hours to define how many hours ago is too old
         var time_ago = (Math.round(App.dateTime() / 1000) - (time_criteria * 3600)) *1000;
         if (lastCheckpointTime <= time_ago) {
           // too old, set the effected hostName

+ 1 - 1
ambari-web/app/controllers/main/service/item.js

@@ -202,7 +202,7 @@ App.MainServiceItemController = Em.Controller.extend({
         // too old
         self.getHdfsUser().done(function() {
           var msg = Em.Object.create({
-            confirmMsg: Em.I18n.t('services.service.stop.HDFS.warningMsg.checkPointTooOld') +
+            confirmMsg: Em.I18n.t('services.service.stop.HDFS.warningMsg.checkPointTooOld').format(App.nnCheckpointAgeAlertThreshold) +
               Em.I18n.t('services.service.stop.HDFS.warningMsg.checkPointTooOld.instructions').format(isNNCheckpointTooOld, self.get('content.hdfsUser')),
             confirmButton: Em.I18n.t('common.next')
           });

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

@@ -1815,7 +1815,7 @@ Em.I18n.translations = {
     '<li>Once in Safe Mode, create a Checkpoint:' +
     '<div class="code-snippet">sudo su {1} -l -c \'hdfs dfsadmin -saveNamespace\'</div></li>' +
     '</ol>',
-  'services.service.stop.HDFS.warningMsg.checkPointTooOld': 'The last HDFS checkpoint is older than 12 hours. Make sure that you have taken a checkpoint before proceeding. Otherwise, the NameNode(s) can take a very long time to start up.',
+  'services.service.stop.HDFS.warningMsg.checkPointTooOld': 'The last HDFS checkpoint is older than {0} hours. Make sure that you have taken a checkpoint before proceeding. Otherwise, the NameNode(s) can take a very long time to start up.',
   'services.service.config_groups_popup.header':'Manage {0} Configuration Groups',
   'services.service.config_groups_popup.notice':'You can apply different sets of {{serviceName}} configurations to groups of hosts by managing {{serviceName}} Configuration Groups and their host membership.  Hosts belonging to a {{serviceName}} Configuration Group have the same set of configurations for {{serviceName}}. Each host belongs to one {{serviceName}} Configuration Group.',
   'services.service.config_groups_popup.rename':'Rename',