分享

HBASE1.2.1使用sqoop导入报错

jyz123456 发表于 2016-9-1 17:01:59 [显示全部楼层] 回帖奖励 阅读模式 关闭右栏 3 9078
hadoop,hbase已经正常启动,访问数据啥的都没有问题,使用sqoop导入的时候报错
导入语句:sqoop import --connect jdbc:mysql://192.168.186.1:3305/hive --username root --password j2yd -m 1 --table message --hbase-create-table --hbase-table message11 --column-family cf --hbase-row-key id
数据库mysql,端口3305
导入0.98版本数据库没问题,导入1.2.1版本数据库报错
报错信息如下(jar的哪些我省略了):
16/09/01 02:26:40 INFO zookeeper.ZooKeeper: Client environment:java.library.path=/usr/local/hadoop/hadoop-2.7.1/lib/native
16/09/01 02:26:40 INFO zookeeper.ZooKeeper: Client environment:java.io.tmpdir=/tmp
16/09/01 02:26:40 INFO zookeeper.ZooKeeper: Client environment:java.compiler=<NA>
16/09/01 02:26:40 INFO zookeeper.ZooKeeper: Client environment:os.name=Linux
16/09/01 02:26:40 INFO zookeeper.ZooKeeper: Client environment:os.arch=amd64
16/09/01 02:26:40 INFO zookeeper.ZooKeeper: Client environment:os.version=2.6.32-431.el6.x86_64
16/09/01 02:26:40 INFO zookeeper.ZooKeeper: Client environment:user.name=root
16/09/01 02:26:40 INFO zookeeper.ZooKeeper: Client environment:user.home=/root
16/09/01 02:26:40 INFO zookeeper.ZooKeeper: Client environment:user.dir=/root
16/09/01 02:26:40 INFO zookeeper.ZooKeeper: Initiating client connection, connectString=localhost:2181 sessionTimeout=90000 watcher=hconnection-0x1edec59c0x0, quorum=localhost:2181, baseZNode=/hbase
16/09/01 02:26:40 INFO zookeeper.ClientCnxn: Opening socket connection to server xuniji1/192.168.186.20:2181. Will not attempt to authenticate using SASL (unknown error)
16/09/01 02:26:40 INFO zookeeper.ClientCnxn: Socket connection established to xuniji1/192.168.186.20:2181, initiating session
16/09/01 02:26:40 INFO zookeeper.ClientCnxn: Session establishment complete on server xuniji1/192.168.186.20:2181, sessionid = 0x156e1d980260007, negotiated timeout = 40000
16/09/01 02:26:41 INFO mapreduce.HBaseImportJob: Creating missing HBase table message111
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:199)
        at org.apache.sqoop.mapreduce.ImportJobBase.runImport(ImportJobBase.java:237)
        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)
[root@xuniji1 ~]#


我专门将1.2.1与0.98xml文件改成一样的配置,现在0.98没问题,1.2.1出现错误,想问问大家有啥解决方法么?或者是1.2.1的导入语句有啥改变?我应该怎么改呢

已有(3)人评论

跳转到指定楼层
jyz123456 发表于 2016-9-1 17:29:07
对了 sqoop版本  1.4.4
回复

使用道具 举报

nextuser 发表于 2016-9-1 17:53:36
jyz123456 发表于 2016-9-1 17:29
对了 sqoop版本  1.4.4

这是版本兼容问题。
楼主可以尝试创建表message11 ,然后在执行下
回复

使用道具 举报

jyz123456 发表于 2016-9-2 08:35:51
感谢回复啊,果然好了,我真的觉得自己够傻了……钻里面出不来了
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

关闭

推荐上一条 /2 下一条