1.Hive配置MySQL
Hive只是一个工具,无需配置多台机器,我在CentOS7One机器上配置Hive
/usr/local/hive/apache-hive-1.2.1-bin/conf
cp hive-default.xml.template hive-site.xml
编辑hive-site.xml
配置MySQL连接地址
<property>
<name>javax.jdo.option.ConnectionURL</name>
<value>jdbc:mysql://192.168.1.161:3306/hive?createDatabaseIfNotExist=true</value>
<description>JDBC connect string for a JDBC metastore</description>
</property>
配置MySQL驱动包
<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></value>
<description>password to use against metastore database</description>
</property>
在CentOS7One上启动hive
sh /usr/local/hive/apache-hive-1.2.-bin/bin/hive
2.注意事项
MySQL驱动包要加入到hive的lib目录下(/usr/local/hive/apache-hive-1.2.1-bin/lib),mysql-connector-java-5.1.28.jar