本文主要介绍在centOS中安装hive。
1. 解压apache-hive-1.2.1-bin.zip
2.以hive-default.xml.template为模板,创建hive-site.xml
4.启动hive
进入bin目录,执行hive命令,./hive
5.如果报错java.lang.IncompatibleClassChangeError: Found class jline.Terminal,but interface was expected
打开hadoop/etc/hadoop/hadoop-env.sh,增加export HADOOP_USER_CLASSPATH_FIRST=true
6.安装MysqL
netstat -nplt |grep 3306
9.将MysqL-connector-java-5.1.39-bin.jar拷贝到apache-hive-1.2.1-bin/lib目录下
10.MysqL中赋予用户权限
grant all on *.* to root@'%' identified by '123456';
11.修改hive-site.xml,配置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.ConnectionURL</name> <value>jdbc:MysqL://localhost/hive</value> <description>JDBC connect string 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>123456</value> <description>password to use against Metastore database</description> </property>