Tuesday, November 11, 2014

Run a sqoop job from an Oozie workflow action (could not load db driver class)

When running a Sqoop job via an Oozie task, I got the following errors:


WARN org.apache.sqoop.tool.SqoopTool – $SQOOP_CONF_DIR has not been set in the environment. Cannot check for additional configuration.


ERROR org.apache.sqoop.Sqoop – Got exception running Sqoop: java.lang.RuntimeException: Could not load db driver class: com.mysql.jdbc.Driver


These were because the mysql connector jdbc driver was not in the Oozie sharelibs folder in HDFS. hdfs://user/share/lib/lib_20141030223533. Note you need to restart the Oozie service in the cluster in order for the driver to get picked up. The Cloudera docs seem to say you don’t have to restart Oozie, but I’ve tested it out and I have to restart Oozie from Cloudera Manager.


If you delete one of the jars from the sharelib and run an Oozie job that somehow depends on that jar, you get insta-failed ;)





No comments:

Post a Comment