【问题标题】:hbase mapreduce file not found exceptionhbase mapreduce 文件未找到异常
【发布时间】:2014-12-24 12:19:44
【问题描述】:

我已经在 2 台机器上安装了 hadoop 2.4.1 和 hbase 0.98.8。当我运行 hbase mapreduce 作业时,出现以下错误:

Exception in thread "main" java.io.FileNotFoundException: File does not exist: hdfs://pc1/opt/hbase-0.98.8-hadoop2/lib/hbase-server-0.98.8-hadoop2.jar
    at org.apache.hadoop.hdfs.DistributedFileSystem$17.doCall(DistributedFileSystem.java:1128)
    at org.apache.hadoop.hdfs.DistributedFileSystem$17.doCall(DistributedFileSystem.java:1120)
    at org.apache.hadoop.fs.FileSystemLinkResolver.resolve(FileSystemLinkResolver.java:81)
    at org.apache.hadoop.hdfs.DistributedFileSystem.getFileStatus(DistributedFileSystem.java:1120)
    at org.apache.hadoop.mapreduce.filecache.ClientDistributedCacheManager.getFileStatus(ClientDistributedCacheManager.java:288)
    at org.apache.hadoop.mapreduce.filecache.ClientDistributedCacheManager.getFileStatus(ClientDistributedCacheManager.java:224)
    at org.apache.hadoop.mapreduce.filecache.ClientDistributedCacheManager.determineTimestamps(ClientDistributedCacheManager.java:93)
    at org.apache.hadoop.mapreduce.filecache.ClientDistributedCacheManager.determineTimestampsAndCacheVisibilities(ClientDistributedCacheManager.java:57)
    at org.apache.hadoop.mapreduce.JobSubmitter.copyAndConfigureFiles(JobSubmitter.java:265)
    at org.apache.hadoop.mapreduce.JobSubmitter.copyAndConfigureFiles(JobSubmitter.java:301)
    at org.apache.hadoop.mapreduce.JobSubmitter.submitJobInternal(JobSubmitter.java:389)
    at org.apache.hadoop.mapreduce.Job$10.run(Job.java:1285)
    at org.apache.hadoop.mapreduce.Job$10.run(Job.java:1282)
    at java.security.AccessController.doPrivileged(Native Method)
    at javax.security.auth.Subject.doAs(Subject.java:415)
    at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1556)
    at org.apache.hadoop.mapreduce.Job.submit(Job.java:1282)
    at org.apache.hadoop.mapreduce.Job.waitForCompletion(Job.java:1303)
    at thesis.test2.run(test2.java:93)
    at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:70)
    at thesis.test2.main(test2.java:107)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at org.apache.hadoop.util.RunJar.main(RunJar.java:212)

我可以毫无问题地运行 hadoop mapreduce 作业和简单的 hbase 作业。我尝试运行的代码是应该运行的示例。

【问题讨论】:

标签: hadoop mapreduce hbase filenotfoundexception


【解决方案1】:

请提供“jps”输出。 因为您的 hbase 似乎无法正常工作,所以希望问题出在 zookeeper 上

【讨论】:

  • root@pc1:/opt/hadoop-2.4.1# jps 3975 NameNode 6331 HQuorumPeer 4421 ResourceManager 4085 DataNode 4528 NodeManager 7186 Jps 6430 HMaster
  • 我可以运行简单的 hbase 作业。我可以创建表格并将项目放入其中
  • 你可以使用mapreduce或直接使用hbase的终端窗口创建表并将项目放入hbase吗?
  • 直接使用java。不是mapreduce
  • 那么我很确定你的hbase没有配置好。请按照任何好的教程来设置hbase。
【解决方案2】:

我遇到了确切的问题。您必须将 hbase 库路径添加到 .bashrc 文件中。将 hbase 中的 lib 文件夹添加到 CLASSPATH。 另外,将 hbase 的类路径添加到 HADOOP_CLASSPATH 中。

您的 .bashrc 文件应包含以下内容:

export HADOOP_CLASSPATH=$HADOOP_CLASSPATH:`${HBASE_HOME}/bin/hbase classpath`
export HADOOP_CLASSPATH=$HADOOP_CLASSPATH:`${HBASE_HOME}/bin/hbase mapredcp`

export CLASSPATH=${HBASE_HOME}/lib/*

注意:CLASSPATH 应该指向你的 hbase 安装文件夹的 lib 文件夹。使用以下代码编译和运行您的 java 代码。

javac Example.java
java -classpath $CLASSPATH:. Example

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2014-02-24
    • 2017-08-12
    • 1970-01-01
    • 2019-03-29
    • 2019-06-26
    • 2012-01-06
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多