hive0.13.1在hadoop2.4.1偽分布式部署上安裝過程
環(huán)境:redhat enterprice 6.5 +hadoop2.4.1+hive0.13.1+mysql單節(jié)點偽分布式部署
相關網(wǎng)址:
hive官網(wǎng)安裝指導: https://cwiki.apache.org/confluence/display/Hive/GettingStarted#GettingStarted-InstallingHivefromaStableRelease
hive之metastore的三種保存方式: https://cwiki.apache.org/confluence/display/Hive/AdminManual+MetastoreAdmin
為分布式hadoop2.2.0+hive1.2.0配置: http://www.kankanews.com/ICkengine/archives/72851.shtml
***remote metastore config : http://www.cnblogs.com/ggjucheng/archive/2012/04/26/2471341.html
step1 安裝mysql
step2 在mysql數(shù)據(jù)庫中創(chuàng)建數(shù)據(jù)庫hive用來存儲metastore數(shù)據(jù),同時創(chuàng)建能夠進入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驅(qū)動包復制到hive/lib目錄下(如果沒有l(wèi)ib目錄自己建一個)。?
    
    
    ??
    
    
      下載地址:
    
    
      http://dev.mysql.com/downloads/connector/j/
    
    
    ??
    
    
      step6.測試:進入到/opt/apache-hive-0.13.1-bin/bin/目錄執(zhí)行 hive進入hive然后執(zhí)行show tables;查看結果如下:
    
  
      # cd /opt/apache-hive-
      
        0.13
      
      .
      
        1
      
      -bin/
      
        bin
# ./hive
f14
      
      /
      
        08
      
      /
      
        09
      
      
        20
      
      :
      
        09
      
      :
      
        50
      
       WARN conf.hiveconf:DEPRECATED:hive.metastore.ds.retry.* no longer has any effect.use hive.hmshandler.retry.*
      
         instead
logging initialized using configuration 
      
      
        in
      
       jar:
      
        file
      
      :/opt/apache-hive-
      
        0.13
      
      .
      
        1
      
      -bin/lib/hive-common-
      
        0.13
      
      .
      
        1
      
      .jar!/hive-
      
        log4j.properties
hive
      
      > show tables;
      
      OK
      
      Time taken: 1.61 seconds, Fetched:1 row(s)
      
      hive>
    
  如果不報錯,表明基于獨立元數(shù)據(jù)庫的Hive已經(jīng)安裝成功了。
?
更多文章、技術交流、商務合作、聯(lián)系博主
微信掃碼或搜索:z360901061
 
					微信掃一掃加我為好友
QQ號聯(lián)系: 360901061
您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描下面二維碼支持博主2元、5元、10元、20元等您想捐的金額吧,狠狠點擊下面給點支持吧,站長非常感激您!手機微信長按不能支付解決辦法:請將微信支付二維碼保存到相冊,切換到微信,然后點擊微信右上角掃一掃功能,選擇支付二維碼完成支付。
【本文對您有幫助就好】元
 
					

