Hive安裝配置筆記
Hive中繼資料三種儲存方式
1.Derby:hive預設的儲存模式,不可以並發調用hive
2.本地MySQL
3.遠程MySQL
採用第二種方式,安裝MySQL,啟動並建立Hive使用者,建立Hive中繼資料庫
insert into mysql.user(Host,User,Password) values("localhost","hive",password("hive"));
create database hive;
grant all on hive.* to hive@'%' identified by 'hive';
grant all on hive.* to hive@'localhost' identified by 'hive';
flush privileges;
配置Hive環境變數
vim /etc/profile
修改Hive配置
修改hive-site.xml
<property>
name>javax.jdo.option.ConnectionURL </name>
value>jdbc:mysql://localhost:3306/hive </value>
</property>
<property>
name>javax.jdo.option.ConnectionDriverName </name>
value>com.mysql.jdbc.Driver </value>
</property>
<property>
name>javax.jdo.option.ConnectionPassword </name>
value>hive </value>
</property>
<property>
name>hive.hwi.listen.port </name>
value>9999 </value>
description>This is the port the Hive Web Interface will listen on </descript ion>
</property>
<property>
name>datanucleus.autoCreateSchema </name>
value>true</value>
</property>
<property>
name>datanucleus.fixedDatastore </name>
value>false</value>
</property>
</property>
property>
name>javax.jdo.option.ConnectionUserName</name>
value>hive</value>
description>Username to use against metastore database</description>
/property>
property>
name>hive.exec.local.scratchdir</name>
value>/home/hdpsrc/hive/iotmp</value>
description>Local scratch space for Hive jobs</description>
/property>
property>
name>hive.downloaded.resources.dir</name>
value>/home/hdpsrc/hive/iotmp</value>
description>Temporary local directory for added resources in the remote file system.</description>
/property>
property>
name>hive.querylog.location</name>
value>/home/hdpsrc/hive/iotmp</value>
description>Location of Hive run time structured log file</description>
/property>
注意事項
- 找到mysql的jdbc驅動,比如mysql-connector-java-5.1.6-bin.jar拷貝到hive/lib目錄下
- hive/lib/jline-2.12.jar拷貝到/Hadoop/yarn/lib/目錄下
啟動Hive,測試
在hive中建立表
在MySQL中查看
Hive編程指南 PDF 中文高清版
基於Hadoop叢集的Hive安裝
Hive內表和外表的區別
Hadoop + Hive + Map +reduce 叢集安裝部署
Hive本地獨立模式安裝
Hive學習之WordCount單詞統計
Hive運行架構及配置部署
Hive 的詳細介紹:請點這裡
Hive 的:請點這裡
本文永久更新連結地址: