下载hive
wget https://mirrors.tuna.tsinghua.edu.cn/apache/hive/hive-4.0.0/apache-hive-4.0.0-bin.tar.gz
sudo chown -R hduser:hadoop /opt/hive-4.0.0
配置.bashrc
export HIVE_HOME=/opt/hive-4.0.0
export PATH=$PATH:$HIVE_HOME/bin
hive-site.xml
<configuration>
<!-- 使用PostgreSQL作为Metastore -->
<property>
<name>javax.jdo.option.ConnectionURL</name>
<value>jdbc:postgresql://localhost/metastore_db?createDatabaseIfNotExist=true&sslmode=disable&TimeZone=UTC</value>
</property>
<property>
<name>javax.jdo.option.ConnectionDriverName</name>
<value>org.postgresql.Driver</value>
</property>
<property>
<name>javax.jdo.option.ConnectionUserName</name>
<value>hive_user</value>
</property>
<property>
<name>javax.jdo.option.ConnectionPassword</name>
<value>hive_password</value>
</property>
<!-- Hive Metastore的端口,默认为9083 -->
<property>
<name>hive.metastore.uris</name>
<value>thrift://localhost:9083</value>
</property>
<!-- 使用Hadoop 3.x的Hive编译版本 -->
<property>
<name>hive.execution.engine</name>
<value>tez</value> <!-- 或spark, mapreduce 根据实际集群情况选择 -->
</property>
<!-- 如果使用Tez,还需配置Hadoop classpath以包含Tez jars -->
<property>
<name>hive.aux.jars.path</name>
<value>/path/to/tez-jars/*,/path/to/other-libraries/*</value>
</property>
</configuration>
初始化metastore
schematool -initSchema -dbType postgres
标签:jdo,option,hive,metastore,安装,javax,4.0
From: https://www.cnblogs.com/wubdut/p/18145500