標籤:des style blog http color java os io
hive0.13.1在hadoop2.4.1偽分布式部署上安裝過程
環境:redhat enterprice 6.5 +hadoop2.4.1+hive0.13.1+mysql單節點偽分布式部署
相關網址:
hive官網安裝指導:https://cwiki.apache.org/confluence/display/Hive/GettingStarted#GettingStarted-InstallingHivefromaStableRelease
hive之metastore的三種儲存方式:https://cwiki.apache.org/confluence/display/Hive/AdminManual+MetastoreAdmin
hive安裝配置:http://wenku.baidu.com/link?url=Lpp_CRRpeNALUF2u97tFr7zc5HrrikQxJfjrgZvGEqlH6T857ehdfRUK4oCqEPHb0QeHmlU1U_fGQPDpfAe4MZnNZZGav8o7cwoX5JBr_AO
為分布式hadoop2.2.0+hive1.2.0配置:http://www.kankanews.com/ICkengine/archives/72851.shtml
step1 安裝mysql
step2 在mysql資料庫中建立資料庫hive用來儲存metastore資料,同時建立能夠進入hive的使用者
mysql> create database hive;mysql> create user hadoop ‘hadoop‘@‘localhost‘ identified by ‘123456‘;mysql> grant all privileges on hive.* to ‘hadoop‘@‘localhost‘ with grant option;
mysql> flush privileges;
step3 下載編譯好的hive包:http://mirrors.cnnic.cn/apache/hive/stable/apache-hive-0.13.1-bin.tar.gz
step4 解壓apache-hive-0.13.1-bin.tar.gz包
tar -zxvf apache-hive-0.13.1-bin.tar.gz -C /opt/
step5 配置hive相關檔案
a.配置hive/conf中的hive-site.xml 檔案(預設的沒有這個檔案,我們複製hive-default.xml.template,然後改名為hive-site.xml. 把其中的配置資訊替換成下面這些)
<property>
<name>hive.metastore.uris</name>
<value></value>
<description>此處value值為空白,表示hive.metastore.local為true</description>
</property>
<property> <name>javax.jdo.option.ConnectionURL</name> <value>jdbc:mysql://localhost:3306/hive?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>hadoop</value> </property> <property> <name>javax.jdo.option.ConnectionPassword</name> <value>123456</value> </property>
b.把MySQL的JDBC驅動包複製到hive/lib目錄下(如果沒有lib目錄自己建一個)。
:http://dev.mysql.com/downloads/connector/j/
step6.測試:進入到/opt/apache-hive-0.13.1-bin/bin/目錄執行 hive進入hive然後執行show tables;查看結果如下:
# cd /opt/apache-hive-0.13.1-bin/bin# ./hivef14/08/09 20:09:50 WARN conf.hiveconf:DEPRECATED:hive.metastore.ds.retry.* no longer has any effect.use hive.hmshandler.retry.* insteadlogging initialized using configuration in jar:file:/opt/apache-hive-0.13.1-bin/lib/hive-common-0.13.1.jar!/hive-log4j.propertieshive> show tables;
OK
Time taken: 1.61 seconds, Fetched:1 row(s)
hive>
如果不報錯,表明基於獨立中繼資料庫的Hive已經安裝成功了。