Hive的安裝和配置
前提是:hadoop必須已經啟動了***
1°、解壓hive的安裝包
[[email protected] soft]# tar -zxvf apache-hive-0.14.0-bin.tar.gz -C ../
2°、備份配置文件
[[email protected] conf]# cp hive-env.sh.template hive-env.sh
[[email protected] conf]# cp hive-default.xml.template hive-site.xml
3°、配置hive的配置文件
1)、修改hive-env.sh
加入三行內容(大家根據自己的情況來添加)
JAVA_HOME=/usr/local/jdk1.7.0_55
HADOOP_HOME=/usr/local/hadoop-2.4.1
HIVE_HOME=/usr/local/hive-0.14.0
2)、修改hive-site.xml
<configuration>
<property>
<name>javax.jdo.option.ConnectionURL</name>
<value>jdbc:mysql://192.168.1.121:3306/hive?characterEncoding=utf-8</value>
<description>JDBC connect string for aJDBCmetastore</description>
</property>
<property>
<name>javax.jdo.option.ConnectionDriverName</name>
<value>com.mysql.jdbc.Driver</value>
<description>Driver class name for aJDBCmetastore</description>
</property>
<property>
<name>javax.jdo.option.ConnectionUserName</name>
<value>hive</value>
<description>username to use againstmetastoredatabase</description>
</property>
<property>
<name>javax.jdo.option.ConnectionPassword</name>
<value>hive</value>
<description>password to use againstmetastoredatabase</description>
</property>
<property>
<name>hive.metastore.schema.verification</name>
<value>false</value>
</property>
</configuration>
3)、拷貝mysql驅動到$HIVE_HOME/lib目錄下
[[email protected] bin]# cp /usr/local/soft/mysql-connector-java-5.1.17.jar ../lib/
4)、啟動Hive
[[email protected] bin]# ./hive <==>等價於
[[email protected] bin]# ./hive --service cli
Hive的安裝和配置