Windows的Hadoop环境问题

来源:4-8 词频统计之本地方式运行

言射

2020-10-03

我服了,搞了一天都没搞好,错还在那里,别人的方法我都试了,环境变量也全配了,就是不行 ,*****

java.io.IOException: Could not locate executable null\bin\winutils.exe in the Hadoop binaries.

D:\Environments\java\bin\java.exe "-javaagent:C:\Program Files\JetBrains\IntelliJ IDEA 2020.1\lib\idea_rt.jar=13755:C:\Program Files\JetBrains\IntelliJ IDEA 2020.1\bin" -Dfile.encoding=UTF-8 -classpath E:\IDEAproject\BigData_01\target\classes;D:\Environments\apache-maven-3.6.3\maven-repo\org\apache\hadoop\hadoop-client\2.6.0-cdh5.15.1\hadoop-client-2.6.0-cdh5.15.1.jar;D:\Environments\apache-maven-3.6.3\maven-repo\org\apache\hadoop\hadoop-common\2.6.0-cdh5.15.1\hadoop-common-2.6.0-cdh5.15.1.jar;D:\Environments\apache-maven-3.6.3\maven-repo\com\google\guava\guava\11.0.2\guava-11.0.2.jar;D:\Environments\apache-maven-3.6.3\maven-repo\commons-cli\commons-cli\1.2\commons-cli-1.2.jar;D:\Environments\apache-maven-3.6.3\maven-repo\org\apache\commons\commons-math3\3.1.1\commons-math3-3.1.1.jar;D:\Environments\apache-maven-3.6.3\maven-repo\xmlenc\xmlenc\0.52\xmlenc-0.52.jar;D:\Environments\apache-maven-3.6.3\maven-repo\commons-httpclient\commons-httpclient\3.1\commons-httpclient-3.1.jar;D:\Environments\apache-maven-3.6.3\maven-repo\commons-codec\commons-codec\1.4\commons-codec-1.4.jar;D:\Environments\apache-maven-3.6.3\maven-repo\commons-io\commons-io\2.4\commons-io-2.4.jar;D:\Environments\apache-maven-3.6.3\maven-repo\commons-net\commons-net\3.1\commons-net-3.1.jar;D:\Environments\apache-maven-3.6.3\maven-repo\commons-collections\commons-collections\3.2.2\commons-collections-3.2.2.jar;D:\Environments\apache-maven-3.6.3\maven-repo\commons-logging\commons-logging\1.1.3\commons-logging-1.1.3.jar;D:\Environments\apache-maven-3.6.3\maven-repo\log4j\log4j\1.2.17\log4j-1.2.17.jar;D:\Environments\apache-maven-3.6.3\maven-repo\commons-lang\commons-lang\2.6\commons-lang-2.6.jar;D:\Environments\apache-maven-3.6.3\maven-repo\commons-configuration\commons-configuration\1.6\commons-configuration-1.6.jar;D:\Environments\apache-maven-3.6.3\maven-repo\commons-digester\commons-digester\1.8\commons-digester-1.8.jar;D:\Environments\apache-maven-3.6.3\maven-repo\commons-beanutils\commons-beanutils\1.7.0\commons-beanutils-1.7.0.jar;D:\Environments\apache-maven-3.6.3\maven-repo\commons-beanutils\commons-beanutils-core\1.8.0\commons-beanutils-core-1.8.0.jar;D:\Environments\apache-maven-3.6.3\maven-repo\org\slf4j\slf4j-api\1.7.5\slf4j-api-1.7.5.jar;D:\Environments\apache-maven-3.6.3\maven-repo\org\slf4j\slf4j-log4j12\1.7.5\slf4j-log4j12-1.7.5.jar;D:\Environments\apache-maven-3.6.3\maven-repo\org\codehaus\jackson\jackson-core-asl\1.8.8\jackson-core-asl-1.8.8.jar;D:\Environments\apache-maven-3.6.3\maven-repo\org\codehaus\jackson\jackson-mapper-asl\1.8.8\jackson-mapper-asl-1.8.8.jar;D:\Environments\apache-maven-3.6.3\maven-repo\org\apache\avro\avro\1.7.6-cdh5.15.1\avro-1.7.6-cdh5.15.1.jar;D:\Environments\apache-maven-3.6.3\maven-repo\com\thoughtworks\paranamer\paranamer\2.3\paranamer-2.3.jar;D:\Environments\apache-maven-3.6.3\maven-repo\org\xerial\snappy\snappy-java\1.0.4.1\snappy-java-1.0.4.1.jar;D:\Environments\apache-maven-3.6.3\maven-repo\com\google\protobuf\protobuf-java\2.5.0\protobuf-java-2.5.0.jar;D:\Environments\apache-maven-3.6.3\maven-repo\com\google\code\gson\gson\2.2.4\gson-2.2.4.jar;D:\Environments\apache-maven-3.6.3\maven-repo\org\apache\hadoop\hadoop-auth\2.6.0-cdh5.15.1\hadoop-auth-2.6.0-cdh5.15.1.jar;D:\Environments\apache-maven-3.6.3\maven-repo\org\apache\httpcomponents\httpclient\4.2.5\httpclient-4.2.5.jar;D:\Environments\apache-maven-3.6.3\maven-repo\org\apache\httpcomponents\httpcore\4.2.4\httpcore-4.2.4.jar;D:\Environments\apache-maven-3.6.3\maven-repo\org\apache\directory\server\apacheds-kerberos-codec\2.0.0-M15\apacheds-kerberos-codec-2.0.0-M15.jar;D:\Environments\apache-maven-3.6.3\maven-repo\org\apache\directory\server\apacheds-i18n\2.0.0-M15\apacheds-i18n-2.0.0-M15.jar;D:\Environments\apache-maven-3.6.3\maven-repo\org\apache\directory\api\api-asn1-api\1.0.0-M20\api-asn1-api-1.0.0-M20.jar;D:\Environments\apache-maven-3.6.3\maven-repo\org\apache\directory\api\api-util\1.0.0-M20\api-util-1.0.0-M20.jar;D:\Environments\apache-maven-3.6.3\maven-repo\org\apache\curator\curator-framework\2.7.1\curator-framework-2.7.1.jar;D:\Environments\apache-maven-3.6.3\maven-repo\org\apache\curator\curator-client\2.7.1\curator-client-2.7.1.jar;D:\Environments\apache-maven-3.6.3\maven-repo\org\apache\curator\curator-recipes\2.7.1\curator-recipes-2.7.1.jar;D:\Environments\apache-maven-3.6.3\maven-repo\com\google\code\findbugs\jsr305\3.0.0\jsr305-3.0.0.jar;D:\Environments\apache-maven-3.6.3\maven-repo\org\apache\htrace\htrace-core4\4.0.1-incubating\htrace-core4-4.0.1-incubating.jar;D:\Environments\apache-maven-3.6.3\maven-repo\org\apache\zookeeper\zookeeper\3.4.5-cdh5.15.1\zookeeper-3.4.5-cdh5.15.1.jar;D:\Environments\apache-maven-3.6.3\maven-repo\org\apache\commons\commons-compress\1.4.1\commons-compress-1.4.1.jar;D:\Environments\apache-maven-3.6.3\maven-repo\org\tukaani\xz\1.0\xz-1.0.jar;D:\Environments\apache-maven-3.6.3\maven-repo\org\apache\hadoop\hadoop-hdfs\2.6.0-cdh5.15.1\hadoop-hdfs-2.6.0-cdh5.15.1.jar;D:\Environments\apache-maven-3.6.3\maven-repo\org\mortbay\jetty\jetty-util\6.1.26.cloudera.4\jetty-util-6.1.26.cloudera.4.jar;D:\Environments\apache-maven-3.6.3\maven-repo\io\netty\netty\3.10.5.Final\netty-3.10.5.Final.jar;D:\Environments\apache-maven-3.6.3\maven-repo\io\netty\netty-all\4.0.23.Final\netty-all-4.0.23.Final.jar;D:\Environments\apache-maven-3.6.3\maven-repo\xerces\xercesImpl\2.9.1\xercesImpl-2.9.1.jar;D:\Environments\apache-maven-3.6.3\maven-repo\xml-apis\xml-apis\1.3.04\xml-apis-1.3.04.jar;D:\Environments\apache-maven-3.6.3\maven-repo\org\fusesource\leveldbjni\leveldbjni-all\1.8\leveldbjni-all-1.8.jar;D:\Environments\apache-maven-3.6.3\maven-repo\org\apache\hadoop\hadoop-mapreduce-client-app\2.6.0-cdh5.15.1\hadoop-mapreduce-client-app-2.6.0-cdh5.15.1.jar;D:\Environments\apache-maven-3.6.3\maven-repo\org\apache\hadoop\hadoop-mapreduce-client-common\2.6.0-cdh5.15.1\hadoop-mapreduce-client-common-2.6.0-cdh5.15.1.jar;D:\Environments\apache-maven-3.6.3\maven-repo\org\apache\hadoop\hadoop-yarn-client\2.6.0-cdh5.15.1\hadoop-yarn-client-2.6.0-cdh5.15.1.jar;D:\Environments\apache-maven-3.6.3\maven-repo\org\apache\hadoop\hadoop-yarn-server-common\2.6.0-cdh5.15.1\hadoop-yarn-server-common-2.6.0-cdh5.15.1.jar;D:\Environments\apache-maven-3.6.3\maven-repo\org\apache\hadoop\hadoop-mapreduce-client-shuffle\2.6.0-cdh5.15.1\hadoop-mapreduce-client-shuffle-2.6.0-cdh5.15.1.jar;D:\Environments\apache-maven-3.6.3\maven-repo\org\apache\hadoop\hadoop-yarn-api\2.6.0-cdh5.15.1\hadoop-yarn-api-2.6.0-cdh5.15.1.jar;D:\Environments\apache-maven-3.6.3\maven-repo\org\apache\hadoop\hadoop-mapreduce-client-core\2.6.0-cdh5.15.1\hadoop-mapreduce-client-core-2.6.0-cdh5.15.1.jar;D:\Environments\apache-maven-3.6.3\maven-repo\org\apache\hadoop\hadoop-yarn-common\2.6.0-cdh5.15.1\hadoop-yarn-common-2.6.0-cdh5.15.1.jar;D:\Environments\apache-maven-3.6.3\maven-repo\javax\xml\bind\jaxb-api\2.2.2\jaxb-api-2.2.2.jar;D:\Environments\apache-maven-3.6.3\maven-repo\javax\xml\stream\stax-api\1.0-2\stax-api-1.0-2.jar;D:\Environments\apache-maven-3.6.3\maven-repo\javax\activation\activation\1.1\activation-1.1.jar;D:\Environments\apache-maven-3.6.3\maven-repo\javax\servlet\servlet-api\2.5\servlet-api-2.5.jar;D:\Environments\apache-maven-3.6.3\maven-repo\com\sun\jersey\jersey-core\1.9\jersey-core-1.9.jar;D:\Environments\apache-maven-3.6.3\maven-repo\com\sun\jersey\jersey-client\1.9\jersey-client-1.9.jar;D:\Environments\apache-maven-3.6.3\maven-repo\org\codehaus\jackson\jackson-jaxrs\1.8.8\jackson-jaxrs-1.8.8.jar;D:\Environments\apache-maven-3.6.3\maven-repo\org\codehaus\jackson\jackson-xc\1.8.8\jackson-xc-1.8.8.jar;D:\Environments\apache-maven-3.6.3\maven-repo\org\apache\hadoop\hadoop-mapreduce-client-jobclient\2.6.0-cdh5.15.1\hadoop-mapreduce-client-jobclient-2.6.0-cdh5.15.1.jar;D:\Environments\apache-maven-3.6.3\maven-repo\org\apache\hadoop\hadoop-aws\2.6.0-cdh5.15.1\hadoop-aws-2.6.0-cdh5.15.1.jar;D:\Environments\apache-maven-3.6.3\maven-repo\com\amazonaws\aws-java-sdk-bundle\1.11.134\aws-java-sdk-bundle-1.11.134.jar;D:\Environments\apache-maven-3.6.3\maven-repo\com\fasterxml\jackson\core\jackson-core\2.2.3\jackson-core-2.2.3.jar;D:\Environments\apache-maven-3.6.3\maven-repo\com\fasterxml\jackson\core\jackson-databind\2.2.3\jackson-databind-2.2.3.jar;D:\Environments\apache-maven-3.6.3\maven-repo\com\fasterxml\jackson\core\jackson-annotations\2.2.3\jackson-annotations-2.2.3.jar;D:\Environments\apache-maven-3.6.3\maven-repo\org\apache\hadoop\hadoop-annotations\2.6.0-cdh5.15.1\hadoop-annotations-2.6.0-cdh5.15.1.jar com.xjc.bigdata.hadoop.MapReducer.WC.WordCountApp
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.apache.hadoop.security.authentication.util.KerberosUtil (file:/D:/Environments/apache-maven-3.6.3/maven-repo/org/apache/hadoop/hadoop-auth/2.6.0-cdh5.15.1/hadoop-auth-2.6.0-cdh5.15.1.jar) to method sun.security.krb5.Config.getInstance()
WARNING: Please consider reporting this to the maintainers of org.apache.hadoop.security.authentication.util.KerberosUtil
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
[ERROR] method:org.apache.hadoop.util.Shell.getWinUtilsPath(Shell.java:425)
Failed to locate the winutils binary in the hadoop binary path
java.io.IOException: Could not locate executable null\bin\winutils.exe in the Hadoop binaries.
	at org.apache.hadoop.util.Shell.getQualifiedBinPath(Shell.java:407)
	at org.apache.hadoop.util.Shell.getWinUtilsPath(Shell.java:422)
	at org.apache.hadoop.util.Shell.<clinit>(Shell.java:415)
	at org.apache.hadoop.util.StringUtils.<clinit>(StringUtils.java:79)
	at org.apache.hadoop.security.Groups.parseStaticMapping(Groups.java:168)
	at org.apache.hadoop.security.Groups.<init>(Groups.java:132)
	at org.apache.hadoop.security.Groups.<init>(Groups.java:100)
	at org.apache.hadoop.security.Groups.getUserToGroupsMappingService(Groups.java:435)
	at org.apache.hadoop.security.UserGroupInformation.initialize(UserGroupInformation.java:341)
	at org.apache.hadoop.security.UserGroupInformation.ensureInitialized(UserGroupInformation.java:308)
	at org.apache.hadoop.security.UserGroupInformation.loginUserFromSubject(UserGroupInformation.java:895)
	at org.apache.hadoop.security.UserGroupInformation.getLoginUser(UserGroupInformation.java:861)
	at org.apache.hadoop.security.UserGroupInformation.getCurrentUser(UserGroupInformation.java:728)
	at org.apache.hadoop.mapreduce.task.JobContextImpl.<init>(JobContextImpl.java:72)
	at org.apache.hadoop.mapreduce.Job.<init>(Job.java:145)
	at org.apache.hadoop.mapreduce.Job.getInstance(Job.java:188)
	at com.xjc.bigdata.hadoop.MapReducer.WC.WordCountApp.main(WordCountApp.java:37)
