Hbase集群的详细安装配置教程


简介:本篇博客是介绍怎么安装配置Hbase集群的,主要内容包括Hbase的相关网址,Hbase集群安装部署详细教程,Hbase集群高可用配置等。


Hbase相关网址

1、Hbase官网:https://hbase.apache.org/
2、Hbase下载地址:https://hbase.apache.org/downloads.html
2、Hbase相关安装部署操作文档:

Hbase安装部署

Hbase解压和配置环境变量

  • 解压Hbase压缩包
[lqs@bdc112 software]$ tar -zxvf hbase-2.0.5-bin.tar.gz -C /home/lqs/module
  • 配置环境变量
[lqs@bdc112 bin]$ sudo vim /etc/profile.d/my_env.sh
#HBASE_HOME
export HBASE_HOME=/home/lqs/module/hbase-2.0.5
export PATH=$PATH:$HBASE_HOME/bin

配置文件

1.hbase-env.sh修改内容:

[lqs@bdc112 conf]$ pwd
/home/lqs/module/hbase-2.0.5/conf
[lqs@bdc112 conf]$ vim hbase-env.sh
export HBASE_MANAGES_ZK=false

在这里插入图片描述

  • hbase-site.xml修改内容
[lqs@bdc112 conf]$ vim hbase-site.xml
<configuration>

    <property>
        <name>hbase.rootdir</name>
        <value>hdfs://bdc112:8020/hbase</value>
    </property>

    <property>
        <name>hbase.cluster.distributed</name>
        <value>true</value>
    </property>

    <property>
        <name>hbase.zookeeper.quorum</name>
        <value>bdc112,bdc113,bdc114</value>
    </property>

</configuration>
  • regionservers 修改
[lqs@bdc112 conf]$ vim regionservers 

添加如下内容:

bdc112
bdc113
bdc114

分发Hbase到其它节点

[lqs@bdc112 module]$ xsync hbase-2.0.5/

Hbase服务启动

注意:启动Hbase前一定要启动hadoop集群和Zookeeper集群!!!

1、单点启动

[lqs@bdc112 hbase-2.0.5]$ bin/hbase-daemon.sh start master

[lqs@bdc112 hbase-2.0.5]$ bin/hbase-daemon.sh start master regionserver

2、群启

[lqs@bdc112 hbase-2.0.5]$ start-hbase.sh 
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/home/lqs/module/hbase-2.0.5/lib/slf4j-log4j12-1.7.25.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/home/lqs/module/hadoop-3.1.3/share/hadoop/common/lib/slf4j-log4j12-1.7.25.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]
running master, logging to /home/lqs/module/hbase-2.0.5/logs/hbase-lqs-master-bdc112.out
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/home/lqs/module/hbase-2.0.5/lib/slf4j-log4j12-1.7.25.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/home/lqs/module/hadoop-3.1.3/share/hadoop/common/lib/slf4j-log4j12-1.7.25.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]
bdc112: running regionserver, logging to /home/lqs/module/hbase-2.0.5/logs/hbase-lqs-regionserver-bdc112.out
bdc113: running regionserver, logging to /home/lqs/module/hbase-2.0.5/bin/../logs/hbase-lqs-regionserver-bdc113.out
bdc114: running regionserver, logging to /home/lqs/module/hbase-2.0.5/bin/../logs/hbase-lqs-regionserver-bdc114.out

3、群停

[lqs@bdc112 ~]$ stop-hbase.sh 
stopping hbase..........
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/home/lqs/module/hbase-2.0.5/lib/slf4j-log4j12-1.7.25.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/home/lqs/module/hadoop-3.1.3/share/hadoop/common/lib/slf4j-log4j12-1.7.25.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页面

启动成功后,可以通过“host:port”的方式来访问HBase管理页面,例如:

http://bdc112:16010 

页面如下:
在这里插入图片描述

配置HBase集群的高可用

意义或者是作用:
在HBase中HMaster负责监控HRegionServer的生命周期,均衡RegionServer的负载,如果HMaster挂掉了,那么整个HBase集群将陷入不健康的状态,并且此时的工作状态并不会维持太久。所以HBase支持对HMaster的高可用配置。

1、关闭Hbase集群,没有开启不用管
stop-hbase.sh(需要配置好环境变量,否则只能在hbase的bin下用)
2、在conf目录下创建backup-masters文件

[lqs@bdc112 conf]$ pwd
/home/lqs/module/hbase-2.0.5/conf
[lqs@bdc112 conf]$  vim backup-masters

输入:bdc1113
注意:这个备份节点可以设置多个,且可以任意设置

3、分发到集群的其他节点

[lqs@bdc112 conf]$ pwd
/home/lqs/module/hbase-2.0.5/conf
[lqs@bdc112 conf]$ xsync backup-masters 
==================== bdc112 ====================
sending incremental file list

sent 62 bytes  received 12 bytes  148.00 bytes/sec
total size is 7  speedup is 0.09
==================== bdc113 ====================
sending incremental file list
backup-masters

sent 116 bytes  received 35 bytes  302.00 bytes/sec
total size is 7  speedup is 0.05
==================== bdc114 ====================
sending incremental file list
backup-masters

sent 116 bytes  received 35 bytes  100.67 bytes/sec
total size is 7  speedup is 0.05

4、重新群启Hbase

[lqs@bdc112 conf]$ start-hbase.sh 
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/home/lqs/module/hbase-2.0.5/lib/slf4j-log4j12-1.7.25.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/home/lqs/module/hadoop-3.1.3/share/hadoop/common/lib/slf4j-log4j12-1.7.25.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]
running master, logging to /home/lqs/module/hbase-2.0.5/logs/hbase-lqs-master-bdc112.out
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/home/lqs/module/hbase-2.0.5/lib/slf4j-log4j12-1.7.25.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/home/lqs/module/hadoop-3.1.3/share/hadoop/common/lib/slf4j-log4j12-1.7.25.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]
bdc112: running regionserver, logging to /home/lqs/module/hbase-2.0.5/logs/hbase-lqs-regionserver-bdc112.out
bdc113: running regionserver, logging to /home/lqs/module/hbase-2.0.5/bin/../logs/hbase-lqs-regionserver-bdc113.out
bdc114: running regionserver, logging to /home/lqs/module/hbase-2.0.5/bin/../logs/hbase-lqs-regionserver-bdc114.out
bdc113: running master, logging to /home/lqs/module/hbase-2.0.5/bin/../logs/hbase-lqs-master-bdc113.out

截图如下:
在这里插入图片描述

  • 1
    点赞
  • 24
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

小雏菊的成长

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值