简体   繁体   English

运行Hadoop Pi示例

[英]Running Hadoop Pi Example

I need some help running Hadoop Pi example in Windows. 我需要一些在Windows上运行Hadoop Pi示例的帮助。 I have sucecssfully setup Hadoop on Windows and can see all NameNode, SecondaryNameNode, JobTracker and TaskTracker running. 我已经在Windows上成功设置了Hadoop,并且可以看到所有NameNode,SecondaryNameNode,JobTracker和TaskTracker正在运行。 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. 但是,当我尝试运行内置Pi示例时,出现以下异常。

$ 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. 我还在路径中同时设置了hadoop和java。

$ 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: 我的.bashrc看起来像这样:

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. 即使Hadoop是用Java编写的,但在Windows上也不能很好地运行。 If you really want to get up and running with Hadoop in the shortest possible time, I would recommend using Linux. 如果您真的想在最短的时间内启动并运行Hadoop,我建议您使用Linux。 You can download the free VMWare Player application, and install it on Windows. 您可以下载免费的VMWare Player应用程序,然后将其安装在Windows上。 Then, download the latest version on Ubuntu , and install it as a virtual machine using VMWare Player. 然后,在Ubuntu上下载最新版本,然后使用VMWare Player将其安装为虚拟机。 Then you can use your Ubuntu virtual machine to install a single node cluster of Hadoop . 然后,您可以使用Ubuntu虚拟机安装Hadoop的单节点群集

If this seems like too much work, open an Amazon AWS account, and find pre-configured Hadoop machines to work with. 如果这似乎太麻烦了,请打开一个Amazon AWS帐户,然后找到可以使用的预配置Hadoop机器

That is most likely due to your Java version not matching with the Jar. 这很可能是由于您的Java版本与Jar不匹配。 Try with jdk1.6. 尝试使用jdk1.6。

(Looks like you are playing with YDN Hadoop?) (好像您正在使用YDN Hadoop?)

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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