[INFO ] method:org.apache.hadoop.conf.Configuration.warnOnceIfDeprecated(Configuration.java:1274)
session.id is deprecated. Instead, use dfs.metrics.session-id
[INFO ] method:org.apache.hadoop.metrics.jvm.JvmMetrics.init(JvmMetrics.java:76)
Initializing JVM Metrics with processName=JobTracker, sessionId=
[WARN ] method:org.apache.hadoop.mapreduce.JobResourceUploader.uploadFiles(JobResourceUploader.java:64)
Hadoop command-line option parsing not performed. Implement the Tool interface and execute your application with ToolRunner to remedy this.
[WARN ] method:org.apache.hadoop.mapreduce.JobResourceUploader.uploadFiles(JobResourceUploader.java:171)
No job jar file set.  User classes may not be found. See Job or Job#setJar(String).
[INFO ] method:org.apache.hadoop.mapreduce.lib.input.FileInputFormat.listStatus(FileInputFormat.java:283)
Total input paths to process : 1
[INFO ] method:org.apache.hadoop.mapreduce.JobSubmitter.submitJobInternal(JobSubmitter.java:202)
number of splits:1
[INFO ] method:org.apache.hadoop.mapreduce.JobSubmitter.printTokens(JobSubmitter.java:291)
Submitting tokens for job: job_local1546087953_0001
[INFO ] method:org.apache.hadoop.mapreduce.Job.submit(Job.java:1311)
The url to track the job: http://localhost:8080/
[INFO ] method:org.apache.hadoop.mapreduce.Job.monitorAndPrintJob(Job.java:1356)
Running job: job_local1546087953_0001
[INFO ] method:org.apache.hadoop.mapred.LocalJobRunner$Job.createOutputCommitter(LocalJobRunner.java:498)
OutputCommitter set in config null
[INFO ] method:org.apache.hadoop.mapreduce.lib.output.FileOutputCommitter.<init>(FileOutputCommitter.java:124)
File Output Committer Algorithm version is 1
[INFO ] method:org.apache.hadoop.mapreduce.lib.output.FileOutputCommitter.<init>(FileOutputCommitter.java:139)
FileOutputCommitter skip cleanup _temporary folders under output directory:false, ignore cleanup failures: false
[INFO ] method:org.apache.hadoop.mapred.LocalJobRunner$Job.createOutputCommitter(LocalJobRunner.java:516)
OutputCommitter is org.apache.hadoop.mapreduce.lib.output.FileOutputCommitter
[INFO ] method:org.apache.hadoop.mapred.LocalJobRunner$Job.runTasks(LocalJobRunner.java:475)
Waiting for map tasks
[INFO ] method:org.apache.hadoop.mapred.LocalJobRunner$Job$MapTaskRunnable.run(LocalJobRunner.java:251)
Starting task: attempt_local1546087953_0001_m_000000_0
[INFO ] method:org.apache.hadoop.mapreduce.lib.output.FileOutputCommitter.<init>(FileOutputCommitter.java:124)
File Output Committer Algorithm version is 1
[INFO ] method:org.apache.hadoop.mapreduce.lib.output.FileOutputCommitter.<init>(FileOutputCommitter.java:139)
FileOutputCommitter skip cleanup _temporary folders under output directory:false, ignore cleanup failures: false
[INFO ] method:org.apache.hadoop.yarn.util.ProcfsBasedProcessTree.isAvailable(ProcfsBasedProcessTree.java:190)
ProcfsBasedProcessTree currently is supported only on Linux.
[INFO ] method:org.apache.hadoop.mapred.LocalJobRunner$Job.runTasks(LocalJobRunner.java:483)
map task executor complete.
[WARN ] method:org.apache.hadoop.mapred.LocalJobRunner$Job.run(LocalJobRunner.java:587)
job_local1546087953_0001
java.lang.Exception: java.lang.NullPointerException
	at org.apache.hadoop.mapred.LocalJobRunner$Job.runTasks(LocalJobRunner.java:489)
	at org.apache.hadoop.mapred.LocalJobRunner$Job.run(LocalJobRunner.java:549)
