相信使用ma时间长一点的朋友都一定听说过homebrew。
homebrew 是mac下3个主流的package management tool之一。没有安装的朋友可以直接在终端中运行如下指令完成brew的安装
ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
这样在mac下,再安装hadoop也就非常简单啦。
首先运行
brew info hadoop
得到当前版本信息
hadoop: stable 2.3.0
http://hadoop.apache.org/
Not installed
From: https://github.com/Homebrew/homebrew/commits/master/Library/Formula/hadoop.rb
==> Caveats
In Hadoop's config file:
/usr/local/Cellar/hadoop/2.3.0/libexec/etc/hadoop/hadoop-env.sh,
/usr/local/Cellar/hadoop/2.3.0/libexec/etc/hadoop/mapred-env.sh and
/usr/local/Cellar/hadoop/2.3.0/libexec/etc/hadoop/yarn-env.sh
$JAVA_HOME has been set to be the output of:
/usr/libexec/java_home
然后进行安装
brew install hadoop
返回:
Warning: It appears you have MacPorts or Fink installed.
Software installed with other package managers causes known problems for
Homebrew. If a formula fails to build, uninstall MacPorts/Fink and try again.
==> Downloading http://www.apache.org/dyn/closer.cgi?path=hadoop/core/hadoop-2.2.0/hadoop-2.2.0.tar.gz
==> Best Mirror http://mirrors.hust.edu.cn/apache/hadoop/core/hadoop-2.2.0/hadoop-2.2.0.tar.gz
######## 11.2%
最后完成。
如果选择版本安装可以先进行查看版本
brew versions hadoop
返回:
Warning: brew-versions is unsupported and may be removed soon.
Please use the homebrew-versions tap instead:
https://github.com/Homebrew/homebrew-versions
2.3.0 git checkout 7ed33a1 Library/Formula/hadoop.rb
2.2.0 git checkout 61dcbbd Library/Formula/hadoop.rb
1.2.1 git checkout a49c2fa Library/Formula/hadoop.rb
1.1.2 git checkout d133e18 Library/Formula/hadoop.rb
1.1.1 git checkout 6f15c8f Library/Formula/hadoop.rb
1.0.4 git checkout ce2f7e1 Library/Formula/hadoop.rb
1.0.3 git checkout 3c5ca25 Library/Formula/hadoop.rb
1.0.1 git checkout 81353a3 Library/Formula/hadoop.rb
1.0.0 git checkout 6eebea9 Library/Formula/hadoop.rb
0.21.0 git checkout c27b6e7 Library/Formula/hadoop.rb
0.20.2 git checkout d0efd9e Library/Formula/hadoop.rb
0.20.1 git checkout e5869fe Library/Formula/hadoop.rb
然后
cd /usr/local/Library/Formula/
接着更新ruby文件:
git checkout 61dcbbd hadoop.rb
最后安装直接执行
brew install hadoop
返回:
Warning: It appears you have MacPorts or Fink installed.
Software installed with other package managers causes known problems for
Homebrew. If a formula fails to build, uninstall MacPorts/Fink and try again.
==> Downloading http://www.apache.org/dyn/closer.cgi?path=hadoop/core/hadoop-2.2.0/hadoop-2.2.0.tar.gz
==> Best Mirror http://mirrors.hust.edu.cn/apache/hadoop/core/hadoop-2.2.0/hadoop-2.2.0.tar.gz
########## 14.9%