mysql 建表
create table. student(id int(11),name varchar(255));
insert into student values(1,‘yang’);
hbase 建表
create ‘hbase_student’,‘info’
查看hbase中有哪些表
list
hbase表不存在会自动创建
–hbase-create-table \
无批次
sqoop import
–connect jdbc:mysql://node1:3306/test
–username root
–password root
–table student
–hbase-table hbase_student
–column-family info
–hbase-create-table
–hbase-row-key id
有批次 会先写到hdfs的一个临时目录,在自己进行转移
sqoop import
–connect jdbc:mysql://node1:3306/test
–username root
–password root
–table student
–hbase-table hbase_student_bulk
–column-family info
–hbase-create-table \
–hbase-row-key id
–hbase-bulkload
增量
sqoop import
–connect jdbc:mysql://node1:port/test \
–username username
–password password
–table tablename
–hbase-table namespace:tablename
–column-family columnfamily
–hbase-create-table
–incremental append
–check-column ‘id’
–last-value 0