`
chenchao051
  • 浏览: 135440 次
  • 性别: Icon_minigender_1
  • 来自: 杭州
社区版块
存档分类
最新评论

基于stream的mr程序可能出现的异常(不断更新)

阅读更多

运行:

Jar_path=/home/ppstat/hadoop/contrib/streaming/hadoop-streaming-0.20.203.0.jar
out_put_path=/userstat/cc/check
cd /home/ppstat/hadoop

bin/hadoop fs -test -e $out_put_path
if [ $? -eq 0 ];then
    bin/hadoop fs -rmr $out_put_path
fi

bin/hadoop jar $Jar_path -Dmapred.reduce.tasks=40  -file /home/ppstat/cc/mr/CheckRepeatedRegMapper.py -mapper CheckRepeatedRegMapper.py -file /home/ppstat/cc/mr/CheckRepeatedRegReducer.py -reducer CheckRepeatedRegReducer.py -input /user/ppstat/userlog/logon/2012/09/* -output $out_put_path

 

全是粗心惹的祸,万一以后又不小心随手写错了,来这里看看,帮自己做个记录。

 

1、syntax error:unexpected end of file
文件是否从windows拷到linux?if fi是否结对出现?

 

2、PipeMapRed.waitOutputThreads(): subprocess failed with code 1
很有可能是程序出错,特别检查下是否有下标越界的情况。

python中 if后面 没有冒号(:)也会出现这样的情况

 

3、PipeMapRed.waitOutputThreads(): subprocess failed with code 2
mapper 和 reducer是否都只写了脚本名。此外尝试在程序最上面加上 #!/usr/bin/env python

 

4、出现打开jar错误之类的
请确认变量名是否有缺失 譬如从windows拷到linux 第一行的aaa=bbb很可能就缺失成a=bbb,那下面的$aaa自然也访问不到了

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics