Apache Hive 공식 홈페이지 에서 다운로드한다.
mkdir /home/metastore/apps
wget https://dlcdn.apache.org/hadoop/common/hadoop-3.4.1/hadoop-3.4.1.tar.gz
tar -xvzf hadoop-3.4.1.tar.gz
wget https://dlcdn.apache.org/hive/hive-4.0.1/apache-hive-4.0.1-bin.tar.gz
tar -xvzf apache-hive-4.0.1-bin.tar.gz
ln -s /home/metastore/apps/hadoop-3.4.1 /home/metastore/hadoop
ln -s /home/metastore/apps/apache-hive-4.0.1-bin.tar.gz /home/metastore/metastore
cat <<EOF | tee /home/metastore/.bash_profile
export JAVA_HOME=/usr/lib/jvm/java-11-openjdk-11.0.23.0.9-3.el9.x86_64
export HOME=/home/metastore
export HADOOP_HOME=$HOME/hadoop
export METASTORE_HOME=$HOME/hive
export PATH=$JAVA_HOME/bin:$HADOOP_HOME/bin:$metastore_HOME/bin:$PATH
EOF
export JAVA_HOME=/usr/lib/jvm/java-11-openjdk-11.0.23.0.9-3.el9.x86_64
export HADOOP_HOME=/home/metastore/hadoop
export HIVE_HOME=/home/metastore/metastore
export HIVE_CONF_DIR=/home/metastore/metastore
export HIVE_AUX_JARS_PATH=$HIVE_HOME/lib,$HIVE_HOME/auxlib
<configuration>
<property>
<name>javax.jdo.option.ConnectionURL</name>
<value>jdbc:postgresql://metastore.haedongg.net:5432/metastore</value>
</property>
<property>
<name>javax.jdo.option.ConnectionDriverName</name>
<value>org.postgresql.Driver</value>
</property>
<property>
<name>javax.jdo.option.ConnectionUserName</name>
<value>metastore</value>
</property>
<property>
<name>javax.jdo.option.ConnectionPassword</name>
<value>votmdnjem</value>
</property>
<property>
<name>hive.aux.jars.path</name>
<value>/home/metastore/metastore/auxlib,/home/metastore/metastore/lib</value>
</property>
<!-- configuration for run Hive without Hadoop --!>
<property>
<name>hive.metastore.schema.verification</name>
<value>false</value>
</property>
<property>
<name>hive.metastore.warehouse.dir</name>
<value>file:///tmp</value>
</property>
<property>
<name>fs.default.name</name>
<value>file:///tmp</value>
</property>
</configuration>
$HIVE_HOME/bin/schematool -initSchema -dbType postgres
nohup bin/hive --service metastore > log/metastore.log 2>&1 &
초창기에는 Hive SQL 엔진을 사용하기 위한 메타스토어로써 Hiveserver와 함께 배포 됐지만, 현재는 metastore만 따로 배포 됐....지만 3.X 버전은 EOL. 4.X는 현재 Hive 패키지로 배포된다. ↩︎