看本文前默认你已经用shell脚本执行sqoop,不会的可以借鉴我另一篇博客 https://blog.csdn.net/weixin_42003671/article/details/88665864
1.参数说明
Job management arguments:
--create Create a new saved job
--delete Delete a saved job
--exec Run a saved job
--help Print usage instructions
--list List saved jobs
--meta-connect Specify JDBC connect string for the
metastore
--show Show the parameters for a saved job
--verbose Print more information while working
bin/sqoop job --create 创建job
bin/sqoop job --list 显示可用的job
bin/sqoop job --show 显示job的详细信息
bin/sqoop job --exec 执行job
bin/sqoop job --delete 删除job
2.创建job
sqoop job \
--create job01_test \
-- \
import \
--connect jdbc:mysql://deptest23:3306/test_data \
--username root \
--password 1q2w3e4r \
--table mysql_stu_info \
--split-by age \
--delete-target-dir \
--hive-drop-import-delims \
--hive-import \
--hive-overwrite \
--hive-database test_data \
--hive-table stu_info \
--fields-terminated-by '\t' \
-m 6
3.显示可用的job
sqoop job --list
1
4.显示job的详细信息(需要输入mysql数据库密码)
sqoop job --show job01_test
1
5.执行job(需要输入mysql数据库密码)
sqoop job --exec job01_test
1
6.删除job
sqoop job --delete job01_test
1
抛出一个问题,如果我想要用crontab自动调用sqoop,不能手动输入密码,怎么办
解决方案详情见 Sqoop Job 应用(二)
https://blog.csdn.net/weixin_42003671/article/details/90019323