Created
January 31, 2020 16:40
-
-
Save ns-mkusper/f808a82416d802c740f3c6b8b152cce4 to your computer and use it in GitHub Desktop.
Get current hive jars after HDP install
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
#!/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