hbase importtsv未在cloudera中运行

ma8fv8wu  于 2021-05-30  发布在  Hadoop
关注(0)|答案(1)|浏览(424)

当我尝试将一个csv文件从hdfs导入hbase时,我尝试使用importtsv工具,使用以下命令:

sudo -u cloudera hadoop jar /opt/cloudera/parcels/CDH-5.0.2-1.cdh5.0.2.p0.13/lib/hbase/hbase-server-0.96.1.1-cdh5.0.2.jar importtsv ...

不过,我有个例外:

Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/hadoop/hbase/filter/Filter
    at java.lang.Class.getDeclaredMethods0(Native Method)
    at java.lang.Class.privateGetDeclaredMethods(Class.java:2531)
    at java.lang.Class.getMethod0(Class.java:2774)
    at java.lang.Class.getMethod(Class.java:1663)
    at org.apache.hadoop.util.ProgramDriver$ProgramDescription.<init>(ProgramDriver.java:60)
    at org.apache.hadoop.util.ProgramDriver.addClass(ProgramDriver.java:103)
    at org.apache.hadoop.hbase.mapreduce.Driver.main(Driver.java:39)
    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)
Caused by: java.lang.ClassNotFoundException: org.apache.hadoop.hbase.filter.Filter
    at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
    ... 12 more

有人知道这些问题吗?是因为cloudera的新版cdh5吗?

6l7fqoea

6l7fqoea1#

尝试直接使用hbase jar运行它,如下所示:
hbase org.apache.hadoop.hbase.mapreduce.importtsv-dimporttsv.skip.bad.lines=true-dimporttsv.columns=“$columns”$table\u name$文件
(如果hbase不在类路径中,请为其添加完整路径)
我也在使用cdh5,它对我很好

相关问题