CDH4.3中的Sqoop 1.4.4 incompatibleClassChangeError

时间:2013-08-13 06:49:29

标签: hbase hdfs cloudera sqoop hortonworks-data-platform

Sqoop 1.4.4支持使用复合行键从db导入HBase,而在1.4.4之前,只有db中的一列可用作行键。到目前为止,CDH4.3和HDP1.3都只支持Sqoop 1.4.3。我试图将sqoop 1.4.4交换到我的CDH4.3环境。当我运行一个简单的Sqoop作业时,我得到以下错误:

13/08/12 23:36:14 INFO mapred.JobClient: Cleaning up the staging area hdfs://localhost.localdomain:8020/user/cloudera/.staging/job_201308122236_0001
Exception in thread "main" java.lang.IncompatibleClassChangeError: Found interface org.apache.hadoop.mapreduce.JobContext, but class was expected
    at org.apache.sqoop.mapreduce.DelegatingOutputFormat.checkOutputSpecs(DelegatingOutputFormat.java:63)
    at org.apache.hadoop.mapred.JobClient$2.run(JobClient.java:984)
    at org.apache.hadoop.mapred.JobClient$2.run(JobClient.java:945)
    at java.security.AccessController.doPrivileged(Native Method)
    at javax.security.auth.Subject.doAs(Subject.java:396)
    at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1408)
    at org.apache.hadoop.mapred.JobClient.submitJobInternal(JobClient.java:945)
    at org.apache.hadoop.mapreduce.Job.submit(Job.java:566)
    at org.apache.hadoop.mapreduce.Job.waitForCompletion(Job.java:596)
    at org.apache.sqoop.mapreduce.ImportJobBase.doSubmitJob(ImportJobBase.java:186)
    at org.apache.sqoop.mapreduce.ImportJobBase.runJob(ImportJobBase.java:159)
    at org.apache.sqoop.mapreduce.ImportJobBase.runImport(ImportJobBase.java:239)
    at org.apache.sqoop.manager.SqlManager.importTable(SqlManager.java:600)
    at org.apache.sqoop.manager.MySQLManager.importTable(MySQLManager.java:118)
    at org.apache.sqoop.tool.ImportTool.importTable(ImportTool.java:413)
    at org.apache.sqoop.tool.ImportTool.run(ImportTool.java:502)
    at org.apache.sqoop.Sqoop.run(Sqoop.java:145)
    at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:70)
    at org.apache.sqoop.Sqoop.runSqoop(Sqoop.java:181)
    at org.apache.sqoop.Sqoop.runTool(Sqoop.java:220)
    at org.apache.sqoop.Sqoop.runTool(Sqoop.java:229)
    at org.apache.sqoop.Sqoop.main(Sqoop.java:238)

以前有人这么做过吗?有人能给我一个指针Sqoop 1.4.4与mapreduce,HBase和HDFS的版本兼容吗?

1 个答案:

答案 0 :(得分:3)

Hadoop经历了从Hadoop 1.0到Hadoop 2.0(相应地从CDH3到CDH4)的巨大代码重构。一个副作用是针对Hadoop 1.0(CDH3)编译的代码与Hadoop 2.0(CDH4)不兼容,反之亦然。但是源代码是兼容的,因此只需要使用目标Hadoop分发重新编译代码。

当您在Hadoop 2.0(CDH4)上运行为Hadoop 1.0(CDH3)编译的代码时,异常“找到类X,但预期接口”是非常常见的。

解决方案很简单,您需要同步版本。您必须确保使用为Hadoop发行版编译的二进制工件。 Sqoop使得这很容易,因为目标hadoop分布在工件名称中编码 - 例如sqoop-1.4.4.bin__hadoop-2.0.4-alpha.tar.gz意在用于Hadoop 2.0和CDH4 [1]。 / p>

Jarcec

链接:

1:http://www.apache.org/dist/sqoop/1.4.4/