hive 1.2.2 本地mysql安裝
1.安裝前提
(1)安裝好了hadoop,hadoop的叢集搭建:https://blog.csdn.net/hanlanshenlan/article/details/73332039
(2)安裝好了mysql: mysql的編譯安裝(yum安裝) :https://blog.csdn.net/hanlanshenlan/article/details/77485530
2.hive安裝 (1) 下載hive:http://apache.fayea.com/hive/(2)解壓安裝: tar -zxvf apache-hive-1.2.2-bin.tar.gz
(3) 配置環境變數:/etc/profile 新增以下配置
export HIVE_HOME=/usr/java/apache-hive-1.2.1-bin
export PATH=$PATH:$HIVE_HOME/bin
export CLASSPATH=$CLASSPATH:$HIVE_HOME/bin
source /etc/profile 使檔案生效
(4)拷貝檔案,執行以下命令
cp hive-default.xml.template hive-default.xml
cp hive-default.xml.template hive-site.xml
cp hive-env.sh.template hive-env.sh
cp hive-log4j.properties.template hive-log4j.properties
cp hive-exec-log4j.properties.template hive-exec-log4j.properties
(5) 修改hive-env.sh
export HIVE_HOME=/opt/apache-hive-1.2.2-bin
export HIVE_CONF_DIR=/opt/apache-hive-1.2.2-bin/conf
<configuration>
<property>
<name>hive.metastore.warehouse.dir</name>
<value>/user/hive_remote/warehouse</value>
</property>
<property>
<name>hive.metastore.local</name>
<value>true</value>
</property>
<property>
<name>javax.jdo.option.ConnectionURL</name>
<value>jdbc:mysql://localhost/hive_remote?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>
</configuration>
(7) 下載資料庫連線jar包,這裡是用MySQL的:http://dev.mysql.com/downloads/connector/j/
解壓出mysql-connector-java-5.1.41-bin.jar包拷貝到/apache-hive-1.2.2-bin/lib下