Hadoop 在hbase中导入导出表时未找到文件获取异常

Hadoop 在hbase中导入导出表时未找到文件获取异常,hadoop,hbase,Hadoop,Hbase,我正在运行此命令“hbase org.apache.hadoop.hbase.mapreduce.Driver export'temp'/dump” 但我遇到了一个异常,实际上我必须导出表并导入到不同的数据库中 2016-06-15 17:56:49,365 WARN [main] util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes

我正在运行此命令“hbase org.apache.hadoop.hbase.mapreduce.Driver export'temp'/dump” 但我遇到了一个异常,实际上我必须导出表并导入到不同的数据库中

2016-06-15 17:56:49,365 WARN  [main] util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
2016-06-15 17:56:49,463 INFO  [main] mapreduce.Export: versions=1, starttime=0, endtime=9223372036854775807, keepDeletedCells=false
2016-06-15 17:56:49,745 WARN  [main] mapreduce.TableMapReduceUtil: The hbase-prefix-tree module jar containing PrefixTreeCodec is not present.  Continuing without it.
2016-06-15 17:56:50,058 INFO  [main] Configuration.deprecation: session.id is deprecated. Instead, use dfs.metrics.session-id
2016-06-15 17:56:50,058 INFO  [main] jvm.JvmMetrics: Initializing JVM Metrics with processName=JobTracker, sessionId=
2016-06-15 17:56:50,289 INFO  [main] mapreduce.JobSubmitter: Cleaning up the staging area file:/app/hadoop/tmp/mapred/staging/abhay1268840199/.staging/job_local1268840199_0001
Exception in thread "main" java.lang.reflect.InvocationTargetException
    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.hbase.mapreduce.Driver.main(Driver.java:61)
Caused by: java.io.FileNotFoundException: File does not exist: hdfs://localhost:54310/usr/local/hbase/lib/zookeeper-3.4.6.jar
    at org.apache.hadoop.hdfs.DistributedFileSystem$17.doCall(DistributedFileSystem.java:1072)
    at org.apache.hadoop.hdfs.DistributedFileSystem$17.doCall(DistributedFileSystem.java:1064)
    at org.apache.hadoop.fs.FileSystemLinkResolver.resolve(FileSystemLinkResolver.java:81)
    at org.apache.hadoop.hdfs.DistributedFileSystem.getFileStatus(DistributedFileSystem.java:1064)
    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:1614)
    at org.apache.hadoop.mapreduce.Job.submit(Job.java:1282)
    at org.apache.hadoop.mapreduce.Job.waitForCompletion(Job.java:1303)
    at org.apache.hadoop.hbase.mapreduce.Export.main(Export.java:188)
    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.ProgramDriver$ProgramDescription.invoke(ProgramDriver.java:72)
    at org.apache.hadoop.util.ProgramDriver.run(ProgramDriver.java:145)
    at org.apache.hadoop.util.ProgramDriver.driver(ProgramDriver.java:153)
    ... 5 more

我知道这绝对是常见的环境问题。请先尝试导出类路径,然后尝试运行export命令

export HADOOP_CLASSPATH=`hadoop classpath`:`hbase classpath`
java -cp "$HADOOP_CLASSPATH/*"
第二个命令java-cp(用于调试)将扩展类路径中的每个jar文件,以查看缺少的jar是否存在于该列表中


另一个快速解决方案(不是最好的,但目前是这样):复制jarhdfs://localhost:54310/usr/local/hbase/lib/zookeeper-3.4.6.jar到该位置。

您可以尝试从集群的不同节点运行吗?我认为它的类路径问题?我收到了这个消息,但我尝试从解决问题的集群的不同节点运行。您好,谢谢您的回复,但我已经检查了/usr/local/hbase/lib/文件夹那里已经有可用的jar。您检查了吗hdfs://localhost:54310/usr/local/hbase/lib/zookeeper-3.4.6.jarHii很抱歉,我对hadoop和hbase还不熟悉,那么你能告诉我我需要检查哪条路径吗???你能试试hadoop fs-ls吗hdfs://localhost:54310/usr/local/hbase/lib/ 并将结果粘贴到此处16/06/16 11:36:09警告util.NativeCodeLoader:无法为您的平台加载本机hadoop库。。。在适用的情况下使用内置java类:`hdfs://localhost:54310/usr/local/hbase/lib/':没有这样的文件或目录