Caused by: java.lang.NullPointerException
	at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1090)
	at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1071)
	at org.apache.hadoop.util.Shell.runCommand(Shell.java:548)
	at org.apache.hadoop.util.Shell.run(Shell.java:507)
	at org.apache.hadoop.util.Shell$ShellCommandExecutor.execute(Shell.java:789)
	at org.apache.hadoop.yarn.util.WindowsBasedProcessTree.isAvailable(WindowsBasedProcessTree.java:57)
	at org.apache.hadoop.yarn.util.ResourceCalculatorProcessTree.getResourceCalculatorProcessTree(ResourceCalculatorProcessTree.java:233)
	at org.apache.hadoop.mapred.Task.initialize(Task.java:629)
	at org.apache.hadoop.mapred.MapTask.run(MapTask.java:324)
	at org.apache.hadoop.mapred.LocalJobRunner$Job$MapTaskRunnable.run(LocalJobRunner.java:270)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.lang.Thread.run(Thread.java:830)
[INFO ] method:org.apache.hadoop.mapreduce.Job.monitorAndPrintJob(Job.java:1377)
Job job_local1546087953_0001 running in uber mode : false
[INFO ] method:org.apache.hadoop.mapreduce.Job.monitorAndPrintJob(Job.java:1384)
 map 0% reduce 0%
