Sqoop导入hbase
Mysql创建表
mysql> create table test.smq_to_hbase select id,name,name grade from test.smq_mysql;mysql> update test.smq_to_hbase set grade = '1';mysql> Alter table test.smq_to_hbase add primary key(id);
Hbase创建表
hbase(main):008:0> create 'smq_hbase','info'
Sqoop导入hbase中
[root@master bin]# sqoop import--connect jdbc:mysql://192.168.220.20:3306/test--username root --password 123456--table smq_to_hbase--hbase-table smq_hbase--column-family info--hbase-row-key id
Sqoop导出hbase
Hbase→hive外部表→hive内部表→通过sqoop→mysql
Mysql创建空表
mysql> create table test.employee(rowkey int(11),id int(11),name varchar(20),primary key (id));
