hadoop - Hadoop Streaming Job在OOzie中不起作用

标签 hadoop oozie hadoop-streaming

我试图编写一个仅包含hadoop流作业的简单 map ,该作业从hdfs读取数据并将其推送到vertica。

我写了如下的shell脚本

./vsql -c "copy $TABLE from stdin delimiter E'\t' direct null '\\N';" -U $DBUSER -w $DBPWD -h $DBHOST -p $DBPORT

我创建了oozie工作流程为:
 <action name="loadToVertica">
        <map-reduce>
                            <job-tracker>${jobTracker}</job-tracker>
                            <name-node>${nameNode}</name-node>
                            <prepare>
                                    <delete path="${nameNode}/user/$USER/output/${exportDataDate}"/>
                            </prepare>
                            <streaming>
                                    <mapper>shell export.sh</mapper>
                            </streaming>
                            <configuration>
                                    <property>
                                            <name>oozie.libpath</name>
                                            <value>${wfsBasePath}/libs</value>
                                    </property>
                                    <property>
                                            <name>mapred.input.dir</name>
                                            <value>${nameNode}/user/$USER$/{exportDataDate}</value>
                                    </property>
                                    <property>
                                            <name>mapred.output.dir</name>
                                            <value>${nameNode}/user/$USER/output/${exportDataDate}</value>
                                    </property>
                                    <property>
                                            <name>mapred.reduce.tasks</name>
                                            <value>0</value>
                                    </property>
                            </configuration>
                            <file>${wfsBasePath}/libs/${STREAMING_JAR_PATH}#${STREAMING_JAR_PATH}</file>
                            <file>${wfsBasePath}/libs/oozie-sharelib-streaming-4.2.0.2.5.3.0-37.jar#oozie-sharelib-streaming-4.2.0.2.5.3.0-37.jar</file>
                            <file>${wfsBasePath}/scripts/export.sh#export.sh</file>
                            <file>${wfsBasePath}/config/vsql#vsql</file>
                    </map-reduce>
            <ok to="end"/>
           <error to="end"/>
        </action>

当我运行此程序时,作业的状态为“失败/杀死”,而没有任何错误消息。

最佳答案

在#!/ bin / sh之后添加-e可以帮助我追踪实际的错误。

在脚本中添加-e选项后,日志中将显示错误代码。

之后,第一行看起来像:

#!/bin/sh -e

关于hadoop - Hadoop Streaming Job在OOzie中不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44491776/

相关文章:

hadoop - 在Kafka中如果参数 "retries"设置为1或更多,那么会自动重试吗?

apache-spark - 使用Spark运行python脚本时出错

python-2.7 - 将 oozie.common.file 导入为文件 ImportError : No module named oozie

Python 和 MapReduce : beyond basics -- how to do more tasks on one database

hadoop - MapReduce:使用 Python[Streaming] 编写序列文件

performance - 使用Hive/Hadoop连接两个排序的文件

hadoop - 关于在Oozie中运行的作业失败

hadoop - 查找从 Oozie 协调器启动的工作流作业的堆栈跟踪

python - Hadoop Streaming with TextInputFormat 和 Python - 跟踪行号

python - hadoop-streaming:作业完成后自动进行后处理吗?