需要安装 hadoop 的帮助

发布于 2025-01-02 23:37:41 字数 1282 浏览 1 评论 0原文

我是 Hadoop 新手,并尝试使用 cygwin 将其安装在我的 Windows 7 (x64) PC 上。 我按照本教程安装 http://alans。 se/blog/2010/hadoop-hbase-cygwin-windows-7-x64/#software

在此步骤之前一切正常 -

Only Hadoop 0.21.0: Next, one line has to be added to the hadoop-config.sh file in hadoop-0.21.-0/bin

    CLASSPATH=`cygpath -wp "$CLASSPATH"`

Add this line before the line containing

    JAVA_LIBRARY_PATH=''

这行是否 正确 CLASSPATH=cygpath -wp "$CLASSPATH" 需要按原样复制吗?

因为当我尝试运行下面的命令时。

    $ bin/hadoop namenode -format

我从 cygwin 收到这样的错误,

/usr/local/hadoop-0.21.0/bin/hadoop-config.sh: line 15: $'\r': command not found
/usr/local/hadoop-0.21.0/bin/hadoop-config.sh: line 19: $'\r': command not found
/usr/local/hadoop-0.21.0/bin/hadoop-config.sh: line 21: $'\r': command not found
/usr/local/hadoop-0.21.0/bin/hadoop-config.sh: line 75: syntax error near unexpected token `$'in\r''
'usr/local/hadoop-0.21.0/bin/hadoop-config.sh: line 75: `case "`uname`" in 
DEPRECATED: Use of this script to execute hdfs command is deprecated.
Instead use the hdfs command for it.

HDFS not found.

谁能解释一下出了什么问题?

I am new to Hadoop and trying to install it on my windows 7 (x64) PC using cygwin.
I followed this tutorial to install http://alans.se/blog/2010/hadoop-hbase-cygwin-windows-7-x64/#software

Everything goes correct before this step -

Only Hadoop 0.21.0: Next, one line has to be added to the hadoop-config.sh file in hadoop-0.21.-0/bin

    CLASSPATH=`cygpath -wp "$CLASSPATH"`

Add this line before the line containing

    JAVA_LIBRARY_PATH=''

Does this line
CLASSPATH=cygpath -wp "$CLASSPATH" need to be copied as it is?

Coz when I am trying to run command below.

    $ bin/hadoop namenode -format

I am getting such error from cygwin

/usr/local/hadoop-0.21.0/bin/hadoop-config.sh: line 15: 

can anyone explain what is going wrong?

\r': command not found /usr/local/hadoop-0.21.0/bin/hadoop-config.sh: line 19:

can anyone explain what is going wrong?

\r': command not found /usr/local/hadoop-0.21.0/bin/hadoop-config.sh: line 21:

can anyone explain what is going wrong?

\r': command not found /usr/local/hadoop-0.21.0/bin/hadoop-config.sh: line 75: syntax error near unexpected token `

can anyone explain what is going wrong?

in\r'' 'usr/local/hadoop-0.21.0/bin/hadoop-config.sh: line 75: `case "`uname`" in DEPRECATED: Use of this script to execute hdfs command is deprecated. Instead use the hdfs command for it. HDFS not found.

can anyone explain what is going wrong?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

﹎☆浅夏丿初晴 2025-01-09 23:37:41

您正在使用已弃用的命令。要获取 hadoop 命令列表,请在控制台上输入 hadoop。我相信该命令是 hadoop namenode -format

you are using a deprecated command. For a list of hadoop commands, enter hadoop on your console. I believe the command is hadoop namenode -format

小苏打饼 2025-01-09 23:37:41

我使用 cygwin 1.7 也遇到了这些错误:

/usr/local/hadoop-0.21.0/bin/hadoop-config.sh:第 15 行:$'\r':命令
未找到

这些文件似乎不是 DOS CR/LF 格式,而不是预期的 UNIX 格式。

您可以使用 Notepad++ 等文本编辑器来确认这一点。在窗口的右下部分,可以显示 Dos\Windows(很可能是您会看到的内容)或 UNIX。

为了解决这些错误,在 cygwin 窗口中,我根据需要在 bin 文件夹和其他文件夹(conf 等)中使用了命令 dos2unix *.sh。

希望这对您有帮助!

I also got these errors using cygwin 1.7:

/usr/local/hadoop-0.21.0/bin/hadoop-config.sh: line 15: $'\r': command
not found

It appears that these files are not in DOS CR/LF format instead of the expected UNIX format.

You can confirm this with a text editor like Notepad++. In the lower right hand part of the window, it can say Dos\Windows (very likely what you would see) or UNIX.

To work around these errors, in a cygwin window I used the command dos2unix *.sh in the bin folder and other folders (conf, etc...) as needed.

Hope this helps you!

冰魂雪魄 2025-01-09 23:37:41

使用 dos2unix filename (shell 命令)将 config.sh 文件或 d 构建中所需的任何配置文件转换为 unix 格式。看来文件默认更改为 DOS 格式。最好使用 (dos2unix ./*) shell 命令将 d 文件夹中的每个文件转换为 unix。

Convert the config.sh file or any config file needed in d build to unix format with dos2unix filename (shell command). It seems the files changes to DOS format by default. Better convert every file in d folder to unix with (dos2unix ./*) shell command.

缘字诀 2025-01-09 23:37:41

Cygwin 的错误似乎是 npm 脚本的已知错误。您可以使用此处提到的解决方法,

https://stackoverflow.com/a/22436199/2390020

The error with Cygwin seems to be a known error with npm script. You can use the work around mentioned here,

https://stackoverflow.com/a/22436199/2390020

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文