我已经配置了Hadoop集群。使用以下代码运行mapreduce程序时,im有两台机器MA和MB
hadoop jar /HDP/hadoop-1.2.0.1.3.0.0-0380/contrib/streaming/hadoop-streaming-1.2.0.1.3.0.0-0380.jar -mapper "python C:\Python33\mapper.py" -reducer "python C:\Python33\redu.py" -input "/user/XXXX/input/input.txt" -output "/user/XXXX/output/out20131112_09"其中: mapper - C:\Python33\mapper.py和减速器C:\Python33\redu.py在MB的本地磁盘中
更新

最后,我找到了错误。
MA-错误日志
stderr logs
python: can't open file 'C:\Python33\mapper.py': [Errno 2] No such file or directory
java.lang.RuntimeException: PipeMapRed.waitOutputThreads(): subprocess failed with code 2映射器- C:\Python33\mapper.py和还原剂C:\Python33\redu.py在MA的本地磁盘中,而不是在MB中。
现在,我是否需要将我的m/r程序复制到MA,或者如何解决这个问题?
Mapper
import sys
for line in sys.stdin:
line = line.strip()
keys = line.split()
for key in keys:
value = 1
print( '%s \t %d' % (key, value))发布于 2013-11-12 13:01:02
如果映射输入文件小于dfs.block.size,那么每个作业只运行一个任务。对于较小的输入,可以强制Hadoop以字节为单位运行多个任务( mapred.max.split.size值小于dfs.block.size )。
https://stackoverflow.com/questions/19928671
复制相似问题