2

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 ?

4

3 回答 3

1

即使 Hadoop 是用 Java 编写的,它在 Windows 上也不能很好地运行。如果您真的想在尽可能短的时间内启动并运行 Hadoop,我建议您使用 Linux。您可以下载免费的VMWare Player应用程序,并将其安装在 Windows 上。然后,在Ubuntu上下载最新版本,并使用 VMWare Player 将其安装为虚拟机。然后你可以使用你的 Ubuntu 虚拟机来安装一个单节点的 Hadoop 集群

如果这看起来工作量太大,请打开一个Amazon AWS帐户,然后找到可以使用的预配置 Hadoop 机器

于 2013-10-16T20:59:16.320 回答
0

这很可能是由于您的 Java 版本与 Jar 不匹配。试试jdk1.6。

(看起来你在玩 YDN Hadoop?)

于 2015-06-08T07:41:04.093 回答
0

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

于 2017-01-01T16:50:17.670 回答