hawq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r...@apache.org
Subject incubator-hawq git commit: HAWQ-486.gpcheck can't find namenode with Ambari install PHD
Date Tue, 08 Mar 2016 03:51:27 GMT
Repository: incubator-hawq
Updated Branches:
  refs/heads/master 943ba73ef -> 5cfa2ef8e


HAWQ-486.gpcheck can't find namenode with Ambari install PHD


Project: http://git-wip-us.apache.org/repos/asf/incubator-hawq/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-hawq/commit/5cfa2ef8
Tree: http://git-wip-us.apache.org/repos/asf/incubator-hawq/tree/5cfa2ef8
Diff: http://git-wip-us.apache.org/repos/asf/incubator-hawq/diff/5cfa2ef8

Branch: refs/heads/master
Commit: 5cfa2ef8e32ce31d77c8d09b3de3b7a103789554
Parents: 943ba73
Author: xsheng <xsheng@pivotal.io>
Authored: Thu Mar 3 14:20:27 2016 +0800
Committer: rlei <rlei@pivotal.io>
Committed: Tue Mar 8 11:50:53 2016 +0800

----------------------------------------------------------------------
 tools/bin/gpcheck | 25 ++++++++++++++-----------
 1 file changed, 14 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/5cfa2ef8/tools/bin/gpcheck
----------------------------------------------------------------------
diff --git a/tools/bin/gpcheck b/tools/bin/gpcheck
index 4125ed3..aefe499 100755
--- a/tools/bin/gpcheck
+++ b/tools/bin/gpcheck
@@ -251,23 +251,26 @@ def getHDFSNamenodeHost():
     # read namenode address from core-site.xml
     with open(core_site_file) as f:
         xmldoc = minidom.parse(f)
+    namenode_addr = ''
     for node in xmldoc.getElementsByTagName('property'):
-        if getPropName(node) == 'fs.default.name':
+        if getPropName(node) == 'fs.default.name' or getPropName(node) == 'fs.defaultFS':
             fsurl = getPropValue(node).strip()
             namenode_addr = re.search(r"//([^:/]*)", fsurl).group(1)
             break
 
     # run hostname command on remote to get actual hostname
-    cmd = Command(namenode_addr, "hostname", REMOTE, namenode_addr)
-    pool.addCommand(cmd)
-    pool.join()
-    items = pool.getCompletedItems()
-    for i in items:
-        if i.results.rc or i.results.halt or not i.results.completed:
-            raise Exception("error running 'hostname' command: %s" % i.results.stderr.strip())
-        namenode_host = i.results.stdout.strip()
-
-    logger.info("detect namenode hostname to be %s" % namenode_host)
+    if namenode_addr == '':
+        logger.error("cannot detect namenode from %s" % core_site_file)
+    else:
+        cmd = Command(namenode_addr, "hostname", REMOTE, namenode_addr)
+        pool.addCommand(cmd)
+        pool.join()
+        items = pool.getCompletedItems()
+        for i in items:
+            if i.results.rc or i.results.halt or not i.results.completed:
+                raise Exception("error running 'hostname' command: %s" % i.results.stderr.strip())
+            namenode_host = i.results.stdout.strip()
+        logger.info("detect namenode hostname to be %s" % namenode_host)
     return namenode_host
 
 


Mime
View raw message