1.sqoop創(chuàng)建hive表結(jié)構(gòu)以及同步數(shù)據(jù)
命令 創(chuàng)建hive 表結(jié)構(gòu)
/export/servers/sqoop/bin/sqoop create-hive-table \
--connect jdbc:mysql://192.168.1.140:3306/tags_dat \
--table tbl_users \
--username root \
--password 123456 \
--hive-table tags_dat.tbl_users \
--fields-terminated-by '\t' \
--lines-terminated-by '\n'
- 通過sqoop 導(dǎo)數(shù)據(jù)
/export/servers/sqoop/bin/sqoop import \
--connect jdbc:mysql://192.168.1.140:3306/tags_dat \
--username root \
--password 123456 \
--table tbl_users \
--direct \
--hive-overwrite \
--delete-target-dir \
--fields-terminated-by '\t' \
--lines-terminated-by '\n' \
--hive-table tags_dat.tbl_users \
--hive-import \
--num-mappers 1