首页> 开发问题 >其它问题 其它问题

心路历程——毕设程序mr跑不通的问题

作者:小萝卜 2019-12-10 浏览 1036

简介这个bug改了实在是太多天了,前前后后折腾了太久,最后多谢@CC学长的帮助,找到了问题,才终于跑通了!!!这里记录一下这个bug我前后改的过程,引以为戒!

这个bug改了实在是太多天了,前前后后折腾了太久,最后多谢@CC学长的帮助,找到了问题,才终于跑通了!!!这里记录一下这个bug我前后改的过程,引以为戒!

 

毕设中需要进行mapreduce进行数据清洗,我把这段代码单独进行编写,运行成功后将内容添加进毕设相对应的部分,结果跑不了了。。。

前后出过的问题有:

hadoop运行报错Wrong FS: hdfs:/, expected: file:///

MapReduce报错:Error: java.io.IOException: Initialization of all the collectors failed. Error in last collector was :interface javax.xml.soap.Text

报错:maven:java.lang.NoClassDefFoundError: org/apache/commons/io/Charsets

HDFS客户端的权限错误:Permission denied

Mapreduce报错:java.lang.ClassNotFoundException: Class Mapper not found

 

到最后,终于不再明确地报错了,转成日志中报错:

Exception from container-launch.
Container id: container_1450161996389_0002_01_000012
Exit code: 1
Stack trace: ExitCodeException exitCode=1: 
    at org.apache.hadoop.util.Shell.runCommand(Shell.java:538)
    at org.apache.hadoop.util.Shell.run(Shell.java:455)
    at org.apache.hadoop.util.Shell$ShellCommandExecutor.execute(Shell.java:715)
    at org.apache.hadoop.yarn.server.nodemanager.DefaultContainerExecutor.launchContainer(DefaultContainerExecutor.java:211)
    at org.apache.hadoop.yarn.server.nodemanager.containermanager.launcher.ContainerLaunch.call(ContainerLaunch.java:302)
    at org.apache.hadoop.yarn.server.nodemanager.containermanager.launcher.ContainerLaunch.call(ContainerLaunch.java:82)
    at java.util.concurrent.FutureTask.run(FutureTask.java:262)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:745)

这个错真心有点恶心了,和你的程序无关,只是告诉你出错了,你实际上就算是查看日志也不一定能从中找到错误原因。

 

学长拿着日志分析了一下,说其中有一步,提到map日志打包提交不上去,应该是jar包虽然打好了但是没能提交的缘故,让我试试直接打好jar包以后在虚拟机上直接运行

hadoop jar (jar包所在)

结果运行不成功,还是报同样的错。

 

我简直mmp了,我之前使用的运行方式都是直接在eclipse上运行,是Windows下配置好hadoop了以后远程连接虚拟机运行的方法,一直都是能成功运行的,但莫名其妙打包放在虚拟机以后就不行了。。。我又试了之前一直能成功跑通而且打包也能跑通的程序,发现还是一样的问题。

学长建议我重装虚拟机,我重装之后把单独拿出来的程序修改地和项目中目录相同,重新打包,最后运行成功!!!!撒花*★,°*:.☆( ̄▽ ̄)/$:*.°★* 。

 

很赞哦! (0)

文章评论

    高端网站建设