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的导入语句有啥改变?我应该怎么改呢
|