本文介绍了如何解决java.lang.RuntimeException:PipeMapRed.waitOutputThreads():子进程失败,代码2?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图在Hadoop环境中执行NLTK。



bin / hadoop jar $ HADOOP_HOME / contrib / streaming / hadoop-streaming-1.0.4.jar -input / user / nltk / input / -putput / user / nltk / output1 / -file /home/hduser/softwares/NLTK/unsupervised_sentiment-master.zip -mapper /home/hduser/softwares/NLTK/unsupervised_sentiment-master/sentiment.py



unsupervised_sentiment-master.zip ---包含sentiment.py所需的所有相关文件。



p>

java.lang.RuntimeException:PipeMapRed.waitOutputThreads():子进程失败,代码为2
,位于org.apache.hadoop.streaming.PipeMapRed.waitOutputThreads(PipeMapRed.java :362)
at org.apache.hadoop.streaming.PipeMapRed.mapRedFinished(PipeMapRed.java:576)
at org.apache.hadoop.streaming.PipeMapper.close(PipeMapper.java:135)
at org.apache.hadoop.mapred.MapRunner.run(MapRunner.java:57)
at org.apache.hadoop.streaming.PipeMapRunner.run(PipeMapRunner.java :36)
at org.apache.hadoop.mapred.MapTask.runOldMapper(MapTask.java:436)
at org.apache.hadoop.mapred.MapTask.run(MapTask.java:372)
at org.apache.hadoop.mapred.Child $ 4.run(Child.java:255)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth。 Subject.doAs(Subject.java:415)
at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1121)
at org.apache.hadoop.mapred.Child.main( Child.java:249)



任何帮助都将不胜感激!!! 您可以请求发布python文件吗?我的猜测是,您需要将#!/ usr / bin / python添加到py文件的顶部。当我使用python进行流式传输时就是这种情况。



Best,
Hari


I am trying to execute NLTK in Hadoop environment. Following is the command which i used for execution.

bin/hadoop jar $HADOOP_HOME/contrib/streaming/hadoop-streaming-1.0.4.jar -input /user/nltk/input/ -output /user/nltk/output1/ -file /home/hduser/softwares/NLTK/unsupervised_sentiment-master.zip -mapper /home/hduser/softwares/NLTK/unsupervised_sentiment-master/sentiment.py

unsupervised_sentiment-master.zip --- contains all the dependent files required for sentiment.py

I am getting

java.lang.RuntimeException: PipeMapRed.waitOutputThreads(): subprocess failed with code 2 at org.apache.hadoop.streaming.PipeMapRed.waitOutputThreads(PipeMapRed.java:362) at org.apache.hadoop.streaming.PipeMapRed.mapRedFinished(PipeMapRed.java:576) at org.apache.hadoop.streaming.PipeMapper.close(PipeMapper.java:135) at org.apache.hadoop.mapred.MapRunner.run(MapRunner.java:57) at org.apache.hadoop.streaming.PipeMapRunner.run(PipeMapRunner.java:36) at org.apache.hadoop.mapred.MapTask.runOldMapper(MapTask.java:436) at org.apache.hadoop.mapred.MapTask.run(MapTask.java:372) at org.apache.hadoop.mapred.Child$4.run(Child.java:255) at java.security.AccessController.doPrivileged(Native Method) at javax.security.auth.Subject.doAs(Subject.java:415) at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1121) at org.apache.hadoop.mapred.Child.main(Child.java:249)

Any help would be greatly appreciated!!!

解决方案

Could you pls post the python files? My guess is that, you need to add #!/usr/bin/python to the top of your py file. This was the case when I was streaming using python.

Best,Hari

这篇关于如何解决java.lang.RuntimeException:PipeMapRed.waitOutputThreads():子进程失败,代码2?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-24 04:33