Running the Hadoop example for wordcount on Windows using Hadoop 2.6.0

I am new to Hadoop and found out that with version 2.x I can try Hadoop on my local 64-bit Windows 7 machine.
I installed hadoop 2.6.0 and installed cygwin.
I could execute the bin / hadoop version, but when I execute the jar command, I get the following error:
Note. I also placed winutils.jar in the basket, from hadoop-common-2.2.0.jar.
Please, help. I can not get rid of this error. I also entered the input and output parameters, it still does not work.

$ bin/hadoop jar /Hadoop/hadoop-2.6.0/share/hadoop/mapreduce/hadoop-mapreduce-examples-2.6.0.jar wordcount 15/02/03 12:40:45 ERROR util.Shell: 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:355) at org.apache.hadoop.util.Shell.getWinUtilsPath(Shell.java:370) at org.apache.hadoop.util.Shell.<clinit>(Shell.java:363) at org.apache.hadoop.util.GenericOptionsParser.preProcessForWindows (GenericOptionsParser.java:438) at org.apache.hadoop.util.GenericOptionsParser.parseGeneralOptions (GenericOptionsParser.java:484) at org.apache.hadoop.util.GenericOptionsParser.<init> (GenericOptionsParser.java:170) at org.apache.hadoop.util.GenericOptionsParser.<init> (GenericOptionsParser.java:153) at org.apache.hadoop.examples.WordCount.main(WordCount.java:70) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.hadoop.util.ProgramDriver$ProgramDescription.invoke (ProgramDriver.java:71) at org.apache.hadoop.util.ProgramDriver.run(ProgramDriver.java:144) at org.apache.hadoop.examples.ExampleDriver.main(ExampleDriver.java:74) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.hadoop.util.RunJar.run(RunJar.java:221) at org.apache.hadoop.util.RunJar.main(RunJar.java:136) Usage: wordcount <in> [<in>...] <out> 

I could run the following command:

 $ bin/hadoop jar /Hadoop/hadoop-2.6.0/share/hadoop/mapreduce/hadoop-mapreduce-examples-2.6.0.jar 
+1
source share
2 answers

This used to be a problem. However, if you can run the program through a jar, there may be something else through the fault. If you use Java code for you, you can edit the jar to remove the code in which the new exception is generated.

To be sure, check if the bin directory contains winutils.exe and hasoop.dll.

If they are not there, there is a chance that someone else would have encountered a similar problem and saved the files. These files are created when Hadoop is created from the source code in the OS.

0
source

It looks like you installed hasoop 2.6.0 and an earlier version of winoo. You must install getoop winutils of your current hadoop version. Try downloading winutils from this github repo https://github.com/steveloughran/winutils/tree/master/hadoop-2.6.0/bin Finally, replace the bin directory in the winutils bin directory!

0
source

Source: https://habr.com/ru/post/981841/


All Articles