Hbase分散式安裝部署過程

dbasdk發表於2014-07-03

 

系統

Red hat linux 6.4

Hadoop版本

1.2.1

Hbase版本

0.94.16

 

Hbase的完全分散式安裝概述:

         1. 配置hosts,確保涉及的主機名均可解析為ip

         2. 編輯hbase-env.xml

         3. 編輯hbase-site.xml

         4. 編輯regionservers檔案,檔案預設內容是localhost

/home/grid/hbase/conf/regionservers,將所有的slavenode新增到這個檔案

         5. Hbase複製到其他節點

         6. 啟動Hbase

         7. 驗證

 

備註:我選擇的版本不存在堅容性問題,所以無需覆蓋core jar包

選擇HadoopHbase版本不同,可能會有不相容的情況

例如Hadoop 0.20

解決版本、jar包衝突:

1)刪除hbase/lib/hadoop-core-0.20-append-r1056497.jar(備份到其它路徑,以備萬一);

2)拷貝hadoop/hadoop-core-0.20.203.0.jar(注意是hadoop根目錄下)hadoop/lib/commons-collections-3.2.1.jarhadoop/lib/commons-configuration-1.6.jarhbase/lib

 

Setp 1 下載解壓hbase

 

Step 2 修改配置檔案

 

第一個檔案:/home/zhang/hbase/hbase-0.94.16/conf/hbase-env.sh

 


 


 

Step 3 設定環境變數


 

 

Step 4 配置/hbase/hbase-0.94.16/conf/hbase-site.xml

模板檔案路徑:~/hbase/hbase-0.94.16/src/main/resources/hbase-default.xml

拷貝需要的內容

新增修改到hbase-site.xml檔案,內容如下:


hbase.rootdir :存放資料目錄

 

    hbase.rootdir

    hdfs://node01:9000/hbase

 

開啟分佈模式:

 

    hbase.cluster.distributed

    true

 

設定臨時檔案目錄:

 

    hbase.tmp.dir

    /home/criss/hbase/tmp

 

新增Zookeeper的節點主機名:

    hbase.zookeeper.quorum

    node01,node02,node03

 

 

    hbase.zookeeper.property.dataDir

    /home/criss/hbase/tmp/zookeeper

    Property from ZooKeeper's config zoo.cfg.

    The directory where the snapshot is stored.

   

 

 

Step 5 編輯/home/grid/hbase/conf/regionservers,將所有的slavenode新增到這個檔案


我在hbase-site.xml 沒有配置hmater,所以這裡吧3臺機都新增進去了

 

Step6Hbase拷貝到其他節點機並對其他節點機配置環境變數

scp -r hbase/ node03:/home/criss/hbase

scp -r hbase/ node02:/home/criss/hbase

 

Step 7 啟動Hbase


 

Step 8驗證HMaster

Node01主機:


驗證Node03Node02主機:


 

 

Step 9 測試Hbase shell

Create  ‘test’,’data’

Disable ‘test’

Dorp ‘test’

 


 

可以檢視下tmp資料夾下生成的內容:


 

 

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/28929558/viewspace-1204409/,如需轉載,請註明出處,否則將追究法律責任。

相關文章