記HBase叢集安裝

denglt發表於2014-12-16

HBase實驗環境:


172.16.110.133 laodeng3.localdomain
172.16.110.132 laodeng2.localdomain
172.16.110.134 laodeng4.localdomain

使用者:hbase  password:hbase


Node Name          Master    Zookeeper    RegionServer
172.16.110.133       Y          Y               N
172.16.110.134      backup      Y               Y
172.16.110.132       N          Y               Y

下載hbase的安裝包
 http://mirror.bit.edu.cn/apache/hbase/hbase-0.98.8/hbase-0.98.8-hadoop2-bin.tar.gz


步驟
一、Password-Less SSH Access
 1、配置133 到134、132 的 hbase使用者Password-Less SSH Access
 
 2、134為backup master
    配置在134-〉133的hbase使用者Password-Less SSH Access
 

二、133上的配置
  安裝jdk  1.6 (其他兩個節點也要安裝,並配置JAVA_HOME)
 
  安裝hbase :tar xzvf  hbase-0.98.8-hadoop2-bin.tar.gz  到/opt/hbase
 
 
  1、配置RegionServer
     vi conf/regionservers
     laodeng2.localdomain
     laodeng4.localdomain
  2、配置a backup master
     Create a new file in conf/ called backup-masters
      vi conf/backup-masters
      增加laodeng4.localdomain
     
  3、配置Zookeeper  (更多配置參考:http://hbase.apache.org/book/zookeeper.html
    vi conf/hbase-site.xml
  
      hbase.rootdir
      hdfs://172.16.110.133:9000/hbase
  

  
    hbase.cluster.distributed
    true
  
   
  
    hbase.zookeeper.quorum
    laodeng2.localdomain,laodeng3.localdomain,laodeng4.localdomain
  

  
    hbase.zookeeper.property.dataDir
    /usr/local/zookeeper
  
  
  
  注意:hbase使用者在/usr/local上要有寫許可權
  注意:zookeeper跑在三個節點上,故還需要在133上打通自身的Password-Less SSH Access
 4、配置JAVA_HOME
   vi  conf/hbase-env.sh
   export JAVA_HOME=/usr/java/jdk1.6.0_45
  
  5、遠端釋出hbase到132、134上 
  [hbase@laodeng3 opt]$ scp -r hbase hbase@laodeng4.localdomain:/opt
  [hbase@laodeng3 opt]$ scp -r hbase hbase@laodeng2.localdomain:/opt
 
三、啟動和測試Hbase Cluster
   
[hbase@laodeng3 hbase]$ ./bin/start-hbase.sh
laodeng3.localdomain: starting zookeeper, logging to /opt/hbase/bin/../logs/hbase-hbase-zookeeper-laodeng3.localdomain.out
laodeng2.localdomain: starting zookeeper, logging to /opt/hbase/bin/../logs/hbase-hbase-zookeeper-laodeng2.localdomain.out
laodeng4.localdomain: starting zookeeper, logging to /opt/hbase/bin/../logs/hbase-hbase-zookeeper-laodeng4.localdomain.out
starting master, logging to /opt/hbase/bin/../logs/hbase-hbase-master-laodeng3.localdomain.out
laodeng2.localdomain: starting regionserver, logging to /opt/hbase/bin/../logs/hbase-hbase-regionserver-laodeng2.localdomain.out
laodeng4.localdomain: starting regionserver, logging to /opt/hbase/bin/../logs/hbase-hbase-regionserver-laodeng4.localdomain.out
laodeng4.localdomain: starting master, logging to /opt/hbase/bin/../logs/hbase-hbase-master-laodeng4.localdomain.out 

結果:
[hbase@laodeng3 hbase]$ jps
9893 Jps
9649 HMaster
9584 HQuorumPeer

[hbase@laodeng4 ~]$ jps
12183 HMaster
11948 HQuorumPeer
12398 Jps
12067 HRegionServer

[hbase@laodeng2 ~]$ jps
20800 HRegionServer
20689 HQuorumPeer
21006 Jps


可以查詢到我在偽叢集實驗時建立的表:
[hbase@laodeng3 hbase]$ ./bin/hbase shell
2014-12-16 10:55:32,559 INFO  [main] Configuration.deprecation: hadoop.native.lib is deprecated. Instead, use io.native.lib.available
HBase Shell; enter 'help' for list of supported commands.
Type "exit" to leave the HBase Shell
Version 0.98.8-hadoop2, r6cfc8d064754251365e070a10a82eb169956d5fe, Fri Nov 14 18:26:29 PST 2014

hbase(main):001:0> list
TABLE                                                                                                                              
2014-12-16 10:55:39,772 WARN  [main] util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
denglt                                                                                                                             
denglt2                                                                                                                            
2 row(s) in 2.4780 seconds

=> ["denglt", "denglt2"]
hbase(main):002:0> scan 'denglt'
ROW                                COLUMN+CELL                                                                                     
 1                                 column=info:age, timestamp=1418457735162, value=38                                              
 1                                 column=info:name, timestamp=1418457663195, value=dlt                                            
 3                                 column=info:name, timestamp=1418458734676, value=zyy                                            
2 row(s) in 0.2840 seconds


web管理:
http://172.16.110.133:60010/master-status

http://172.16.110.134:60010/

http://172.16.110.132:60030/rs-status

http://172.16.110.134:60030/rs-status

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

相關文章