Sqoop Import命令抛出错误,但它正在终端上工作



下面的命令在终端上运行良好,但当我从Oozie中导出它时,它抛出了错误。

bash
sqoop import --connect jdbc:mysql://172.16.16.128:3306/employees -- username=hive --password=hive --driver com.mysql.jdbc.Driver --query 'select * from employee.testtable where 1=1 AND $CONDITIONS' --m 1 --target-dir '/user/hive/warehouse/test.db/testtable' --hive-import --hive-table test.testtable --hive-drop-import-delims --hive-overwrite --hs2-url jdbc:hive2://hivehostname:10000/default;

ERROR sqoop.Sqoop: Got exception running Sqoop: java.lang.RuntimeException: Could not load db driver class: org.apache.hive.jdbc.HiveDriver java.lang.RuntimeException: Could not load db driver class: org.apache.hive.jdbc.HiveDriver

我已经将hive-jdbc驱动程序放在hadoop/lib、sqoop/lib和hive/lib目录中。有时它运行得很完美,但有时会出错。

我无法识别系统的行为,因为已经放置了hive jdbc jar。为什么它会这样。请帮帮我。

我下载了下面的jar,并将所有节点推送到sqoop Lib位置,然后问题得到了解决。

蜂箱公用-.jarhive exec-.jarhive-service.jar

cd /usr/hdp/3.0.1.0-187/sqoop/lib
chmod 775 /usr/hdp/current/hive-client/lib/hive-common-*.jar 
chmod 775 /usr/hdp/current/hive-client/lib/hive-exec-*.jar 
chmod 775 /usr/hdp/current/hive-client/lib/hive-service.jar 

最新更新