我试图在Windows上设置Hadoop 2.20和HBase 0.98的完全分布式4节点开发集群。 我已经成功地在Windows上构build了Hadoop,最近也在Windows上构build了HBase。
我们已经成功运行了Hadoop安装指南中的wordcount示例以及自定义的WebHDFS作业。 由于完全分布在Windows上的HBase目前还不支持,我在cygwin下运行HBase。
当试图从我的主(./bin/start-hbase.sh)启动hbase时,出现以下错误:
2014-04-17 16:22:08,599 ERROR [main] util.Shell: Failed to locate the winutils binary in the hadoop binary path java.io.IOException: Could not locate executable null\bin\winutils.exe in the Hadoop binaries. at org.apache.hadoop.util.Shell.getQualifiedBinPath(Shell.java:278) at org.apache.hadoop.util.Shell.getWinUtilsPath(Shell.java:300) at org.apache.hadoop.util.Shell.<clinit>(Shell.java:293) at org.apache.hadoop.util.StringUtils.<clinit>(StringUtils.java:76) at org.apache.hadoop.conf.Configuration.getStrings(Configuration.java:1514) at org.apache.hadoop.hbase.zookeeper.ZKConfig.makeZKProps(ZKConfig.java:113) at org.apache.hadoop.hbase.zookeeper.ZKServerTool.main(ZKServerTool.java:46)
看一下Shell.java源代码,这里设置为null,看起来是HADOOP_HOME环境variables。 在C:/ cygwin / root / usr / local / hbase下的cygwin根目录下有hadoop的D:/ hadoop和HBase,cygwin $ HADOOP_HOMEvariables是/ cygdrive / d / hadoop /,而Windows系统环境variables%HADOOP_HOME%是D:\ hadoop。 对我来说就像这两个variables,应该find正确的variables…
也可能相关:我正在运行Windows Server 2012 x64。
编辑:我已经validation,实际上是D:\ hadoop \ bin \中的winutils.exe。
我们找到了。 因此,在Hadoop的Shell.java中,您会发现有两个选项可用于沟通Hadoop路径。
// first check the Dflag hadoop.home.dir with JVM scope String home = System.getProperty("hadoop.home.dir"); // fall back to the system/user-global env variable if (home == null) { home = System.getenv("HADOOP_HOME"); }
经过反复试验,我们发现在HBase选项(HBase的hbase-env.sh,HBASE_OPTS变量)中,您需要在此选项中添加Hadoop的Windows(!)路径。 在我们的例子中,我们需要添加-Dhadoop.home.dir=D:/hadoop
。
祝你好运,谁碰巧碰到这个;)。