百度云链接:https://pan.baidu.com/s/1Zu8yos3mTzA2A17Pqycxkw
提取码:is4k
[root@Master sqoop-1.4.7.bin__hadoop-2.6.0]# bin/sqoop job --create job_pms_store -- import --connect jdbc:mysql://Master:3306/anxin_oa?useSSL=false --table pms_store --username mysql_name -P --hive-import --hive-table bigdata.pms_store --hive-overwrite --fields-terminated-by '\t'
sqoop创建job任务输入密码之后出现
19/07/29 08:33:40 INFO sqoop.Sqoop: Running Sqoop version: 1.4.7
Enter password:
Exception in thread "main" java.lang.NoClassDefFoundError: org/json/JSONObject
at org.apache.sqoop.util.SqoopJsonUtil.getJsonStringforMap(SqoopJsonUtil.java:43)
at org.apache.sqoop.SqoopOptions.writeProperties(SqoopOptions.java:785)
at org.apache.sqoop.metastore.hsqldb.HsqldbJobStorage.createInternal(HsqldbJobStorage.java:399)
at org.apache.sqoop.metastore.hsqldb.HsqldbJobStorage.create(HsqldbJobStorage.java:379)
at org.apache.sqoop.tool.JobTool.createJob(JobTool.java:181)
at org.apache.sqoop.tool.JobTool.run(JobTool.java:294)
at org.apache.sqoop.Sqoop.run(Sqoop.java:147)
at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:70)
at org.apache.sqoop.Sqoop.runSqoop(Sqoop.java:183)
at org.apache.sqoop.Sqoop.runTool(Sqoop.java:234)
at org.apache.sqoop.Sqoop.runTool(Sqoop.java:243)
at org.apache.sqoop.Sqoop.main(Sqoop.java:252)
Caused by: java.lang.ClassNotFoundException: org.json.JSONObject
at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 12 more
是因为sqoop的lib目录下缺少java-json.jar,放进去
jar包网盘链接有!
从新创建sqoop job
19/07/29 08:57:37 INFO sqoop.Sqoop: Running Sqoop version: 1.4.7
Enter password:
[root@Master sqoop-1.4.7.bin__hadoop-2.6.0]#
[root@Master sqoop-1.4.7.bin__hadoop-2.6.0]# sqoop job --list
查看job列表
创建成功!