1.运行的时候报错
Exception in thread "main" java.lang.NullPointerException
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1010)
at org.apache.hadoop.util.Shell.runCommand(Shell.java:483)
at org.apache.hadoop.util.Shell.run(Shell.java:456)
at org.apache.hadoop.util.Shell$ShellCommandExecutor.execute(Shell.java:722)
at org.apache.hadoop.util.Shell.execCommand(Shell.java:815)
at org.apache.hadoop.util.Shell.execCommand(Shell.java:798)
at org.apache.hadoop.fs.RawLocalFileSystem.setPermission(RawLocalFileSystem.java:731)
at org.apache.hadoop.fs.RawLocalFileSystem.mkOneDirWithMode(RawLocalFileSystem.java:489)
at org.apache.hadoop.fs.RawLocalFileSystem.mkdirsWithOptionalPermission(RawLocalFileSystem.java:529)
at org.apache.hadoop.fs.RawLocalFileSystem.mkdirs(RawLocalFileSystem.java:507)
at org.apache.hadoop.fs.FilterFileSystem.mkdirs(FilterFileSystem.java:305)
at org.apache.hadoop.mapreduce.JobSubmissionFiles.getStagingDir(JobSubmissionFiles.java:133)
at org.apache.hadoop.mapreduce.JobSubmitter.submitJobInternal(JobSubmitter.java:144)
at org.apache.hadoop.mapreduce.Job$10.run(Job.java:1290)
at org.apache.hadoop.mapreduce.Job$10.run(Job.java:1287)
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:1657)
at org.apache.hadoop.mapreduce.Job.submit(Job.java:1287)
at org.apache.hadoop.mapreduce.Job.waitForCompletion(Job.java:1308)
at com.xiaoskery.hadoop.examples.WordCount.main(WordCount.java:87)
缺少hadoop.dll,把这个文件拷贝到C:WindowsSystem32下面即可。
2.报错
java.io.IOException: Could not locate executable nullinwinutils.exe in the Hadoop binaries.
因为没有设置HADOOP_HOME,在windows上需要重启,或者在代码中设置:System.setProperty("hadoop.home.dir", "E:\Work\hadoop-2.7.2");
3.报错
org.apache.hadoop.security.AccessControlException:Permission denied:user=Administrator,access=WRITE,inode="tmp":root:supergroup:rwxr-xr-x 。
去掉权限校验
修改hdfs-site.xml
<property>
<name>dfs.permissions</name>
<value>false</value>
</property>
4.hadoop eclipse插件
Map/Reduce(V2) master,port对应的是yarn-site.xml中的yarn.resourcemanager.scheduler.address的值
DFS master port对应的是core-site.xml中的fs.defaultFS的值
5.如何运行的时候没有报错信息,但是又不成功
拷贝一个log4j.properties文件到classpath目录,即可看到未输出的错误日志