Skip to content

Instantly share code, notes, and snippets.

@trK54Ylmz
Last active October 20, 2019 06:37
Show Gist options
  • Save trK54Ylmz/3c0a8f1d7be76c0b95819c1950294d76 to your computer and use it in GitHub Desktop.
Save trK54Ylmz/3c0a8f1d7be76c0b95819c1950294d76 to your computer and use it in GitHub Desktop.
hadoop-2.7.3 with native libraries on Macos
# install prerequisties
xcode-select --install
brew tap homebrew/versions
brew install cmake maven openssl protobuf250 snappy
# download hadoop
cd /tmp
git clone https://github.com/apache/hadoop.git
cd hadoop
git checkout rel/release-2.7.3
# update macos only parameters
awk '/cmake_minimum_required\(VERSION\ 2.6\ FATAL_ERROR\)/{print "SET(CUSTOM_OPENSSL_PREFIX /usr/local/opt/openssl)"}1' \
hadoop-common-project/hadoop-common/src/CMakeLists.txt > hadoop-common-project/hadoop-common/src/CMakeLists.txt
sed -i -- 's/-DJVM_ARCH_DATA_MODEL=${sun.arch.data.model}/-DOPENSSL_ROOT_DIR=/usr/local/opt/openssl/g' hadoop-tools/hadoop-pipes/pom.xml
awk '/</configuration>/{print "<property><name>io.compression.codec.bzip2.library</name><value>libbz2.dylib</value></property>"}1' \
hadoop-common-project/hadoop-common/src/main/conf/core-site.xml > hadoop-common-project/hadoop-common/src/main/conf/core-site.xml
# build hadoop distro
mvn package -Pdist,native -DskipTests -Dtar -Dmaven.javadoc.skip=true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment