我在NiFi中创建一个导出工具,将数据从Hive放到Teradata。作为先决条件,我尝试使用CLI中的TDCH实用程序来测试它是否正常工作。给我一些我无法弄清楚的错误。需要额外关注这一点以提供洞察力:
TDCH出口声明:
hadoop jar $USERLIBTDCH com.teradata.connector.common.tool.ConnectorExportTool
-libjars $LIBJARS
-url jdbc:teradata://dns.com/DATABASE=dbName
-username abc
-password abc
-jobtype hcat
-sourcedatabase testing
-sourcetable emp
-nummappers 20
-targettable emp
LIBJARS = hive-metastore-*.jar
hive-exec-*.jar
hive-cli-*.jar
libthrift-*.jar
libfb303-*.jar
jdo2-api-*-ec.jar
slf4j-api-*.jar
datanucleus-core-*.jar
datanucleus-rdbms-*.jar
commons-dbcp-*.jar
commons-pool-*.jar
antlr-runtime-*.jar
datanucleus-api-jdo-*.jar
hcatalog-core-*.jar
和USERLIBTDCH = /usr/lib/tdch/1.5/lib/teradata-connector-1.5.3.jar
我收到的错误:
INFO tool.ConnectorExportTool: java.lang.NoClassDefFoundError: org/apache/hadoop/hive/ql/CommandNeedRetryException
at com.teradata.connector.hcat.processor.HCatInputProcessor.inputPreProcessor(HCatInputProcessor.java:50)
at com.teradata.connector.common.tool.ConnectorJobRunner.runJob(ConnectorJobRunner.java:118)
at com.teradata.connector.common.tool.ConnectorExportTool.run(ConnectorExportTool.java:70)
at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:70)
at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:84)
at com.teradata.connector.common.tool.ConnectorExportTool.main(ConnectorExportTool.java:853)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.hadoop.util.RunJar.run(RunJar.java:221)
at org.apache.hadoop.util.RunJar.main(RunJar.java:136)
Caused by: java.lang.ClassNotFoundException: org.apache.hadoop.hive.ql.CommandNeedRetryException
对于TDCH
,此错误在Google上没有任何帮助。有人有任何指针吗?
答案 0 :(得分:0)
实际上这是因为hadoop设置。我已经显式地设置了HADOOP_CLASSPATH(仅作为Java jar),并且在运行hive时,它需要更多的hadoop jar文件,同样是通过hive配置文件添加。所以我们需要在hadoop-env.sh中设置HADOOP_CLASSPATH,如下所示
{{1}}
<强>参考:强>
https://community.hortonworks.com/questions/47240/hive-install-and-configuration.html