1.hive下載安裝
?
? 2.下載mysql安裝
?
? 3.以root用戶進(jìn)入mysql命令行:mysql -uroot -p(提示輸入密碼)
?
? 4.創(chuàng)建hive的元數(shù)據(jù)庫(kù):create database metahive【元數(shù)據(jù)庫(kù)名metahive】
?
? 5.創(chuàng)建hive用戶:create user hive@'localhost' identified by 'hive'【mysql中為hive專用的user名:hive,密碼為:hive】
?
? 6.賦予權(quán)限:grant all privileges on metahive.* to hive;flush privileges;
?
? 7.登出root用戶:quit;
?
? 8.使用hive用戶登錄mysql:mysql -uhive -p(提示輸入密碼)
?
? 【登錄后,show databases;可以看到有metahive這一數(shù)據(jù)庫(kù),OK!】
?
? 9.配置hive:【主要是hive-site.xml文件】
?
? 9.1.將hive的conf文件夾中的hive-default.xml.template文件拷貝為hive-site.xml文件:cp hive-default.xml.template hive-site.xml
?
? 9.2.配置hive-site.xml文件:vim hive-site.xml
?
? 需要修改的property有如下幾個(gè):【由于hive默認(rèn)的元數(shù)據(jù)庫(kù)為其內(nèi)置的derby數(shù)據(jù)庫(kù),要修改為mysql】
?
? <property>
?
? <name>javax.jdo.option.ConnectionURL</name>
?
? <value>jdbc:mysql://localhost:3306/元數(shù)據(jù)庫(kù)名?createDatabaseIfNotExist=true</value>
?
? <description>JDBCconnectstringforaJDBCmetastore</description>
?
? </property>
?
? <property>
?
? <name>javax.jdo.option.ConnectionDriverName</name>
?
? <value>com.mysql.jdbc.Driver</value>
?
? <description>DriverclassnameforaJDBCmetastore</description>
?
? </property>
?
? <property>
?
? <name>javax.jdo.option.ConnectionUserName</name>
?
? <value>mysql中為hive專用的用戶名</value>
?
? <description>usernametouseagainstmetastoredatabase</description>
?
? </property>
?
? <property>
?
? <name>javax.jdo.option.ConnectionPassword</name>
?
? <value>123456</value>
?
? <description>passwordtouseagainstmetastoredatabase</description>
?
? </property>
?
? 10.配置完后注意在/etc/profile(或者redhat OS下的。bash_profile和ubuntu OS下的。bashrc)中添加HIVE_HOME(hive安裝路徑下bin的上一層)
?
? 以上步驟的順序是沒(méi)有嚴(yán)格要求的,至此,算是安裝配置完畢,下面進(jìn)入測(cè)試階段
?
? 11.進(jìn)入hive cli:命令行輸入hive
?
? 12.在hive中建測(cè)試表test:create table test(id int,name string)row format delimited fields terminated by '\t' lines terminated by '\n' stored as textfile;
托福答案
????
www.qcwyo68.com
?
?
?
更多文章、技術(shù)交流、商務(wù)合作、聯(lián)系博主
微信掃碼或搜索:z360901061

微信掃一掃加我為好友
QQ號(hào)聯(lián)系: 360901061
您的支持是博主寫作最大的動(dòng)力,如果您喜歡我的文章,感覺(jué)我的文章對(duì)您有幫助,請(qǐng)用微信掃描下面二維碼支持博主2元、5元、10元、20元等您想捐的金額吧,狠狠點(diǎn)擊下面給點(diǎn)支持吧,站長(zhǎng)非常感激您!手機(jī)微信長(zhǎng)按不能支付解決辦法:請(qǐng)將微信支付二維碼保存到相冊(cè),切換到微信,然后點(diǎn)擊微信右上角掃一掃功能,選擇支付二維碼完成支付。
【本文對(duì)您有幫助就好】元
