You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by ao...@apache.org on 2015/02/10 14:32:59 UTC

ambari git commit: AMBARI-9548. Updating FSRoot for Hive Metastore doesn't seem to work (breaks Hive functionality after move NameNode and NameNode HA) (aonishuk)

Repository: ambari
Updated Branches:
  refs/heads/trunk 874b048c7 -> 43150b95a


AMBARI-9548. Updating FSRoot for Hive Metastore doesn't seem to work (breaks Hive functionality after move NameNode and NameNode HA) (aonishuk)


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

Branch: refs/heads/trunk
Commit: 43150b95aa3a2974193338d23e4b3e3632927bd3
Parents: 874b048
Author: Andrew Onishuk <ao...@hortonworks.com>
Authored: Tue Feb 10 15:32:47 2015 +0200
Committer: Andrew Onishuk <ao...@hortonworks.com>
Committed: Tue Feb 10 15:32:47 2015 +0200

----------------------------------------------------------------------
 .../HIVE/0.12.0.2.0/package/scripts/hive_service.py           | 7 ++++---
 .../src/test/python/stacks/2.0.6/HIVE/test_hive_server.py     | 3 ++-
 2 files changed, 6 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/43150b95/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive_service.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive_service.py b/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive_service.py
index 91d68bf..04ac066 100644
--- a/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive_service.py
+++ b/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive_service.py
@@ -127,10 +127,11 @@ def hive_service(name, action='start', rolling_restart=False):
 def check_fs_root():
   import params  
   fs_root_url = format("{fs_root}{hive_apps_whs_dir}")
-  cmd = format("metatool -listFSRoot 2>/dev/null | grep hdfs:// | grep -v '.db$'")
-  code, out = shell.call(cmd, user=params.hive_user)
+  metatool_cmd = format("hive --config {hive_server_conf_dir} --service metatool")
+  cmd = format("{metatool_cmd} -listFSRoot 2>/dev/null | grep hdfs:// | grep -v '.db$'")
+  code, out = shell.call(cmd, user=params.hive_user, env={'PATH' : params.execute_path })
   if code == 0 and fs_root_url.strip() != out.strip():
-    cmd = format("metatool -updateLocation {fs_root}{hive_apps_whs_dir} {out}")
+    cmd = format("{metatool_cmd} -updateLocation {fs_root}{hive_apps_whs_dir} {out}")
     Execute(cmd,
             environment= {'PATH' : params.execute_path },
             user=params.hive_user)

http://git-wip-us.apache.org/repos/asf/ambari/blob/43150b95/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_server.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_server.py b/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_server.py
index d3121d3..e0c683c 100644
--- a/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_server.py
+++ b/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_server.py
@@ -57,7 +57,8 @@ class TestHiveServer(RMFTestCase):
     )
 
     self.assert_configure_default()
-    self.assertResourceCalled('Execute', 'metatool -updateLocation hdfs://c6401.ambari.apache.org:8020/apps/hive/warehouse ',
+    self.printResources()
+    self.assertResourceCalled('Execute', 'hive --config /etc/hive/conf.server --service metatool -updateLocation hdfs://c6401.ambari.apache.org:8020/apps/hive/warehouse ',
         environment = {'PATH' : "/bin:/usr/lib/hive/bin:/usr/bin"},
         user = 'hive',
     )