uttam palkar
uttam palkar

Reputation: 1655

How to export Hbase table to MySql table

I am trying exporting Hbase table to mysql table using sqoop.

Following is my query:

> sqoop-export 
> --connect jdbc:mysql://mysqlserver_ip:3306/mysqldb 
> --username user 
> --password pwd 
> --table mysqltbl 
> --update-key empid 
> --export-dir hostname:60030/hbase/tblfromhbase

where hostname:60030 is my Hbase root dir path and port.

error coming to me are

> 1) ERROR security.UserGroupInformation: PriviledgedActionException
> as:hbase (auth:SIMPLE) cause:java.io.IOException:Failed on local
> exception: com.google.protobuf.InvalidProtocolBufferException:Protocol
> message end-group tag did not match expected tag.; Host Details :
> local host is: "hostname/ip";destination host is: "hostname":60030;
> 
> 2) ERROR tool.ExportTool: Encountered IOException running export job:
> java.io.IOException: Failed on local exception:
> com.google.protobuf.InvalidProtocolBufferException:Protocol message
> end-group tag did not match expected tag.; Host Details :local host
> is: "hostname/ip"; destination host is: "hostname":60030;

Thanks in advance.

Upvotes: 1

Views: 3327

Answers (2)

Jarek Jarcec Cecho
Jarek Jarcec Cecho

Reputation: 1726

I'm afraid that Sqoop do not support exports directly from HBase at the moment. You can overcome this by firstly using mapreduce to export data from HDFS to normal files and subsequently calling Sqoop to export them to MySQL.

You can find additional information in question 12911042.

Upvotes: 1

lulyon
lulyon

Reputation: 7235

Exporting mysql table to hbase with sqoop is handy, but Exporting hbase table to mysql is not. This is an indirect way. Exporting hbase table to hive, create hive table, then dump to sql file, and import to mysql. Check it out: http://blog.csdn.net/zreodown/article/details/8850172

Upvotes: 0

Related Questions