2013-05-06 83 views
3

我想在Hadoop環境中執行NLTK。以下是我用於執行的命令。如何解決java.lang.RuntimeException:PipeMapRed.waitOutputThreads():子進程失敗,代碼2?

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 ---包含所有sentiment.py

所需的相關文件

我越來越

了java.lang.RuntimeException:PipeMapRed.waitOutputThreads():在子組織與代碼2 失敗.apache.hadoop.streaming.PipeMapRed.waitOutputThreads(PipeMapRed.java:362) 在org.apache.hadoop.streaming.PipeMapRed.mapRedFinished(PipeMapRed.java:576) 在org.apache.hadoop.streaming.PipeMapper.close (PipeMapper.java:135) 在org.apache.hadoop.mapred.MapRunner.run(MapRunner.java:57) 在org.apache.hadoop.streaming.PipeMapRunner.run(PipeMapRunner.java:36) 在有機.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。運行(Child.java:255) at java.security.AccessController.doPrivileged(Native Method) at javax.security.auth.Subject.doAs(Subject.java:415) at org.apache.hado op.security.UserGroupInformation.doAs(UserGroupInformation.java:1121) at org.apache.hadoop.mapred.Child.main(Child.java:249)

任何幫助將不勝感激!!!

+0

你應該使用HadoopUI中的jobtracker檢查日誌,他們會幫助你 – viper 2013-07-15 16:44:28

回答

8

你能否發佈python文件?我的猜測是,您需要將#!/ usr/bin/python添加到py文件的頂部。當我使用python進行流式傳輸時就是這種情況。

最佳, 哈日

+0

這使我修復了與OP相同的錯誤。 – 2013-11-13 05:18:42

+0

@Harisankar Krishna Swamy我也遇到了這個錯誤,即使我在.py文件的頂部設置了#!/ usr/bin/python。你可以拿我的問題掠奪。我已經給出了場景http:// stackoverflow的描述。COM /問題/ 29791437 /蟒蛇-Hadoop的流錯誤,錯誤流-streamjob在職未成功,一 – MegaBytes 2015-04-23 11:14:33

0

我不能說你的錯誤是什麼,但我是,我在我的Python腳本未解決的依賴。即statsmodels。

2

將下面的代碼行添加到python腳本的頂部使代碼對我有用。 !

#在/ usr/bin中/ Python的

0

在你sentiment.py文件,下面一行添加到頂部:

```

在/ usr /斌/包膜蟒蛇

```

這對我有用。

相關問題