错误一:
Error: java.lang.RuntimeException: java.lang.ClassNotFoundException: Class wordCount.wordCount$Map not found
at org.apache.hadoop.conf.Configuration.getClass(Configuration.java:2074)
at org.apache.hadoop.mapreduce.task.JobContextImpl.getMapperClass(JobContextImpl.java:186)
at org.apache.hadoop.mapred.MapTask.runNewMapper(MapTask.java:742)
at org.apache.hadoop.mapred.MapTask.run(MapTask.java:341)
at org.apache.hadoop.mapred.YarnChild$2.run(YarnChild.java:163)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:415)
at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1628)
at org.apache.hadoop.mapred.YarnChild.main(YarnChild.java:158)
Caused by: java.lang.ClassNotFoundException: Class wordCount.wordCount$Map not found
at org.apache.hadoop.conf.Configuration.getClassByName(Configuration.java:1980)
at org.apache.hadoop.conf.Configuration.getClass(Configuration.java:2072)
... 8 more
问题分析:很烦人的一个问题,很久之前就碰见过,后来电脑linux换了一个版本,解决了
解决办法:eclipse添加hadoop配置文件问题,记住只需要在程序目录下新建一个conf的文件夹,把log4j.properties拷贝到该目录下,重启eclipse即可
错误二:
eclipse 运行MR提示无法访问的情况
问题分析:权限不足
解决办法:重新给hdfs文件系统赋予权限(可能会经常遇到这种问题,可执行同一种操作即可)bin/hdfs dfs -chmod -R 777 /
错误三:
HMaster启动之后立即又关闭
问题分析:可能是zookeeper不稳定造成的,
解决办法:停止zookeeper服务(bin/zkServer.sh stop zoo1.cfg bin/zkServer.sh stop zoo2.cfg bin/zkServer.sh stop zoo3.cfg ),再重新启动
错误四:
15/08/23 11:10:07 INFO mapreduce.JobSubmitter: Cleaning up the staging area file:/usr/local/hadoop/tmp/mapred/staging/thinkgamer1735608800/.staging/job_local1735608800_0001
Exception in thread "main" ExitCodeException exitCode=1: chmod: 无法访问"/usr/local/hadoop/tmp/mapred/staging/thinkgamer1735608800/.staging/job_local1735608800_0001": 没有那个文件或目录
问题分析:eclipse的配置文件缺少
解决办法:把配置hadoop时所修改的配置文件全部复制到src文件夹下
错误五:
Exception in thread "main" org.apache.hadoop.mapred.FileAlreadyExistsException: Output directory hdfs://localhost:9000/thinkgamer/output already exists
问题分析:hdfs文件系统中的output文件夹已经存在
解决办法:删除即可(同时还可能出现找不到input目录的问题,此时注意检查input路径)