简体   繁体   中英

Running Hadoop Pi Example

I need some help running Hadoop Pi example in Windows. I have sucecssfully setup Hadoop on Windows and can see all NameNode, SecondaryNameNode, JobTracker and TaskTracker running. I can also hit urls:

http://localhost:50070/, http://localhost:50030 and http://localhost:50090/.

However when I am trying to run the in-built Pi example I am getting following exception.

$ hadoop jar hadoop/hadoop-examples-1.2.1.jar pi 4 100
Not a valid JAR: C:\cygwin\home\chandeln\hadoop\hadoop-examples-1.2.1.jar

I have also set both hadoop and java in my path.

$ java -version
java version "1.7.0_40"
Java(TM) SE Runtime Environment (build 1.7.0_40-b43)
Java HotSpot(TM) 64-Bit Server VM (build 24.0-b56, mixed mode)

$ hadoop version
Hadoop 1.2.1
Subversion https://svn.apache.org/repos/asf/hadoop/common/branches/branch-1.2 -r 1503152
Compiled by mattf on Mon Jul 22 15:23:09 PDT 2013
From source with checksum 6923c86528809c4e7e6f493b6b413a9a
This command was run using /C:/cygwin/usr/local/hadoop/hadoop-core-1.2.1.jar

My .bashrc looks like this:

export JAVA_HOME=/cygdrive/c/Java/jdk1.7.0_40
export HADOOP_PREFIX=/cygdrive/c/usr/local/hadoop
export PATH=$PATH:$HADOOP_PREFIX/bin

Can anybody shed some light on this ?

Even though Hadoop is written in Java, it does not play well on Windows. If you really want to get up and running with Hadoop in the shortest possible time, I would recommend using Linux. You can download the free VMWare Player application, and install it on Windows. Then, download the latest version on Ubuntu , and install it as a virtual machine using VMWare Player. Then you can use your Ubuntu virtual machine to install a single node cluster of Hadoop .

If this seems like too much work, open an Amazon AWS account, and find pre-configured Hadoop machines to work with.

That is most likely due to your Java version not matching with the Jar. Try with jdk1.6.

(Looks like you are playing with YDN Hadoop?)

尝试$ yarn jar hadoop / hadoop-examples-1.2.1.jar pi 4 100

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM