Jelajahi Sumber

Manage JournalNode Wizard: Link Add/Delete operation for JournalNode to the wizard (rzang)

Richard Zang 8 tahun lalu
induk
melakukan
d4957f128c

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

@@ -88,7 +88,7 @@ App.supports = {
   addingNewRepository: false,
   kerberosStackAdvisor: true,
   logCountVizualization: false,
-  manageJournalNode: false
+  manageJournalNode: true
 };
 
 if (App.enableExperimental) {

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

@@ -312,7 +312,7 @@ App.MainHostDetailsController = Em.Controller.extend(App.SupportClientConfigsDow
     var isLastComponent = (this.getTotalComponent(component) === 1);
     return App.ModalPopup.show({
       header: Em.I18n.t('popup.confirmation.commonHeader'),
-      primary: Em.I18n.t('hosts.host.deleteComponent.popup.confirm'),
+      primary: componentName == 'JOURNALNODE'? Em.I18n.t('ok') : Em.I18n.t('hosts.host.deleteComponent.popup.confirm'),
       bodyClass: Em.View.extend({
         templateName: require('templates/main/host/details/deleteComponentPopup')
       }),
@@ -321,6 +321,7 @@ App.MainHostDetailsController = Em.Controller.extend(App.SupportClientConfigsDow
       isNimbus: componentName == 'NIMBUS',
       isRangerKMSServer: componentName == 'RANGER_KMS_SERVER',
       isZkServer: componentName == 'ZOOKEEPER_SERVER',
+      isJournalNode: componentName == 'JOURNALNODE',
 
       deleteHiveMetastoreMsg: Em.I18n.t('hosts.host.deleteComponent.popup.deleteHiveMetastore'),
       deleteWebHCatServerMsg: Em.I18n.t('hosts.host.deleteComponent.popup.deleteWebHCatServer'),
@@ -329,6 +330,7 @@ App.MainHostDetailsController = Em.Controller.extend(App.SupportClientConfigsDow
       lastComponentError: Em.I18n.t('hosts.host.deleteComponent.popup.warning').format(displayName),
       deleteComponentMsg: Em.I18n.t('hosts.host.deleteComponent.popup.msg1').format(displayName),
       deleteZkServerMsg: Em.I18n.t('hosts.host.deleteComponent.popup.deleteZooKeeperServer'),
+      deleteJournalNodeMsg: Em.I18n.t('hosts.host.deleteComponent.popup.deleteJournalNodeMsg'),
 
       isChecked: false,
       disablePrimary: Em.computed.not('isChecked'),
@@ -339,10 +341,15 @@ App.MainHostDetailsController = Em.Controller.extend(App.SupportClientConfigsDow
 
       onPrimary: function () {
         var popup = this;
-        self._doDeleteHostComponent(component, function () {
-          self.set('redrawComponents', true);
+        if (componentName == 'JOURNALNODE') {
           popup.hide();
-        });
+          App.router.transitionTo('main.services.manageJournalNode');
+        } else {
+          self._doDeleteHostComponent(component, function () {
+            self.set('redrawComponents', true);
+            popup.hide();
+          });
+        }
       }
     });
   },
@@ -593,6 +600,11 @@ App.MainHostDetailsController = Em.Controller.extend(App.SupportClientConfigsDow
           self.loadConfigs("loadRangerConfigs");
         }, Em.I18n.t('hosts.host.addComponent.' + componentName) + manualKerberosWarning);
         break;
+      case 'JOURNALNODE':
+        returnFunc = App.showConfirmationPopup(function () {
+          App.router.transitionTo('main.services.manageJournalNode');
+        }, Em.I18n.t('hosts.host.addComponent.' + componentName) + manualKerberosWarning);
+        break;
       default:
         returnFunc = this.addClientComponent(component, isManualKerberos);
     }

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

@@ -2583,6 +2583,7 @@ Em.I18n.translations = {
   'hosts.host.deleteComponent.popup.msg1':'Are you sure you want to delete {0}?',
   'hosts.host.deleteComponent.popup.deleteZooKeeperServer':'Deleting <i>ZooKeeper Server</i> may reconfigure such properties:<ul><li>zookeeper.connect</li><li>ha.zookeeper.quorum</li><li>hbase.zookeeper.quorum</li><li>templeton.zookeeper.hosts</li><li>yarn.resourcemanager.zk-address</li><li>hive.zookeeper.quorum</li><li>hive.cluster.delegation.token.store.zookeeper.connectString</li><li>storm.zookeeper.servers</li><li>instance.zookeeper.host</li></ul>',
   'hosts.host.deleteComponent.popup.deleteRangerKMSServer': 'Deleting <i>Ranger KMS Server</i> may reconfigure such properties:<ul><li>hadoop.security.key.provider.path</li><li>dfs.encryption.key.provider.uri</li>',
+  'hosts.host.deleteComponent.popup.deleteJournalNodeMsg': 'You are about to open <i>Manage Journal Node Wizard</i>. Are you sure?',
   'hosts.host.deleteComponent.popup.warning':'<b>WARNING!</b> Delete the last <i>{0}</i> component in the cluster?</br>Deleting the last component in the cluster could result in permanent loss of service data.',
   'hosts.host.deleteComponent.popup.confirm':'Confirm Delete',
   'hosts.host.installComponent.popup.confirm':'Confirm Install',
@@ -2618,6 +2619,7 @@ Em.I18n.translations = {
   'hosts.host.decommissioning':'Decommissioning',
   'hosts.host.addComponent.HIVE_METASTORE':'Adding <i>Hive Metastore</i> will reconfigure such properties:<ul><li>hive.metastore.uris</li><li>templeton.hive.properties</li></ul>',
   'hosts.host.addComponent.WEBHCAT_SERVER':'You are about to add <i>WebHCat Server</i>. Are you sure?',
+  'hosts.host.addComponent.JOURNALNODE': 'You are about to open <i>Manage Journal Node Wizard</i>. Are you sure?',
   'hosts.host.deleteComponent.popup.deleteHiveMetastore':'Deleting <i>Hive Metastore</i> will reconfigure such properties:<ul><li>hive.metastore.uris</li><li>templeton.hive.properties</li></ul>',
   'hosts.host.deleteComponent.popup.deleteWebHCatServer':'You are about to delete <i>WebHCat Server</i>. Are you sure?',
   'hosts.host.configs.save.note': 'This configuration is created by ambari while installing/deleting {0} component on a host',

+ 3 - 1
ambari-web/app/models/stack_service_component.js

@@ -97,7 +97,9 @@ App.StackServiceComponent = DS.Model.extend({
 
   /** @property {Boolean} isAddableToHost - component can be added on host details page **/
   isAddableToHost: function() {
-    return this.get('isMasterAddableInstallerWizard') || ((this.get('isNotAddableOnlyInInstall') || this.get('isSlave') || this.get('isClient')) && !this.get('isHAComponentOnly'));
+    return this.get('isMasterAddableInstallerWizard')
+      || ((this.get('isNotAddableOnlyInInstall') || this.get('isSlave') || this.get('isClient'))
+        && (!this.get('isHAComponentOnly') || (App.get('isHaEnabled') && this.get('componentName') == 'JOURNALNODE')));
   }.property('componentName'),
 
   /** @property {Boolean} isDeletable - component supports delete action **/

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

@@ -37,4 +37,7 @@
 {{/if}}
 {{#if isRangerKMSServer}}
   <div class='alert'>{{{deleteRangerKMSServereMsg}}}</div>
+{{/if}}
+{{#if isJournalNode}}
+    <div class='alert'>{{{deleteJournalNodeMsg}}}</div>
 {{/if}}

+ 5 - 1
ambari-web/app/views/main/host/details/host_component_view.js

@@ -199,7 +199,11 @@ App.HostComponentView = Em.View.extend({
         return false;
       else
     	return true;
-    }    
+    }
+    if (this.get('hostComponent.componentName') == 'JOURNALNODE') {
+      var count_JN = App.HostComponent.find().filterProperty('componentName', 'JOURNALNODE').get('length');
+      return count_JN <= 3; // TODO get 3 from stack
+    }
     return (installedCount <= stackComponentCount)
       || ![App.HostComponentStatus.stopped, App.HostComponentStatus.unknown, App.HostComponentStatus.install_failed, App.HostComponentStatus.upgrade_failed, App.HostComponentStatus.init].contains(this.get('workStatus'));
   }.property('workStatus'),