在Windows 7上运行Hadoop [英] Running Hadoop On Windows 7

查看:85
本文介绍了在Windows 7上运行Hadoop的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我无法在Windows 7 64位系统上运行Hadoop 1.0.3.

I'm having trouble running Hadoop 1.0.3 on Windows 7 64-bit.

我正在按照此链接中的指示进行操作.我已经下载了Cygwin并成功启动了SSH守护程序.我使用Win-Zip 16.5将Hadoop解压缩到Cygwin /usr/local文件夹中.我使用 MetaPad 编辑了hadoop-env.sh以指向我的JDK:

I'm following directions from this link. I've downloaded Cygwin and successfully started the SSH daemon. I unpacked Hadoop into the Cygwin /usr/local folder using Win-Zip 16.5. I edited the hadoop-env.sh to point to my JDK using MetaPad:

export JAVA_HOME="C:\\Program Files\\Java\\jdk1.7.0_02"

我运行了dos2unix以确保我的字符没有任何问题.

I ran dos2unix to make sure that I didn't have any issues with characters.

但是当我在Cygwin终端中运行hadoop命令以获取版本时,会看到以下内容:

But when I run the hadoop command in Cygwin terminal to get the version I see this:

$ bin/hadoop version
bin/hadoop: line 2: $'\r': command not found
bin/hadoop: line 17: $'\r': command not found
bin/hadoop: line 18: $'\r': command not found
bin/hadoop: line 49: $'\r': command not found
: No such file or directoryn
bin/hadoop: line 52: $'\r': command not found
bin/hadoop: line 60: syntax error near unexpected token `$'in\r''
'in/hadoop: line 60: `case "`uname`" in

Michael@Michael-PC /usr/local/hadoop
$

有人看过吗?我错过了一个简单的更正吗?

Has anyone seen this? Is there an easy correction that I missed?

推荐答案

好像unix和windows之间的回车符引起了问题. 尝试在shell脚本上运行dos2unix

Seems like carriage return difference between unix and windows is causing the problem . Try running dos2unix on the shell script

转到hadoop bin目录,然后尝试:

Go to the hadoop bin directory and try :

dos2unix.exe hadoop.sh

然后尝试hadoop命令.

And then try the hadoop command .

这篇关于在Windows 7上运行Hadoop的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