浏览代码

Revert "AMBARI-3775. Adding or Deleting zookeeper servers should reconfigure ha.zookeeper.quorum, hbase.zookeeper.quorum, and templeton.zookeeper.hosts properties. (onechiporenko)"

This reverts commit 16d4306a6a42c2f82fe4c0f3705d55e6e2d18e37.
Yusaku Sako 11 年之前
父节点
当前提交
b6b6aa86c8
共有 3 个文件被更改,包括 38 次插入122 次删除
  1. 35 117
      ambari-web/app/controllers/main/host/details.js
  2. 0 1
      ambari-web/app/messages.js
  3. 3 4
      ambari-web/app/views/common/modal_popup.js

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

@@ -366,55 +366,48 @@ App.MainHostDetailsController = Em.Controller.extend({
 
     var securityEnabled = App.router.get('mainAdminSecurityController').getUpdatedSecurityStatus();
 
-    if (componentName === 'ZOOKEEPER_SERVER') {
+    if (securityEnabled) {
       App.showConfirmationPopup(function() {
         self.primary(component);
-      }, Em.I18n.t('hosts.host.addComponent.addZooKeeper'));
+      }, Em.I18n.t('hosts.host.addComponent.securityNote').format(componentName,self.get('content.hostName')));
     }
     else {
-      if (securityEnabled) {
-        App.showConfirmationPopup(function() {
-          self.primary(component);
-        }, Em.I18n.t('hosts.host.addComponent.securityNote').format(componentName,self.get('content.hostName')));
+      var dn = displayName;
+      if (subComponentNames !== null && subComponentNames.length > 0) {
+        var dns = [];
+        subComponentNames.forEach(function(scn){
+          dns.push(App.format.role(scn));
+        });
+        dn += " ("+dns.join(", ")+")";
       }
-      else {
-        var dn = displayName;
-        if (subComponentNames !== null && subComponentNames.length > 0) {
-          var dns = [];
-          subComponentNames.forEach(function(scn){
-            dns.push(App.format.role(scn));
-          });
-          dn += " ("+dns.join(", ")+")";
-        }
-        App.ModalPopup.show({
-          primary: Em.I18n.t('yes'),
-          secondary: Em.I18n.t('no'),
-          header: Em.I18n.t('popup.confirmation.commonHeader'),
-          addComponentMsg: function() {
-            return Em.I18n.t('hosts.host.addComponent.msg').format(dn);
-          }.property(),
-          bodyClass: Ember.View.extend({
-            templateName: require('templates/main/host/details/addComponentPopup')
-          }),
-          onPrimary: function () {
-            this.hide();
-            if (component.get('componentName') === 'CLIENTS') {
-              // Clients component has many sub-components which
-              // need to be installed.
-              var scs = component.get('subComponentNames');
-              scs.forEach(function (sc, index) {
-                var c = Em.Object.create({
-                  displayName: App.format.role(sc),
-                  componentName: sc
-                });
-                self.primary(c, scs.length - index === 1);
+      App.ModalPopup.show({
+        primary: Em.I18n.t('yes'),
+        secondary: Em.I18n.t('no'),
+        header: Em.I18n.t('popup.confirmation.commonHeader'),
+        addComponentMsg: function() {
+          return Em.I18n.t('hosts.host.addComponent.msg').format(dn);
+        }.property(),
+        bodyClass: Ember.View.extend({
+          templateName: require('templates/main/host/details/addComponentPopup')
+        }),
+        onPrimary: function () {
+          this.hide();
+          if (component.get('componentName') === 'CLIENTS') {
+            // Clients component has many sub-components which
+            // need to be installed.
+            var scs = component.get('subComponentNames');
+            scs.forEach(function (sc, index) {
+              var c = Em.Object.create({
+                displayName: App.format.role(sc),
+                componentName: sc
               });
-            } else {
-              self.primary(component, true);
-            }
+              self.primary(c, scs.length - index === 1);
+            });
+          } else {
+            self.primary(component, true);
           }
-        });
-      }
+        }
+      });
     }
   },
 
@@ -472,84 +465,9 @@ App.MainHostDetailsController = Em.Controller.extend({
             if (App.router.get('applicationController').loadShowBgChecked() && showPopup) {
               App.router.get('backgroundOperationsController').showPopup();
             }
-            if (componentName === 'ZOOKEEPER_SERVER') {
-              self.checkZkConfigs();
-            }
           });
       });
   },
-  /**
-   * Load tags
-   */
-  checkZkConfigs: function() {
-    App.ajax.send({
-      name: 'config.tags',
-      sender: this,
-      success: 'checkZkConfigsSuccessCallback'
-    });
-  },
-  /**
-   * Load needed configs
-   * @param data
-   */
-  checkZkConfigsSuccessCallback: function(data) {
-    var urlParams = [];
-    urlParams.push('(type=core-site&tag=' + data.Clusters.desired_configs['core-site'].tag + ')');
-    if (App.Service.find().someProperty('serviceName', 'HBASE')) {
-      urlParams.push('(type=hbase-site&tag=' + data.Clusters.desired_configs['hbase-site'].tag + ')');
-    }
-    if (App.Service.find().someProperty('serviceName', 'HIVE')) {
-      urlParams.push('(type=webhcat-site&tag=' + data.Clusters.desired_configs['webhcat-site'].tag + ')');
-    }
-    App.ajax.send({
-      name: 'reassign.load_configs',
-      sender: this,
-      data: {
-        urlParams: urlParams.join('|')
-      },
-      success: 'setNewZkConfigs'
-    });
-  },
-  /**
-   * Set new values for some configs
-   * @param data
-   */
-  setNewZkConfigs: function(data) {
-    var configs = [];
-    data.items.forEach(function (item) {
-      configs[item.type] = item.properties;
-    }, this);
-    if (App.isHadoop2Stack) {
-      if (!App.HostComponent.find().someProperty('componentName', 'SECONDARY_NAMENODE')) {
-        var zks = App.HostComponent.find().filterProperty('componentName', 'ZOOKEEPER_SERVER').mapProperty('host.hostName');
-        var value = '';
-        zks.forEach(function(zk) {
-          value += zk + ':2181,';
-        });
-        value.slice(0,-1);
-        configs['core-site']['ha.zookeeper.quorum'] = value;
-      }
-    }
-    var oneZk = App.HostComponent.find().findProperty('componentName', 'ZOOKEEPER_SERVER').get('host.hostName');
-    if (configs['hbase-site']) {
-      configs['hbase-site']['hbase.zookeeper.quorum'] = oneZk;
-    }
-    if (configs['webhcat-site']) {
-      configs['webhcat-site']['templeton.zookeeper.hosts'] = oneZk;
-    }
-    for (var site in configs) {
-      if (!configs.hasOwnProperty(site)) continue;
-      App.ajax.send({
-        name: 'reassign.save_configs',
-        sender: this,
-        data: {
-          siteName: site,
-          properties: configs[site]
-        }
-      });
-    }
-  },
-
   /**
    * send command to server to install selected host component
    * @param event

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

@@ -1319,7 +1319,6 @@ Em.I18n.translations = {
   '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.installComponent.msg':'Are you sure you want to install {0}?',
   'hosts.host.addComponent.msg':'Are you sure you want to add {0}?',
-  'hosts.host.addComponent.addZooKeeper':'Adding ZooKeeper Server may reconfigure such properties:<ul><li>ha.zookeeper.quorum</li><li>hbase.zookeeper.quorum</li><li>templeton.zookeeper.hosts</li></ul>',
   'hosts.host.addComponent.note':'Note: After this component is installed, go to Services -> Nagios to restart the Nagios service.  This is required for the alerts and notifications to work properly.',
   'hosts.host.addComponent.securityNote':'You are running your cluster in secure mode. You must set up the keytab for {0} on {1} before you proceed. Otherwise, the component will not be able to start properly.',
   'hosts.host.datanode.decommission':'Decommission DataNode',

+ 3 - 4
ambari-web/app/views/common/modal_popup.js

@@ -95,7 +95,7 @@ App.ModalPopup.reopenClass({
     return popup;
   }
 
-});
+})
 
 App.showReloadPopup = function () {
   return App.ModalPopup.show({
@@ -106,7 +106,7 @@ App.showReloadPopup = function () {
     body: "<div class='alert alert-info'><div class='spinner'><span>" + this.t('app.reloadPopup.text') + "</span></div></div><div><a href='#' onclick='location.reload();'>" + this.t('app.reloadPopup.link') + "</a></div>",
     encodeBody: false
   });
-};
+}
 
 /**
  * Show confirmation popup
@@ -121,7 +121,6 @@ App.showConfirmationPopup = function (primary, body, secondary) {
   }
   return App.ModalPopup.show({
     primary: Em.I18n.t('ok'),
-    encodeBody: false,
     secondary: Em.I18n.t('common.cancel'),
     header: Em.I18n.t('popup.confirmation.commonHeader'),
     body: body || Em.I18n.t('question.sure'),
@@ -159,4 +158,4 @@ App.showAlertPopup = function (header, body, primary) {
       }
     }
   });
-};
+}