ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From zhew...@apache.org
Subject ambari git commit: AMBARI-18172 Hive Service check is failing after moving webhcat server (zhewang)
Date Wed, 17 Aug 2016 18:23:50 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk ad2da2908 -> 849e28e98


AMBARI-18172 Hive Service check is failing after moving webhcat server
(zhewang)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/849e28e9
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/849e28e9
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/849e28e9

Branch: refs/heads/trunk
Commit: 849e28e980951b72665677ddb25dcb02d44e4748
Parents: ad2da29
Author: Zhe (Joe) Wang <zhewang@apache.org>
Authored: Wed Aug 17 11:23:09 2016 -0700
Committer: Zhe (Joe) Wang <zhewang@apache.org>
Committed: Wed Aug 17 11:23:37 2016 -0700

----------------------------------------------------------------------
 .../main/service/reassign/step4_controller.js   | 24 ++++++++++--
 ambari-web/app/utils.js                         |  1 +
 .../utils/configs/move_hm_config_initializer.js |  3 +-
 .../utils/configs/move_hs_config_initializer.js |  3 +-
 .../utils/configs/move_ws_config_initializer.js | 33 +++++++++++++++++
 .../service/reassign/step4_controller_test.js   | 39 ++++++++++++++------
 6 files changed, 85 insertions(+), 18 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/849e28e9/ambari-web/app/controllers/main/service/reassign/step4_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/service/reassign/step4_controller.js b/ambari-web/app/controllers/main/service/reassign/step4_controller.js
index db7028f..d853039 100644
--- a/ambari-web/app/controllers/main/service/reassign/step4_controller.js
+++ b/ambari-web/app/controllers/main/service/reassign/step4_controller.js
@@ -536,7 +536,7 @@ App.ReassignMasterWizardStep4Controller = App.HighAvailabilityProgressPageContro
     'SECONDARY_NAMENODE': ['hdfs-site', 'core-site'],
     'JOBTRACKER': ['mapred-site'],
     'RESOURCEMANAGER': ['yarn-site'],
-    'WEBHCAT_SERVER': ['webhcat-site'],
+    'WEBHCAT_SERVER': ['hive-env', 'webhcat-site', 'core-site'],
     'APP_TIMELINE_SERVER': ['yarn-site', 'yarn-env'],
     'OOZIE_SERVER': ['oozie-site', 'core-site', 'oozie-env'],
     'HIVE_SERVER': ['hive-site', 'webhcat-site', 'hive-env', 'core-site'],
@@ -684,13 +684,26 @@ App.ReassignMasterWizardStep4Controller = App.HighAvailabilityProgressPageContro
    * Settings used to the App.MoveHsConfigInitializer and App.MoveHmConfigInitializer setup
    *
    * @param {object} configs
-   * @returns {{hiveUser: string, webhcatUser: string}}
+   * @returns {{hiveUser: string}}
    * @private
    * @method _getHiveInitializerSettings
    */
   _getHiveInitializerSettings: function (configs) {
     return {
-      hiveUser: configs['hive-env']['hive_user'],
+      hiveUser: configs['hive-env']['hive_user']
+    };
+  },
+
+  /**
+   * Settings used to the App.MoveWsConfigInitializer setup
+   *
+   * @param {object} configs
+   * @returns {{webhcatUser: string}}
+   * @private
+   * @method _getWsInitializerSettings
+   */
+  _getWsInitializerSettings: function (configs) {
+    return {
       webhcatUser: configs['hive-env']['webhcat_user']
     };
   },
@@ -769,6 +782,11 @@ App.ReassignMasterWizardStep4Controller = App.HighAvailabilityProgressPageContro
         configs = this.setDynamicConfigs(configs, App.MoveHsConfigInitializer);
         App.MoveHsConfigInitializer.cleanup();
         break;
+      case 'WEBHCAT_SERVER':
+        App.MoveWsConfigInitializer.setup(this._getWsInitializerSettings(configs));
+        configs = this.setDynamicConfigs(configs, App.MoveWsConfigInitializer);
+        App.MoveWsConfigInitializer.cleanup();
+        break;
       case 'OOZIE_SERVER':
         App.MoveOSConfigInitializer.setup(this._getOsInitializerSettings(configs));
         configs = this.setDynamicConfigs(configs, App.MoveOSConfigInitializer);