[INFO ] method:org.apache.hadoop.mapreduce.Job.monitorAndPrintJob(Job.java:1397)
Job job_local1546087953_0001 failed with state FAILED due to: NA
[INFO ] method:org.apache.hadoop.mapreduce.Job.monitorAndPrintJob(Job.java:1402)
Counters: 0

Process finished with exit code -1


写回答

1回答

Michael_PK

2020-10-03

Windows开发MapReduce常见问题


    常见错误一:

        异常信息:

            java.io.IOException: Could not locate executable null\bin\winutils.exe in the Hadoop binaries

            java.lang.UnsatisfiedLinkError: org.apache.hadoop.io.nativeio.NativeIO$Windows.access0(Ljava/lang/String;I)Z


        解决方案:

            1)下载winutils.exe和hadoop.dll,添加到HADOOP_HOME,并添加到PATH中 (注意Hadoop版本):https://github.com/steveloughran/winutils/tree/master/hadoop-2.7.1/bin

            2)放这两个在%HADOOP_HOME%\bin下,同时hadoop.dll也放在C:\Windows\System32目录下


0
9
言射
回复
慕码人9174122
对,用3. 0的换掉2.6.0的bin,然后配置好系统环境变量
2020-12-21
共9条回复

Hadoop 系统入门+核心精讲

从Hadoop核心技术入手,掌握数据处理中ETL应用,轻松进军大数据

2397 学习 · 902 问题

查看课程