前提条件
- jdk1.8+
- hadoop2.x
- apache-hive-2.3.3-bin.tar.gz
配置文件
在conf/下复制配置文件
cp hive-env.sh.template hive-env.sh
cp hive-default.xml.template hive-site.xml
hive-env.sh
# Set HADOOP_HOME to point to a specific hadoop install directory
export HADOOP_HOME=/mnt/hgfs/download/hadoop-2.5.2
# Hive Configuration Directory can be controlled by:
export HIVE_CONF_DIR=/mnt/hgfs/download/hive-2.3.3-bin/conf
# Folder containing extra libraries required for hive compilation/execution can be controlled by:
export HIVE_AUX_JARS_PATH=/mnt/hgfs/download/hive-2.3.3-bin/lib
hive-site.xml
<property>
<name>javax.jdo.option.ConnectionURL</name>
<value>jdbc:mysql://192.168.159.128:3306/hive?createDatabaseIfNotExist=true</value>
</property>
<property>
<name>javax.jdo.option.ConnectionDriverName</name>
<value>com.mysql.jdbc.Driver</value>
</property>
<property>
<name>javax.jdo.option.ConnectionUserName</name>
<value>root</value>
</property>
<property>
<name>javax.jdo.option.ConnectionPassword</name>
<value>123456</value>
</property>
退出hive命令
hive>quit;
hive>exit;show
初始化metadata-db
./bin/schematool -dbType mysql -initSchema
问题
1、Relative path in absolute URI: {system:java.io.tmpdir%7D/
{system:java.io.tmpdir%7D/
%7Bhive.session.id%7D_resources,解决方案
https://www.cnblogs.com/wmcoder/p/7099235.html
2、Hive2:Unable to instantiate org.apache.hadoop.hive.ql.metadata.SessionHiveMetaStoreClient,解决方案https://blog.csdn.net/chengyuqiang/article/details/61216162
3、Unable to instantiate org.apache.hadoop.hive.ql.metadata.SessionHiveMetaStor