Quellcode durchsuchen

AMBARI-6412. Usability: integrate THP check to Host Checks.(xiwang)

Xi Wang vor 11 Jahren
Ursprung
Commit
3efb5fc489

+ 35 - 1
ambari-web/app/controllers/wizard/step3_controller.js

@@ -35,6 +35,7 @@ App.WizardStep3Controller = Em.Controller.extend({
   hostCheckWarnings: [],
   hostCheckWarnings: [],
   repoCategoryWarnings: [],
   repoCategoryWarnings: [],
   diskCategoryWarnings: [],
   diskCategoryWarnings: [],
+  thpCategoryWarnings: [],
   jdkCategoryWarnings: null,
   jdkCategoryWarnings: null,
   jdkRequestIndex: null,
   jdkRequestIndex: null,
 
 
@@ -955,7 +956,8 @@ App.WizardStep3Controller = Em.Controller.extend({
     var hosts = this.get('bootHosts'),
     var hosts = this.get('bootHosts'),
       self = this,
       self = this,
       repoWarnings = [], hostsRepoNames = [], hostsContext = [],
       repoWarnings = [], hostsRepoNames = [], hostsContext = [],
-      diskWarnings = [], hostsDiskContext = [], hostsDiskNames = [];
+      diskWarnings = [], hostsDiskContext = [], hostsDiskNames = [],
+      thpWarnings = [], thpContext = [], thpHostsNames = [];
 
 
     // parse host checks warning
     // parse host checks warning
     this.parseWarnings(jsonData);
     this.parseWarnings(jsonData);
@@ -979,6 +981,12 @@ App.WizardStep3Controller = Em.Controller.extend({
             hostsDiskContext.push(diskContext);
             hostsDiskContext.push(diskContext);
             hostsDiskNames.push(host_name);
             hostsDiskNames.push(host_name);
           }
           }
+          // "Transparent Huge Pages" check
+          context = self.checkTHP(host_name, host.Hosts.last_agent_env.transparentHugePage);
+          if (context) {
+            thpContext.push(context);
+            thpHostsNames.push(host_name);
+          }
         }
         }
       }
       }
     });
     });
@@ -1000,9 +1008,19 @@ App.WizardStep3Controller = Em.Controller.extend({
         onSingleHost: false
         onSingleHost: false
       });
       });
     }
     }
+    if (thpContext.length > 0) { // THP warning existed
+      thpWarnings.push({
+        name: Em.I18n.t('installer.step3.hostWarningsPopup.thp.name'),
+        hosts: thpContext,
+        hostsNames: thpHostsNames,
+        category: 'thp',
+        onSingleHost: false
+      });
+    }
 
 
     this.set('repoCategoryWarnings', repoWarnings);
     this.set('repoCategoryWarnings', repoWarnings);
     this.set('diskCategoryWarnings', diskWarnings);
     this.set('diskCategoryWarnings', diskWarnings);
+    this.set('thpCategoryWarnings', thpWarnings);
     this.stopRegistration();
     this.stopRegistration();
   },
   },
 
 
@@ -1065,6 +1083,22 @@ App.WizardStep3Controller = Em.Controller.extend({
     this.set('isRetryDisabled', !this.get('bootHosts').someProperty('bootStatus', 'FAILED'));
     this.set('isRetryDisabled', !this.get('bootHosts').someProperty('bootStatus', 'FAILED'));
   },
   },
 
 
