accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From els...@apache.org
Subject git commit: ACCUMULO-1973 Add a warning if we don't find non-default values for namenode configuration
Date Fri, 03 Jan 2014 21:45:53 GMT
Updated Branches:
  refs/heads/1.4.5-SNAPSHOT adaf05790 -> 79ff4f1bb


ACCUMULO-1973 Add a warning if we don't find non-default values for namenode configuration

This is one of biggest confusions that new users seem to run into when
trying to initialize Accumulo (as it's a problem with us not finding
Hadoop configurations). Hadoop will work properly, as its configuration
is likely correct, but Accumulo can't find core-site.xml, tries to write
to the root of the local fs, and fails. Try to be a bit more explicit
about what happened when we initialized and the Configuration from the FS.


Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/79ff4f1b
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/79ff4f1b
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/79ff4f1b

Branch: refs/heads/1.4.5-SNAPSHOT
Commit: 79ff4f1bbee3d9603b1b5007e7041ef6f1d1a8de
Parents: adaf057
Author: Josh Elser <elserj@apache.org>
Authored: Fri Jan 3 16:42:20 2014 -0500
Committer: Josh Elser <elserj@apache.org>
Committed: Fri Jan 3 16:42:20 2014 -0500

----------------------------------------------------------------------
 .../org/apache/accumulo/server/util/Initialize.java    | 13 +++++++++++++
 1 file changed, 13 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/79ff4f1b/src/server/src/main/java/org/apache/accumulo/server/util/Initialize.java
----------------------------------------------------------------------
diff --git a/src/server/src/main/java/org/apache/accumulo/server/util/Initialize.java b/src/server/src/main/java/org/apache/accumulo/server/util/Initialize.java
index c6bb57a..5c749dd 100644
--- a/src/server/src/main/java/org/apache/accumulo/server/util/Initialize.java
+++ b/src/server/src/main/java/org/apache/accumulo/server/util/Initialize.java
@@ -204,6 +204,19 @@ public class Initialize {
       initFileSystem(fs, conf, uuid);
     } catch (Exception e) {
       log.fatal("Failed to initialize filesystem", e);
+      
+      // Try to warn the user about what the actual problem is
+      Configuration fsConf = fs.getConf();
+      
+      final String defaultFsUri = "file:///";
+      String fsDefaultName = fsConf.get("fs.default.name", defaultFsUri), fsDefaultFS = fsConf.get("fs.defaultFS",
defaultFsUri);
+      
+      // Try to determine when we couldn't find an appropriate core-site.xml on the classpath
+      if (defaultFsUri.equals(fsDefaultName) && defaultFsUri.equals(fsDefaultFS))
{
+        log.fatal("Default filesystem value ('fs.defaultFS' or 'fs.default.name') was found
in the Hadoop configuration");
+        log.fatal("Please ensure that the Hadoop core-site.xml is on the classpath using
'general.classpaths' in accumulo-site.xml");
+      }
+      
       return false;
     }
     


Mime
View raw message