Running Hadoop On Windows 7

巧了我就是萌 提交于 2019-12-13 01:31:23

问题


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

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"

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

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?


回答1:


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

Go to the hadoop bin directory and try :

dos2unix.exe hadoop.sh

And then try the hadoop command .



来源:https://stackoverflow.com/questions/12331944/running-hadoop-on-windows-7

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!