+  /**
+   * Check if the 'Transparent Huge Pages' enabled.
+   * @param {string} transparentHugePage
+   * @param {string} hostName
+   * @return {string} error-message or empty string
+   * @method checkTHP
+   */
+  checkTHP: function (hostName, transparentHugePage) {
+    if (transparentHugePage == "always") {
+      console.log('WARNING: Transparent Huge Page enabled on host: '+ hostName);
+      return Em.I18n.t('installer.step3.hostWarningsPopup.thp.context').format(hostName);
+    } else {
+      return '';
+    }
+  },
+
   /**
   /**
    * Check if the customized os group contains the registered host os type. If not the repo on that host is invalid.
    * Check if the customized os group contains the registered host os type. If not the repo on that host is invalid.
    * @param {string} osType
    * @param {string} osType

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

@@ -458,6 +458,7 @@ Em.I18n.translations = {
   'installer.step3.hostWarningsPopup.report.disk': '<br><br>######################################<br># Disk <br>#<br># A newline delimited list of disk issues.<br>######################################<br>DISK ISSUES<br>',
   'installer.step3.hostWarningsPopup.report.disk': '<br><br>######################################<br># Disk <br>#<br># A newline delimited list of disk issues.<br>######################################<br>DISK ISSUES<br>',
   'installer.step3.hostWarningsPopup.report.repositories': '<br><br>######################################<br># Repositories <br>#<br># A newline delimited list of repositories issues.<br>######################################<br>REPOSITORIES ISSUES<br>',
   'installer.step3.hostWarningsPopup.report.repositories': '<br><br>######################################<br># Repositories <br>#<br># A newline delimited list of repositories issues.<br>######################################<br>REPOSITORIES ISSUES<br>',
   'installer.step3.hostWarningsPopup.report.hostNameResolution': '<br><br>######################################<br># Hostname Resolution<br>#<br># A newline delimited list of hostname resolution issues.<br>######################################<br>HOSTNAME RESOLUTION ISSUES<br>',
   'installer.step3.hostWarningsPopup.report.hostNameResolution': '<br><br>######################################<br># Hostname Resolution<br>#<br># A newline delimited list of hostname resolution issues.<br>######################################<br>HOSTNAME RESOLUTION ISSUES<br>',
+  'installer.step3.hostWarningsPopup.report.thp': '<br><br>######################################<br># Transparent Huge Pages(THP) <br>#<br># A space delimited list of hostnames on which Transparent Huge Pages are enabled.<br>######################################<br>THP ISSUES HOSTS<br>',
   'installer.step3.hostWarningsPopup.report.firewall': '<br><br>######################################<br># Firewall<br>#<br># A newline delimited list of firewall issues.<br>######################################<br>FIREWALL<br>',
   'installer.step3.hostWarningsPopup.report.firewall': '<br><br>######################################<br># Firewall<br>#<br># A newline delimited list of firewall issues.<br>######################################<br>FIREWALL<br>',
   'installer.step3.hostWarningsPopup.report.fileFolders': '<br><br>######################################<br># Files and Folders<br>#<br># A space delimited list of files and folders which should not exist.<br># Provided so that administrators can easily copy paths into scripts, email etc.<br># Example: rm -r /etc/hadoop /etc/hbase<br>######################################<br>FILES AND FOLDERS<br>',
   'installer.step3.hostWarningsPopup.report.fileFolders': '<br><br>######################################<br># Files and Folders<br>#<br># A space delimited list of files and folders which should not exist.<br># Provided so that administrators can easily copy paths into scripts, email etc.<br># Example: rm -r /etc/hadoop /etc/hbase<br>######################################<br>FILES AND FOLDERS<br>',
   'installer.step3.hostWarningsPopup.report.reverseLookup': '<br><br>######################################<br># Reverse Lookup<br># <br># The hostname was not found in the reverse DNS lookup. This may result in incorrect behavior. <br># Please check the DNS setup and fix the issue.<br>######################################<br>REVERSE LOOKUP<br>',
   'installer.step3.hostWarningsPopup.report.reverseLookup': '<br><br>######################################<br># Reverse Lookup<br># <br># The hostname was not found in the reverse DNS lookup. This may result in incorrect behavior. <br># Please check the DNS setup and fix the issue.<br>######################################<br>REVERSE LOOKUP<br>',
@@ -485,6 +486,10 @@ Em.I18n.translations = {
   'installer.step3.hostWarningsPopup.disk.context1':'Not enough disk space on host ({0}).',
   'installer.step3.hostWarningsPopup.disk.context1':'Not enough disk space on host ({0}).',
   'installer.step3.hostWarningsPopup.disk.context2':'A minimum of {0} is required for "{1}" mount.',
   'installer.step3.hostWarningsPopup.disk.context2':'A minimum of {0} is required for "{1}" mount.',
   'installer.step3.hostWarningsPopup.disk.message':'The following registered hosts have issues related to disk space',
   'installer.step3.hostWarningsPopup.disk.message':'The following registered hosts have issues related to disk space',
+  'installer.step3.hostWarningsPopup.thp':'Transparent Huge Pages Issues',
+  'installer.step3.hostWarningsPopup.thp.name':'Transparent Huge Pages',
+  'installer.step3.hostWarningsPopup.thp.context':'{0}',
+  'installer.step3.hostWarningsPopup.thp.message':'The following hosts have Transparent Huge Pages (THP) enabled. THP should be disabled to avoid potential Hadoop performance issues.',
   'installer.step3.hostWarningsPopup.firewall':'Firewall Issues',
   'installer.step3.hostWarningsPopup.firewall':'Firewall Issues',
   'installer.step3.hostWarningsPopup.firewall.message':'Firewall is running on the following hosts. Please configure the firewall to allow communications on the ports documented in the <i>Configuring Ports</i> section of  the <a target=\"_blank\" href=\"http://ambari.apache.org/current/installing-hadoop-using-ambari/content/\">Ambari documentation</a>',
   'installer.step3.hostWarningsPopup.firewall.message':'Firewall is running on the following hosts. Please configure the firewall to allow communications on the ports documented in the <i>Configuring Ports</i> section of  the <a target=\"_blank\" href=\"http://ambari.apache.org/current/installing-hadoop-using-ambari/content/\">Ambari documentation</a>',
   'installer.step3.hostWarningsPopup.firewall.name':'<i>iptables</i> Running',
   'installer.step3.hostWarningsPopup.firewall.name':'<i>iptables</i> Running',
@@ -519,6 +524,7 @@ Em.I18n.translations = {
   'installer.step3.hostWarningsPopup.empty.repositories':'repositories OS type mis-match with registered hosts',
   'installer.step3.hostWarningsPopup.empty.repositories':'repositories OS type mis-match with registered hosts',
   'installer.step3.hostWarningsPopup.empty.disk':'disk space issues',
   'installer.step3.hostWarningsPopup.empty.disk':'disk space issues',
   'installer.step3.hostWarningsPopup.empty.jdk':'JDK issues',
   'installer.step3.hostWarningsPopup.empty.jdk':'JDK issues',
+  'installer.step3.hostWarningsPopup.empty.thp':'THP issues',
   'installer.step3.hostWarningsPopup.reverseLookup.name': 'Reverse Lookup validation failed on',
   'installer.step3.hostWarningsPopup.reverseLookup.name': 'Reverse Lookup validation failed on',
   'installer.step3.hostWarningsPopup.reverseLookup': 'Reverse Lookup Issues',
   'installer.step3.hostWarningsPopup.reverseLookup': 'Reverse Lookup Issues',
   'installer.step3.hostWarningsPopup.reverseLookup.message': 'The hostname was not found in the reverse DNS lookup. This may result in incorrect behavior. Please check the DNS setup and fix the issue.',
   'installer.step3.hostWarningsPopup.reverseLookup.message': 'The hostname was not found in the reverse DNS lookup. This may result in incorrect behavior. Please check the DNS setup and fix the issue.',
@@ -535,6 +541,7 @@ Em.I18n.translations = {
   'installer.step3.hostWarningsPopup.action.running':'Running on',
   'installer.step3.hostWarningsPopup.action.running':'Running on',
   'installer.step3.hostWarningsPopup.action.invalid':'Invalid on',
   'installer.step3.hostWarningsPopup.action.invalid':'Invalid on',
   'installer.step3.hostWarningsPopup.action.failed':'Failed on',
   'installer.step3.hostWarningsPopup.action.failed':'Failed on',
+  'installer.step3.hostWarningsPopup.action.enabled':'Enabled on',
   'installer.step3.hostWarningsPopup.host':'host',
   'installer.step3.hostWarningsPopup.host':'host',
   'installer.step3.hostWarningsPopup.hosts':'hosts',
   'installer.step3.hostWarningsPopup.hosts':'hosts',
   'installer.step3.hostWarningsPopup.moreHosts':'{0} more hosts...<br>Click on link to view all hosts.',
   'installer.step3.hostWarningsPopup.moreHosts':'{0} more hosts...<br>Click on link to view all hosts.',

+ 26 - 3
ambari-web/app/views/wizard/step3/hostWarningPopupBody_view.js

@@ -146,8 +146,19 @@ App.WizardStep3HostWarningPopupBody = Em.View.extend({
     var repoCategoryWarnings = this.get('bodyController.repoCategoryWarnings');
     var repoCategoryWarnings = this.get('bodyController.repoCategoryWarnings');
     var diskCategoryWarnings = this.get('bodyController.diskCategoryWarnings');
     var diskCategoryWarnings = this.get('bodyController.diskCategoryWarnings');
     var jdkCategoryWarnings = this.get('bodyController.jdkCategoryWarnings') || [];
     var jdkCategoryWarnings = this.get('bodyController.jdkCategoryWarnings') || [];
+    var thpCategoryWarnings = this.get('bodyController.thpCategoryWarnings');
     var categoryWarnings = this.get('categoryWarnings');
     var categoryWarnings = this.get('categoryWarnings');
     return [
     return [
+      Em.Object.create({
+        warnings: thpCategoryWarnings,
+        title: Em.I18n.t('installer.step3.hostWarningsPopup.thp'),
+        message: Em.I18n.t('installer.step3.hostWarningsPopup.thp.message'),
+        type: Em.I18n.t('common.issues'),
+        emptyName: Em.I18n.t('installer.step3.hostWarningsPopup.empty.thp'),
+        action: Em.I18n.t('installer.step3.hostWarningsPopup.action.enabled'),
+        category: 'thp',
+        isCollapsed: true
+      }),
       Em.Object.create({
       Em.Object.create({
         warnings: jdkCategoryWarnings,
         warnings: jdkCategoryWarnings,
         title: Em.I18n.t('installer.step3.hostWarningsPopup.jdk'),
         title: Em.I18n.t('installer.step3.hostWarningsPopup.jdk'),
@@ -277,7 +288,7 @@ App.WizardStep3HostWarningPopupBody = Em.View.extend({
         isCollapsed: true
         isCollapsed: true
       })
       })
     ]
     ]
-  }.property('category', 'warningsByHost', 'bodyController.jdkCategoryWarnings', 'bodyController.repoCategoryWarnings', 'bodyController.diskCategoryWarnings', 'bodyController.hostCheckWarnings'),
+  }.property('category', 'warningsByHost', 'bodyController.jdkCategoryWarnings', 'bodyController.repoCategoryWarnings', 'bodyController.diskCategoryWarnings', 'bodyController.hostCheckWarnings',  'bodyController.thpCategoryWarnings'),
 
 
   /**
   /**
    * Message with info about warnings
    * Message with info about warnings
@@ -285,13 +296,13 @@ App.WizardStep3HostWarningPopupBody = Em.View.extend({
    */
    */
   warningsNotice: function () {
   warningsNotice: function () {
     var issuesNumber = this.get('warnings.length') + this.get('bodyController.repoCategoryWarnings.length') + this.get('bodyController.diskCategoryWarnings.length')
     var issuesNumber = this.get('warnings.length') + this.get('bodyController.repoCategoryWarnings.length') + this.get('bodyController.diskCategoryWarnings.length')
-      + this.get('bodyController.jdkCategoryWarnings.length') + this.get('bodyController.hostCheckWarnings.length');
+      + this.get('bodyController.jdkCategoryWarnings.length') + this.get('bodyController.hostCheckWarnings.length') + this.get('bodyController.thpCategoryWarnings.length');
     this.set('totalWarningsCount', issuesNumber);
     this.set('totalWarningsCount', issuesNumber);
     var issues = issuesNumber + ' ' + (issuesNumber.length === 1 ? Em.I18n.t('installer.step3.hostWarningsPopup.issue') : Em.I18n.t('installer.step3.hostWarningsPopup.issues'));
     var issues = issuesNumber + ' ' + (issuesNumber.length === 1 ? Em.I18n.t('installer.step3.hostWarningsPopup.issue') : Em.I18n.t('installer.step3.hostWarningsPopup.issues'));
     var hostsCnt = this.warningHostsNamesCount();
     var hostsCnt = this.warningHostsNamesCount();
     var hosts = hostsCnt + ' ' + (hostsCnt === 1 ? Em.I18n.t('installer.step3.hostWarningsPopup.host') : Em.I18n.t('installer.step3.hostWarningsPopup.hosts'));
     var hosts = hostsCnt + ' ' + (hostsCnt === 1 ? Em.I18n.t('installer.step3.hostWarningsPopup.host') : Em.I18n.t('installer.step3.hostWarningsPopup.hosts'));
     return Em.I18n.t('installer.step3.hostWarningsPopup.summary').format(issues, hosts);
     return Em.I18n.t('installer.step3.hostWarningsPopup.summary').format(issues, hosts);
-  }.property('warnings', 'warningsByHost', 'bodyController.jdkCategoryWarnings', 'bodyController.repoCategoryWarnings', 'bodyController.diskCategoryWarnings', 'bodyController.hostCheckWarnings'),
+  }.property('warnings', 'warningsByHost', 'bodyController.jdkCategoryWarnings', 'bodyController.repoCategoryWarnings', 'bodyController.diskCategoryWarnings', 'bodyController.hostCheckWarnings',  'bodyController.diskCategoryWarnings'),
 
 
   /**
   /**
    * Detailed content to show it in new window
    * Detailed content to show it in new window
@@ -303,6 +314,10 @@ App.WizardStep3HostWarningPopupBody = Em.View.extend({
     newContent += Em.I18n.t('installer.step3.hostWarningsPopup.report.header') + new Date;
     newContent += Em.I18n.t('installer.step3.hostWarningsPopup.report.header') + new Date;
     newContent += Em.I18n.t('installer.step3.hostWarningsPopup.report.hosts');
     newContent += Em.I18n.t('installer.step3.hostWarningsPopup.report.hosts');
     newContent += this.get('hostNamesWithWarnings').join(' ');
     newContent += this.get('hostNamesWithWarnings').join(' ');
+    if (content.findProperty('category', 'thp').warnings.length) {
+      newContent += Em.I18n.t('installer.step3.hostWarningsPopup.report.thp');
+      newContent += content.findProperty('category', 'thp').warnings[0].hosts.join(' ');
+    }
     if (content.findProperty('category', 'jdk').warnings.length) {
     if (content.findProperty('category', 'jdk').warnings.length) {
       newContent += Em.I18n.t('installer.step3.hostWarningsPopup.report.jdk');
       newContent += Em.I18n.t('installer.step3.hostWarningsPopup.report.jdk');
       newContent += content.findProperty('category', 'jdk').warnings[0].hosts.join('<br>');
       newContent += content.findProperty('category', 'jdk').warnings[0].hosts.join('<br>');
@@ -411,6 +426,7 @@ App.WizardStep3HostWarningPopupBody = Em.View.extend({
     var repoCategoryWarnings = this.get('bodyController.repoCategoryWarnings');
     var repoCategoryWarnings = this.get('bodyController.repoCategoryWarnings');
     var diskCategoryWarnings = this.get('bodyController.diskCategoryWarnings');
     var diskCategoryWarnings = this.get('bodyController.diskCategoryWarnings');
     var jdkCategoryWarnings = this.get('bodyController.jdkCategoryWarnings');
     var jdkCategoryWarnings = this.get('bodyController.jdkCategoryWarnings');
+    var thpCategoryWarnings = this.get('bodyController.thpCategoryWarnings');
     var hostResolutionWarnings = this.get('bodyController.hostCheckWarnings');
     var hostResolutionWarnings = this.get('bodyController.hostCheckWarnings');
 
 
     if (repoCategoryWarnings.length) {
     if (repoCategoryWarnings.length) {
@@ -441,6 +457,13 @@ App.WizardStep3HostWarningPopupBody = Em.View.extend({
         }
         }
       });
       });
     }
     }
+    if (thpCategoryWarnings.length) {
+      thpCategoryWarnings[0].hostsNames.forEach(function (_hostName) {
+        if (!hostNameMap[_hostName]) {
+          hostNameMap[_hostName] = true;
+        }
+      });
+    }
     this.set('hostNamesWithWarnings', Em.keys(hostNameMap));
     this.set('hostNamesWithWarnings', Em.keys(hostNameMap));
     return Em.keys(hostNameMap).length;
     return Em.keys(hostNameMap).length;
   },
   },

+ 3 - 2
ambari-web/app/views/wizard/step3_view.js

@@ -277,7 +277,8 @@ App.WizardStep3View = App.TableView.extend({
         this.set('message', Em.I18n.t('installer.step3.warning.loading'));
         this.set('message', Em.I18n.t('installer.step3.warning.loading'));
       }
       }
       else {
       else {
-        if (this.get('controller.isHostHaveWarnings') || this.get('controller.repoCategoryWarnings.length') || this.get('controller.diskCategoryWarnings.length') || this.get('controller.jdkCategoryWarnings.length') || this.get('controller.hostCheckWarnings.length')) {
+        if (this.get('controller.isHostHaveWarnings') || this.get('controller.repoCategoryWarnings.length') || this.get('controller.diskCategoryWarnings.length') || this.get('controller.jdkCategoryWarnings.length')
+          || this.get('controller.hostCheckWarnings.length') || this.get('controller.thpCategoryWarnings.length')) {
           this.set('status', 'alert-warn');
           this.set('status', 'alert-warn');
           this.set('linkText', Em.I18n.t('installer.step3.warnings.linkText'));
           this.set('linkText', Em.I18n.t('installer.step3.warnings.linkText'));
           this.set('message', Em.I18n.t('installer.step3.warnings.fails').format(hosts.length - failedHosts));
           this.set('message', Em.I18n.t('installer.step3.warnings.fails').format(hosts.length - failedHosts));
@@ -305,7 +306,7 @@ App.WizardStep3View = App.TableView.extend({
       }
       }
     }
     }
 
 
-  }.observes('controller.isWarningsLoaded','controller.hostCheckWarnings', 'controller.isHostHaveWarnings', 'controller.repoCategoryWarnings', 'controller.diskCategoryWarnings', 'controller.jdkCategoryWarnings')
+  }.observes('controller.isWarningsLoaded','controller.hostCheckWarnings', 'controller.isHostHaveWarnings', 'controller.repoCategoryWarnings', 'controller.diskCategoryWarnings', 'controller.jdkCategoryWarnings', 'controller.thpCategoryWarnings')
 });
 });
 
 
 //todo: move it inside WizardStep3View
 //todo: move it inside WizardStep3View