我正在尝试使用Apache oozie创建一个sqoop工作流,但是当我执行脚本时,出现以下错误:
Caused by: com.sun.org.apache.xml.internal.serializer.utils.WrappedRuntimeException: Could not load the propery file 'output_xml.properties' for output method 'xml' (check CLASSPATH)
当我检查日志时,它说错误是由引起的:
Caused by:com.sun.org.apache.xml.internal.serializer.utils.WrappedRuntimeException: Could not load the propery file 'output_xml.properties' for output method 'xml' (check CLASSPATH)
Workflow.xml
<?xml version="1.0" encoding="UTF-8"?>
<workflow-app xmlns="uri:oozie:workflow:0.2" name="sqoop-wf">
<start to="sqoop-node" />
<action name="sqoop-node">
<sqoop xmlns="uri:oozie:sqoop-action:0.2">
<job-tracker>${jobTracker}</job-tracker>
<name-node>${nameNode}</name-node>
<job-xml>sqoop-site.xml</job-xml>
<configuration>
<property>
<name>mapred.compress.map.output</name>
<value>true</value>
</property>
<property>
<name>mapred.job.queue.name</name>
<value>${queueName}</value>
</property>
</configuration>
<command>import --libjars /usr/lib/sqoop/mysql-connector-java-5.1.30-bin.jar --driver com.mysql.jdbc.Driver --connect "jdbc:mysql://mydatabase_Name.rds.amazonaws.com:3306/DB_NAME" --username NAGESHC --password nagesh@1234 --table TABLE_FIN --target-dir /user/hive/ooziesqoop -m 1 </command>
<file>/usr/lib/sqoop/mysql-connector-java-5.1.30-bin.jar</file>
</sqoop>
<ok to="end"/>
<error to="fail"/>
</action>
<kill name="fail">
<message>Sqoop failed, error message[${wf:errorMessage(wf:lastErrorNode())}]</message>
</kill>
<end name="success"/>
Job.properties
nameNode=hdfs://ip-xxxxxxxxxxx.compute.internal:8020
jobTracker=ip-xxxxxxxxxxx.compute.internal:8032
queueName=default
oozie.wf.application.path=hdfs://ip-xxxxxxxxxxx.compute.internal:8020/user/oozie/workflow.xml
outputDir=distcp
oozie.use.system.libpath=true
oozie.libpath=${nameNode}/user/oozie/
我正在使用以下命令执行脚本:
oozie job -oozie http://ip-xxxxxxxxxxx.compute.internal:11000/oozie -config /home/job.properties -submit
我猜它与CLASSPATH有关吗?
答案 0 :(得分:1)
您是否已使用验证器工具检查过您的工作流程.xml? 如果您致电使用Hadoop(cloudera或hortonwork)的地方,将会很有帮助。
$ oozie validate myApp/workflow.xml
默认情况下必须安装mysql驱动程序,而无需指定它。或者可以在sqoop / lib文件夹中将其设置为可用,因此sqoop将自动使用它。或者,您可以首先检查您的sqoop命令在集群计算机中是否正确运行。如果运行,则可能是xml配置问题。
sqoop import --libjars /usr/lib/sqoop/mysql-connector-java-5.1.30-bin.jar --driver com.mysql.jdbc.Driver --connect "jdbc:mysql://Database_Hostname:xxxx/DB_name" --username xxxx --password nxxxx@xxxx --table table_Name --target-dir /user/hive/ooziesqoop -m 1