1、hive-site.xml配置:
一般解压二进制hive安装文件后,cp hive-default.xml.template hive-site.xml;
vi hive-site.xml:
需添加mysql配置:
<property>
<name>javax.jdo.option.ConnectionURL</name>
<value>jdbc:mysql://192.168.10.186:3306/hive?createDatabaseIfNotExist=true</value>
<description>JDBC connect string for a JDBC metastore</description>
</property>
<property>
<name>javax.jdo.option.ConnectionDriverName</name>
<value>com.mysql.jdbc.Driver</value>
<description>Driver class name for a JDBC metastore</description>
</property
<property>
<name>javax.jdo.option.ConnectionUserName</name>
<value>root</value>
<description>Username to use against metastore database</description>
</property
<property>
<name>javax.jdo.option.ConnectionPassword</name>
<value>root</value>
<description>password to use against metastore database</description>
</property>
可更改配置:
<!-->hive数据库创建默认路径<-->
<property>
<name>hive.metastore.warehouse.dir</name>
<value>/user/hive/warehouse</value>
<description>location of default database for the warehouse</description>
</property>
<!-->hiverserver2客户端连接端口<-->
<property>
<name>hive.server2.thrift.port</name>
<value>10000</value>
<description>Port number of HiveServer2 Thrift interface when hive.server2.transport.mode is 'binary'.</description>
</property>
2.hive-env.sh配置
# Set HADOOP_HOME to point to a specific hadoop install directory
HADOOP_HOME=/mytest/hadoop-2.9.2
# Hive Configuration Directory can be controlled by:
export HIVE_CONF_DIR=/mytest/apache-hive-1.2.2-bin/conf
# Folder containing extra ibraries required for hive compilation/execution can be controlled by:
export HIVE_AUX_JARS_PATH=/mytest/apache-hive-1.2.2-bin/lib