Skip to content

Instantly share code, notes, and snippets.

@ns-mkusper
Created January 31, 2020 16:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ns-mkusper/f808a82416d802c740f3c6b8b152cce4 to your computer and use it in GitHub Desktop.
Save ns-mkusper/f808a82416d802c740f3c6b8b152cce4 to your computer and use it in GitHub Desktop.
Get current hive jars after HDP install
#!/bin/bash
cd /usr/hdp/current
# Get the current version of Hive
selectLine=$( hdp-select status hive-server2 )
parts=( $selectLine )
echo "SelectLine: ${parts[2]}"
version="${parts[2]}"
echo "Version: ${version}"
if [ -d /tmp/hivejars/${version} ]; then
rm -rf /tmp/hivejars/${version}
fi
mkdir -p /tmp/hivejars/${version}
cp ./hadoop-client/hadoop-common.jar /tmp/hivejars/${version}
cp ./hive-client/lib/hive-jdbc.jar /tmp/hivejars/${version}
cp ./hadoop-client/client/httpclient.jar /tmp/hivejars/${version}
cp ./hadoop-client/client/httpcore.jar /tmp/hivejars/${version}
cp ./hadoop-client/client/slf4j-api.jar /tmp/hivejars/${version}
cd /tmp
tar cvfz hivejars.tgz hivejars
echo "Your jars are in `pwd`/hivejars.tgz"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment