使用Homebrew安装Hadoop出现错误

5

我正在尝试在我的Mac本地安装Hadoop,但是当我尝试使用brew安装Hadoop时,出现了以下错误:

$ brew install hadoop
==> Downloading http://www.apache.org/dyn/closer.cgi?path=hadoop/core/hadoop-1.1.2/hadoop-1.1.2.tar.gz
==> Best Mirror http://apache.mirrors.pair.com/hadoop/core/hadoop-1.1.2/hadoop-1.1.2.tar.gz

curl: (22) The requested URL returned error: 404
Error: Download failed: http://www.apache.org/dyn/closer.cgi?path=hadoop/core/hadoop-1.1.2/hadoop-1.1.2.tar.gz

你有什么想法应该做什么?

2个回答

16

首先需要执行brew update命令。它之前可能会指向错误的版本,但现在已经修复了。


4

看起来 HomebrewHadoop 公式已经过时,它指向的版本是 1.1.2 而不是 1.2.1。在 Homebrew 团队修复这个问题之前,您可以按照以下步骤安装 Hadoop 1.1.2:

  1. Download manually version 1.1.2 from http://archive.apache.org/dist/hadoop/core/hadoop-1.1.2/hadoop-1.1.2.tar.gz to any folder in your computer
  2. Then move the file hadoop-1.1.2.tar.gz to homebrew's temporary folder, if you have not changed it before, it should be located in /Library/Caches/Homebrew
  3. Finally you can install Hadoop using Homebrew, now brew will find that the file has already been downloaded and will proceed with installation as follows:

    $ brew install hadoop
    ==> Downloading http://www.apache.org/dyn/closer.cgi?path=hadoop/core/hadoop-1.1.2/hadoop-1.1.2.tar.
    Already downloaded: /Library/Caches/Homebrew/hadoop-1.1.2.tar.gz
    ==> Caveats
    In Hadoop's config file:
      /usr/local/Cellar/hadoop/1.1.2/libexec/conf/hadoop-env.sh
    $JAVA_HOME has been set to be the output of:
      /usr/libexec/java_home
    ==> Summary
      /usr/local/Cellar/hadoop/1.1.2: 271 files, 78M, built in 2 seconds
    

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接