Hbase伪分布式集群搭建


环境准备

  • 一台Linux虚拟机
    我用的CentOS-6.6的一个虚拟机,主机名为repo
    参考在Windows中安装一台Linux虚拟机
  • hbase安装包
    下载地址:https://mirrors.aliyun.com/apache/hbase/
    我用的hbase-1.2.6

1. 把hbase安装包上传到服务器并解压

[root@repo ~]# tar -zxvf hbase-1.2.6-bin.tar.gz -C /opt/

2. 配置HBASE_HOME环境变量

[root@repo ~]# vim /etc/profile

export HBASE_HOME=/opt/hbase-1.2.6
export PATH=$PATH:$HBASE_HOME/bin

[root@repo ~]# source /etc/profile

3. 修改hbase-env.sh配置文件,加入JAVA_HOME

hbase的配置文件在HBASE_HOME/conf下

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

export JAVA_HOME=/usr/local/java/jdk1.8.0_73

4. 修改hbase-site.xml配置文件

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


    
    
        hbase.rootdir
        file:///var/hbase/local
    
    
    
        hbase.zookeeper.property.dataDir
        /var/hbase/local/zookeeper
    

5. 启动hbase

[root@repo ~]# start-hbase.sh

6. 测试能否进去hbase命令行

[root@repo ~]# hbase shell
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/opt/hbase-1.2.6/lib/slf4j-log4j12-1.7.5.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/opt/hadoop-2.7.4/share/hadoop/common/lib/slf4j-log4j12-1.7.10.jar!/org/slf4j/impl/StaticLoggerBinder.class]SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.slf4j.impl.Log4jLoggerFactory]
HBase Shell; enter 'help' for list of supported commands.
Type "exit" to leave the HBase Shell
Version 1.2.6, rUnknown, Mon May 29 02:25:32 CDT 2017

hbase(main):001:0> 

hbase伪分布式集群搭建成功!

你可能感兴趣的:(Hbase伪分布式集群搭建)