使用Hue通过Shell脚本在oozie中调度sqoop作业

我可以使用Hue在Oozie中运行sqoop命令 . 但是,当我尝试通过将它放在shell脚本中运行相同的sqoop命令时,我收到如下错误

Stdoutput 2016-05-20 10:52:13,241 ERROR [main] sqoop.Sqoop (Sqoop.java:runSqoop(181)) - Got exception running Sqoop: 

java.lang.RuntimeException: Could not load db driver class: oracle.jdbc.OracleDriver

我直接运行sqoop命令就像我一样包含了jdbc jar文件 . 我不明白为什么它不适用于shell脚本 .

这是Hue生成的工作流程

<workflow-app name="My_Workflow" xmlns="uri:oozie:workflow:0.5">
    <start to="shell-ca31"/>
    <kill name="Kill">
        <message>Action failed, error message[${wf:errorMessage(wf:lastErrorNode())}]</message>
    </kill>
    <action name="shell-ca31">
        <shell xmlns="uri:oozie:shell-action:0.1">
            <job-tracker>${jobTracker}</job-tracker>
            <name-node>${nameNode}</name-node>
            <configuration>
                <property>
                    <name>mapred.job.queue.name</name>
                    <value>default</value>
                </property>
                <property>
                    <name>oozie.use.system.libpath</name>
                    <value>true</value>
                </property>
                <property>
                    <name>oozie.libpath</name>
                    <value>/user/oozie/libext</value>
                </property>
            </configuration>
            <exec>sqoopoozie.sh</exec>
            <file>/user/yxr6907/sqoopoozie.sh#sqoopoozie.sh</file>
            <archive>/user/oozie/libext/ojdbc7.jar#ojdbc7.jar</archive>
              <capture-output/>
        </shell>
        <ok to="End"/>
        <error to="Kill"/>
    </action>
    <end name="End"/>
</workflow-app>

回答(0)