Updated Branches: refs/heads/trunk 1dcce733c -> 915f74b29
AMBARI-2814. NameNode HA Wizard: modify prerequisite checks. (atkach via yusaku) Project: http://git-wip-us.apache.org/repos/asf/incubator-ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ambari/commit/915f74b2 Tree: http://git-wip-us.apache.org/repos/asf/incubator-ambari/tree/915f74b2 Diff: http://git-wip-us.apache.org/repos/asf/incubator-ambari/diff/915f74b2 Branch: refs/heads/trunk Commit: 915f74b292fd51ec06f6bc20cdb81210540bdf42 Parents: 1dcce73 Author: Yusaku Sako <[email protected]> Authored: Tue Aug 6 13:57:42 2013 -0700 Committer: Yusaku Sako <[email protected]> Committed: Tue Aug 6 13:57:47 2013 -0700 ---------------------------------------------------------------------- .../main/admin/highAvailability_controller.js | 30 ++++++++++++++------ ambari-web/app/messages.js | 5 ++-- 2 files changed, 24 insertions(+), 11 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/915f74b2/ambari-web/app/controllers/main/admin/highAvailability_controller.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/controllers/main/admin/highAvailability_controller.js b/ambari-web/app/controllers/main/admin/highAvailability_controller.js index 81bd54e..73c1ce5 100644 --- a/ambari-web/app/controllers/main/admin/highAvailability_controller.js +++ b/ambari-web/app/controllers/main/admin/highAvailability_controller.js @@ -28,18 +28,25 @@ App.MainAdminHighAvailabilityController = Em.Controller.extend({ dataIsLoaded: false, enableHighAvailability: function () { + var message = []; //Prerequisite Checks - if (App.Host.find().content.length < 3) { - this.showErrorPopup(Em.I18n.t('admin.highAvailability.error.hostsNum')); - return; - } - if (App.HostComponent.find().filterProperty('componentName', 'ZOOKEEPER_SERVER').length < 3) { - this.showErrorPopup(Em.I18n.t('admin.highAvailability.error.zooKeeperNum')); - return; - } if (this.get('securityEnabled')) { this.showErrorPopup(Em.I18n.t('admin.highAvailability.error.security')); return; + } else { + if (App.Host.find().content.length < 3) { + message.push(Em.I18n.t('admin.highAvailability.error.hostsNum')); + } + if (App.HostComponent.find().filterProperty('componentName', 'ZOOKEEPER_SERVER').length < 3) { + message.push(Em.I18n.t('admin.highAvailability.error.zooKeeperNum')); + } + if (App.HostComponent.find().findProperty('componentName', 'NAMENODE').get('workStatus') !== 'STARTED') { + message.push(Em.I18n.t('admin.highAvailability.error.namenodeStarted')); + } + if (message.length > 0) { + this.showErrorPopup(message); + return; + } } App.router.transitionTo('enableHighAvailability'); }, @@ -100,10 +107,15 @@ App.MainAdminHighAvailabilityController = Em.Controller.extend({ }, showErrorPopup: function (message) { + if(Array.isArray(message)){ + message = message.join('<br/>'); + } else { + message = '<p>' + message + '</p>'; + } App.ModalPopup.show({ header: Em.I18n.t('common.error'), bodyClass: Ember.View.extend({ - template: Ember.Handlebars.compile('<p>' + message + '</p>') + template: Ember.Handlebars.compile(message) }), onPrimary: function () { this.hide(); http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/915f74b2/ambari-web/app/messages.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/messages.js b/ambari-web/app/messages.js index 476d762..54c11b1 100644 --- a/ambari-web/app/messages.js +++ b/ambari-web/app/messages.js @@ -636,8 +636,9 @@ Em.I18n.translations = { 'admin.highAvailability.button.enable':'Enable NameNode HA', 'admin.highAvailability.disabled':'NameNode HA is disabled', 'admin.highAvailability.enabled':'NameNode HA is enabled', - 'admin.highAvailability.error.hostsNum':'You must have at least 3 hosts in your cluster to enable NameNode HA', - 'admin.highAvailability.error.zooKeeperNum':'You must have at least 3 ZooKeeper Servers in your cluster to enable NameNode HA', + 'admin.highAvailability.error.hostsNum':'You must have at least 3 hosts in your cluster to enable NameNode HA.', + 'admin.highAvailability.error.namenodeStarted':'NameNode must be running before you enable NameNode HA.', + 'admin.highAvailability.error.zooKeeperNum':'You must have at least 3 ZooKeeper Servers in your cluster to enable NameNode HA.', 'admin.highAvailability.error.security':'You cannot enable NameNode HA via this wizard as your cluster is already secured. First, disable security by going to Admin > Security, and then run this Enable NameNode HA wizard again. After NameNode HA is enabled, you can go back to Admin > Security to secure the cluster.', 'admin.highAvailability.wizard.header':'Enable NameNode HA Wizard', 'admin.highAvailability.wizard.step1.header':'Get Started',
