python hadoop streaming,Python Hadoop Streaming Error“错误streaming.StreamJob:作业不成功!”和堆栈跟踪:ExitCodeExc...

I am trying to run python script on Hadoop cluster using Hadoop Streaming for sentiment analysis.

The Same script I am running on Local machine which is running Properly and giving output.

to run on local machine I use this command.

$ cat /home/MB/analytics/Data/input/* | ./new_mapper.py

and to run on hadoop cluster I use below command

$ hadoop jar /usr/lib/hadoop-0.20-mapreduce/contrib/streaming/hadoop-streaming-2.5.0-mr1-cdh5.2.0.jar -mapper "python $PWD/new_mapper.py" -reducer "$PWD/new_reducer.py" -input /user/hduser/Test_04012015_Data/input/* -output /user/hduser/python-mr/out-mr-out

The Sample code of my script is

#!/usr/bin/env python

import sys

def main(argv):

## for line in sys.stdin:

## print line

for line in sys.stdin:

line = line.split(',')

t_text = re.sub(r'[?|$|.|!|,|!|?|;]',r'',line[7])

words = re.findall(r"[\w']+", t_text.rstrip())

predicted = classifier.classify(feature_select(words))

i=i+1

referenceSets[predicted].add(i)

testSets[predicted].add(i)

print line[7] +'\t'+predicted

if __name__ == "__main__":

main(sys.argv)

The stack trace of Exception is:

15/04/22 12:55:14 INFO mapreduce.Job: Task Id : attempt_1429611942931_0010_m_000001_0, Status : FAILED

Error: java.io.IOException: Stream closed at java.lang.ProcessBuilder$NullOutputStream.write(ProcessBuilder.java:434)

...

Exit code: 134

Exception message: /bin/bash: line 1: 1691 Aborted

(core dumped) /usr/lib/jvm/java-7-oracle-cloudera/bin/java

-Djava.net.preferIPv4Stack=true -Dhadoop.metrics.log.level=WARN -Djava.net.preferIPv4Stack=true -Xmx525955249

-Djava.io.tmpdir=/yarn/nm/usercache/hduser/appcache/application_1429611942931_0010/container_1429611942931_0010_01_000016/tmp

-Dlog4j.configuration=container-log4j.properties

-Dyarn.app.container.log.dir=/var/log/hadoop-yarn/container/application_1429611942931_0010/container_1429611942931_0010_01_000016 -Dyarn.app.container.log.filesize=0

-Dhadoop.root.logger=INFO,CLA org.apache.hadoop.mapred.YarnChild 192.168.0.122 48725 attempt_1429611942931_0010_m_000006_1 16 > /var/log/hadoop-yarn/container/application_1429611942931_0010/container_1429611942931_0010_01_000016/stdout 2> /var/log/hadoop-yarn/container/application_1429611942931_0010/container_1429611942931_0010_01_000016/stderr

....

15/04/22 12:55:47 ERROR streaming.StreamJob: Job not Successful!

Streaming Command Failed!

I tried to see logs but in hue it shows me this error.

94db6d0624e409cf859daba101d52469.png

Please suggest me, what is going wrong.

解决方案

It looks like you forgot to add the file new_mapper.py to your job.

Basically, your job tries to run the python script new_mapper.py, but this script is missing on the server running your mapper.

You must add this file to your job, using the option -file .

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值