我想在我的文本文件的一小部分上运行 Hadoop MapReduce。
我的一项任务失败了。我可以在日志中读取:
Processing split: hdfs://localhost:8020/user/martin/history/history.xml:3556769792+67108864
我可以在此文件上从偏移量 3556769792 到 3623878656 (3556769792+67108864) 再次执行 MapReduce 吗?
最佳答案
一种方法是从偏移量定义中复制文件并将其添加回 HDFS。从此时起,只需在该 block 上运行 MapReduce 作业即可。
1) 从偏移量 3556769792 复制文件,后跟 67108864:
dd if=history.xml bs=1 skip=3556769792 count=67108864 > history_offset.xml
2)导入HDFS
hadoop fs -copyFromLocal history_offset.xml offset/history_offset.xml
3)再次运行MapReduce
hadoop jar myJar.jar 'offset' 'offset_output'
关于hadoop - 指定Hadoop进程拆分,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18841786/