Sqoop HBase导入:java.lang.NoSuchMethodError:org.apache.hadoop.hbase.HTableDescriptor.addFamily

时间:2016-12-13 14:57:14

标签: java mysql hadoop hbase sqoop

我在Ubuntu 14.04上运行Hadoop作为伪分布式集群。我也安装了HBase,一切正常。现在我想使用Sqoop的“import”命令将数据从本地MySql Server导入HBase

  • Hadoop版本:2.7.3
  • HBase版本:1.2.4
  • Sqoop版本:1.4.6(Hadoop 2.0.4-alpha)

Hadoop和HBase正常运行没有问题,但运行命令

./sqoop import --connect jdbc:mysql://localhost:3306/company --table people --username mysqluser -P --hbase-table people_import --column-family peoplecf --hbase-create-table

导致以下错误

Exception in thread "main" java.lang.NoSuchMethodError: org.apache.hadoop.hbase.HTableDescriptor.addFamily(Lorg/apache/hadoop/hbase/HColumnDescriptor;)V
at org.apache.sqoop.mapreduce.HBaseImportJob.jobSetup(HBaseImportJob.java:222)
at org.apache.sqoop.mapreduce.ImportJobBase.runImport(ImportJobBase.java:264)
at org.apache.sqoop.manager.SqlManager.importTable(SqlManager.java:673)
at org.apache.sqoop.manager.MySQLManager.importTable(MySQLManager.java:118)
at org.apache.sqoop.tool.ImportTool.importTable(ImportTool.java:497)
at org.apache.sqoop.tool.ImportTool.run(ImportTool.java:605)
at org.apache.sqoop.Sqoop.run(Sqoop.java:143)
at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:70)
at org.apache.sqoop.Sqoop.runSqoop(Sqoop.java:179)
at org.apache.sqoop.Sqoop.runTool(Sqoop.java:218)
at org.apache.sqoop.Sqoop.runTool(Sqoop.java:227)
at org.apache.sqoop.Sqoop.main(Sqoop.java:236)

有人可以帮帮我吗?

1 个答案:

答案 0 :(得分:0)

Sqoop尚不支持最新版本的Hbase。 最新的Sqoop与Hbase的版本兼容< = 0.95.2,这个hbase-sqoop集成有一个开放的issue (SQOOP-2759)