hbase2.0.4完全分散式環境搭建

z597011036發表於2015-01-08

安裝文件:


1.下載安裝

[root@node1 ~]# wget

[root@node1 ~]# tar xvf hbase-2.0.4-bin.tar.gz -C /opt/

[root@node1 conf]# vim hbase-site.xml 


  
    hbase.rootdir
    hdfs://mycluster:8020/hbase    --寫HDFS地址
  
  
    hbase.cluster.distributed   --開啟hbase叢集
    true
  
  
    hbase.zookeeper.quorum     --zookeeper主機名
    node1,node2,node3
  

[root@node1 conf]# vim regionservers        --資料節點的主機名

node1

node2

node3

node4

[root@node1 conf]# vim hbase-env.sh 

export HBASE_CLASSPATH=/opt/hadoop-2.8.5/etc/hadoop/

export JAVA_HOME=/usr/java/jdk1.8.0_202-amd64/

[root@node1 conf]# cd /opt/

[root@node1 opt]# scp -r /opt/hbase-2.0.4 node2:/opt/

[root@node1 opt]# scp -r /opt/hbase-2.0.4 node3:/opt/

[root@node1 opt]# scp -r /opt/hbase-2.0.4 node4:/opt/

[root@node1 opt]# vim /etc/profile

export HBASE_HOME=/opt/hbase-2.0.4

export PATH=$PATH:$HABSE_HOME/bin

[root@node1 opt]# source /etc/profile


2.啟動hbase服務

[root@node1 opt]# cd hbase-2.0.4/bin/

[root@node1 bin]# ./start-hbase.sh 

SLF4J: Class path contains multiple SLF4J bindings.

SLF4J: Found binding in [jar:file:/opt/hbase-2.0.4/lib/slf4j-log4j12-1.7.25.jar!/org/slf4j/impl/StaticLoggerBinder.class]

SLF4J: Found binding in [jar:file:/opt/hadoop-2.8.5/share/hadoop/common/lib/slf4j-log4j12-1.7.10.jar!/org/slf4j/impl/StaticLoggerBinder.class]

SLF4J: See for an explanation.

SLF4J: Actual binding is of type [org.slf4j.impl.Log4jLoggerFactory]

SLF4J: Class path contains multiple SLF4J bindings.

SLF4J: Found binding in [jar:file:/opt/hbase-2.0.4/lib/slf4j-log4j12-1.7.25.jar!/org/slf4j/impl/StaticLoggerBinder.class]

SLF4J: Found binding in [jar:file:/opt/hadoop-2.8.5/share/hadoop/common/lib/slf4j-log4j12-1.7.10.jar!/org/slf4j/impl/StaticLoggerBinder.class]

SLF4J: See for an explanation.

SLF4J: Actual binding is of type [org.slf4j.impl.Log4jLoggerFactory]

node1: running zookeeper, logging to /opt/hbase-2.0.4/bin/../logs/hbase-root-zookeeper-node1.out

node2: running zookeeper, logging to /opt/hbase-2.0.4/bin/../logs/hbase-root-zookeeper-node2.out

node3: running zookeeper, logging to /opt/hbase-2.0.4/bin/../logs/hbase-root-zookeeper-node3.out

running master, logging to /opt/hbase-2.0.4/logs/hbase-root-master-node1.out

node1: running regionserver, logging to /opt/hbase-2.0.4/bin/../logs/hbase-root-regionserver-node1.out

node3: running regionserver, logging to /opt/hbase-2.0.4/bin/../logs/hbase-root-regionserver-node3.out

node4: running regionserver, logging to /opt/hbase-2.0.4/bin/../logs/hbase-root-regionserver-node4.out

node2: running regionserver, logging to /opt/hbase-2.0.4/bin/../logs/hbase-root-regionserver-node2.out

[root@node1 bin]# 


3.使用hbase shell命令

[root@node1 bin]# ./hbase shell

HBase Shell

Use "help" to get list of supported commands.

Use "exit" to quit this interactive shell.

For Reference, please visit:

Version 2.0.4, r205e39c5704bf38568b34926dde9f1ee76e6b5d0, Fri Dec 28 22:13:42 PST 2018

Took 0.0048 seconds                                                                                                                              

hbase(main):001:0> create 't1','q1','w1','e1'     --建立t1表

Created table t1

Took 3.0584 seconds                                                                                                                              

=> Hbase::Table - t1

hbase(main):002:0> 


4.web頁面訪問

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

相關文章