AWS EC2 t2.xlarge
OS : Redhat 8.6
Hive Version : 3.1.3
# /home/ec2-user/project/sw에서 실행
# 다운로드
wget https://dlcdn.apache.org/hive/hive-3.1.3/apache-hive-3.1.3-bin.tar.gz
# 압축 풀기
tar xvf apache-hive-3.1.3-bin.tar.gz
# 디렉토리명 변경
mv apache-hive-3.1.3-bin/ hive
vi ~/.bashrc
아래 내용 추가
export HIVE_HOME=/home/ec2-user/project/sw/hive export PATH=$PATH:$HIVE_HOME/bin
source ~/.bashrc
vi $HIVE_HOME/conf/hive-env.sh
# hive-env.sh없으면
cp $HIVE_HOME/conf/hive-env.sh.template $HIVE_HOME/conf/hive-env.sh
아래 내용 추가
export HADOOP_HOME=<HADOOP_HOME> HIVE_CONF_DIR="${HIVE_CONF_DIR:-$HIVE_HOME/conf}" export HADOOP_HEAPSIZE=${HADOOP_HEAPSIZE:-256} export HIVE_CONF_DIR=$HIVE_CONF_DIR export HIVE_AUX_JARS_PATH=$HIVE_AUX_JARS_PATH
vi $HIVE_HOME/bin/hive-config.sh
아래 내용 추가
export HADOOP_HOME=/home/ec2-user/project/sw/hadoop
hdfs dfs -mkdir /tmp
hdfs dfs -chmod g+w /tmp
hdfs dfs -ls /
hdfs dfs -mkdir -p /user/hive/warehouse
hdfs dfs -chmod g+w /user/hive/warehouse
hdfs dfs -ls /user/hive
rm hive/lib/guava-19.0.jar
cp hadoop/share/hadoop/hdfs/lib/guava-27.0-jre.jar hive/lib/
hive/bin/schematool -initSchema -dbType derby
hive