http://git-wip-us.apache.org/repos/asf/ambari/blob/849e28e9/ambari-web/app/utils.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/utils.js b/ambari-web/app/utils.js
index 1041a9c..509efc1 100644
--- a/ambari-web/app/utils.js
+++ b/ambari-web/app/utils.js
@@ -33,3 +33,4 @@ require('utils/configs/move_rm_config_initializer');
 require('utils/configs/move_os_config_initializer');
 require('utils/configs/move_hm_config_initializer');
 require('utils/configs/move_hs_config_initializer');
+require('utils/configs/move_ws_config_initializer');

http://git-wip-us.apache.org/repos/asf/ambari/blob/849e28e9/ambari-web/app/utils/configs/move_hm_config_initializer.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/utils/configs/move_hm_config_initializer.js b/ambari-web/app/utils/configs/move_hm_config_initializer.js
index cd46682..ab150e9 100644
--- a/ambari-web/app/utils/configs/move_hm_config_initializer.js
+++ b/ambari-web/app/utils/configs/move_hm_config_initializer.js
@@ -27,8 +27,7 @@ require('utils/configs/move_hive_component_config_initializer_class');
 App.MoveHmConfigInitializer = App.MoveHiveComponentConfigInitializerClass.create({
 
   initializers: {
-    'hadoop.proxyuser.{{hiveUser}}.hosts': App.MoveHiveComponentConfigInitializerClass.getHostsWithComponentsConfig(['HIVE_SERVER',
'HIVE_METASTORE'], 'HIVE_METASTORE'),
-    'hadoop.proxyuser.{{webhcatUser}}.hosts': App.MoveHiveComponentConfigInitializerClass.getHostsWithComponentsConfig(['HIVE_SERVER',
'HIVE_METASTORE'], 'HIVE_METASTORE')
+    'hadoop.proxyuser.{{hiveUser}}.hosts': App.MoveHiveComponentConfigInitializerClass.getHostsWithComponentsConfig(['HIVE_SERVER',
'HIVE_METASTORE'], 'HIVE_METASTORE')
   },
 
   uniqueInitializers: {

http://git-wip-us.apache.org/repos/asf/ambari/blob/849e28e9/ambari-web/app/utils/configs/move_hs_config_initializer.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/utils/configs/move_hs_config_initializer.js b/ambari-web/app/utils/configs/move_hs_config_initializer.js
index abc8745..7b15d0d 100644
--- a/ambari-web/app/utils/configs/move_hs_config_initializer.js
+++ b/ambari-web/app/utils/configs/move_hs_config_initializer.js
@@ -27,8 +27,7 @@ require('utils/configs/move_hive_component_config_initializer_class');
 App.MoveHsConfigInitializer = App.MoveHiveComponentConfigInitializerClass.create({
 
   initializers: {
-    'hadoop.proxyuser.{{hiveUser}}.hosts': App.MoveHiveComponentConfigInitializerClass.getHostsWithComponentsConfig(['HIVE_SERVER',
'HIVE_METASTORE'], 'HIVE_SERVER'),
-    'hadoop.proxyuser.{{webhcatUser}}.hosts': App.MoveHiveComponentConfigInitializerClass.getHostsWithComponentsConfig(['HIVE_SERVER',
'HIVE_METASTORE'], 'HIVE_SERVER')
+    'hadoop.proxyuser.{{hiveUser}}.hosts': App.MoveHiveComponentConfigInitializerClass.getHostsWithComponentsConfig(['HIVE_SERVER',
'HIVE_METASTORE'], 'HIVE_SERVER')
   }
 
 });
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/849e28e9/ambari-web/app/utils/configs/move_ws_config_initializer.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/utils/configs/move_ws_config_initializer.js b/ambari-web/app/utils/configs/move_ws_config_initializer.js
new file mode 100644
index 0000000..36d1607
--- /dev/null
+++ b/ambari-web/app/utils/configs/move_ws_config_initializer.js
@@ -0,0 +1,33 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+var App = require('app');
+require('utils/configs/move_hive_component_config_initializer_class');
+
+/**
+ * Initializer for configs which should be affected when Hive Server is moved from one host
to another
+ *
+ * @type {MoveHiveComponentConfigInitializerClass}
+ */
+App.MoveWsConfigInitializer = App.MoveHiveComponentConfigInitializerClass.create({
+
+  initializers: {
+    'hadoop.proxyuser.{{webhcatUser}}.hosts': App.MoveHiveComponentConfigInitializerClass.getHostsWithComponentsConfig(['WEBHCAT_SERVER'],
'WEBHCAT_SERVER')
+  }
+
+});
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/849e28e9/ambari-web/test/controllers/main/service/reassign/step4_controller_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/controllers/main/service/reassign/step4_controller_test.js b/ambari-web/test/controllers/main/service/reassign/step4_controller_test.js
index cbf47e0..8898849 100644
--- a/ambari-web/test/controllers/main/service/reassign/step4_controller_test.js
+++ b/ambari-web/test/controllers/main/service/reassign/step4_controller_test.js
@@ -577,7 +577,9 @@ describe('App.ReassignMasterWizardStep4Controller', function () {
       {
         componentName: 'WEBHCAT_SERVER',
         result: [
-          "(type=webhcat-site&tag=7)"
+          "(type=hive-env&tag=11)",
+          "(type=webhcat-site&tag=7)",
+          "(type=core-site&tag=2)"
         ]
       },
       {
@@ -1322,8 +1324,7 @@ describe('App.ReassignMasterWizardStep4Controller', function () {
     it("reassign component is HIVE_METASTORE", function() {
       var configs = {
         'hive-env': {
-          'hive_user': 'hive_user',
-          'webhcat_user': 'webhcat_user'
+          'hive_user': 'hive_user'
         },
         'hive-site': {
           'hive.metastore.uris': ''
@@ -1332,8 +1333,7 @@ describe('App.ReassignMasterWizardStep4Controller', function () {
           'templeton.hive.properties': 'thrift'
         },
         'core-site': {
-          'hadoop.proxyuser.hive_user.hosts': '',
-          'hadoop.proxyuser.webhcat_user.hosts': ''
+          'hadoop.proxyuser.hive_user.hosts': ''
         }
       };
       App.MoveHmConfigInitializer.setup(controller._getHiveInitializerSettings(configs));
@@ -1341,15 +1341,13 @@ describe('App.ReassignMasterWizardStep4Controller', function () {
       expect(configs['hive-site']['hive.metastore.uris']).to.equal('thrift://host3:9083,thrift://host2:9083');
       expect(configs['webhcat-site']['templeton.hive.properties']).to.equal('thrift');
       expect(configs['core-site']['hadoop.proxyuser.hive_user.hosts']).to.equal('host2,host3,host4');
-      expect(configs['core-site']['hadoop.proxyuser.webhcat_user.hosts']).to.equal('host2,host3,host4');
     });
 
     it("reassign component is HIVE_SERVER", function() {
       controller.get('content.masterComponentHosts').pushObject({component: 'HIVE_SERVER',
hostName: 'host1'});
       var configs = {
         'hive-env': {
-          'hive_user': 'hive_user',
-          'webhcat_user': 'webhcat_user'
+          'hive_user': 'hive_user'
         },
         'hive-site': {
           'hive.metastore.uris': ''
@@ -1358,14 +1356,33 @@ describe('App.ReassignMasterWizardStep4Controller', function () {
           'templeton.hive.properties': 'thrift'
         },
         'core-site': {
-          'hadoop.proxyuser.hive_user.hosts': '',
-          'hadoop.proxyuser.webhcat_user.hosts': ''
+          'hadoop.proxyuser.hive_user.hosts': ''
         }
       };
       App.MoveHsConfigInitializer.setup(controller._getHiveInitializerSettings(configs));
       configs = controller.setDynamicConfigs(configs, App.MoveHsConfigInitializer);
       expect(configs['core-site']['hadoop.proxyuser.hive_user.hosts']).to.equal('host1,host2,host3,host4');
-      expect(configs['core-site']['hadoop.proxyuser.webhcat_user.hosts']).to.equal('host1,host2,host3,host4');
+    });
+
+    it("reassign component is WEBHCAT_SERVER", function() {
+      controller.get('content.masterComponentHosts').pushObject({component: 'WEBHCAT_SERVER',
hostName: 'host1'});
+      var configs = {
+        'hive-env': {
+          'webhcat_user': 'webhcat_user'
+        },
+        'hive-site': {
+          'hive.metastore.uris': ''
+        },
+        'webhcat-site': {
+          'templeton.hive.properties': 'thrift'
+        },
+        'core-site': {
+          'hadoop.proxyuser.webhcat_user.hosts': ''
+        }
+      };
+      App.MoveWsConfigInitializer.setup(controller._getWsInitializerSettings(configs));
+      configs = controller.setDynamicConfigs(configs, App.MoveWsConfigInitializer);
+      expect(configs['core-site']['hadoop.proxyuser.webhcat_user.hosts']).to.equal('host2');
     });
   });
 


Mime
View raw message