Last active
April 3, 2020 21:52
-
-
Save hansohn/7eb167146621a7a1816c180a57f53a9a to your computer and use it in GitHub Desktop.
Install Hadoop 2.7.3 via brew
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
BREW_PREFIX=$(brew --prefix); | |
# abort if already installed, else continue | |
if ! grep -q hadoop <(brew list); then | |
# unlink broken installation attempts | |
brew unlink hadoop > /dev/null 2>&1; | |
# install hadoop 2.7.3 | |
# expect benign errors | |
brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/7a4dabfc1a2acd9f01a1670fde4f0094c4fb6ffa/Formula/hadoop.rb; | |
# retain backup of default configs | |
cp -R ${BREW_PREFIX}/Cellar/hadoop/2.7.3/libexec/etc/hadoop ${BREW_PREFIX}/Cellar/hadoop/2.7.3/libexec/etc/hadoop_default; | |
# export hadoop envs | |
if [ -d "${BREW_PREFIX}/Cellar/hadoop" ]; then | |
export HADOOP_VERSION="$(brew list --versions hadoop | awk '{ print $2 }')"; | |
export HADOOP_HOME="${BREW_PREFIX}/Cellar/hadoop/${HADOOP_VERSION}"; | |
export HADOOP_CONF_DIR="${HADOOP_HOME}/libexec/etc/hadoop"; | |
fi | |
else | |
echo "Aborting... Hadoop installation already exists"; | |
fi |
By any chance have you already installed hadoop via brew previously?
If you run brew list
do you see hadoop
?
If you run hadoop version
do you get a response?
I think I have installed version 3.1.2 before.
but when I decide to downgrade to 2.7, I use brew uninstall hadoop
to remove the package.
For now, I configure that hadoop from scratch manually.
I got the same error unfortunately.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It raises an error