HBase —— Hadoop Database的简称 ,hbase 是分布式,稀疏的,持久化的,多维有序映射,它基于行键rowkey,列键column key,时间戳timestamp建立索引。它是一个随机访问的存储和检索数据的平台。hbase 可以存储结构化,半结构化的数据

Hadoop使用分布式文件系统,用于存储大数据,并使用MapReduce来处理。Hadoop擅长于存储各种格式的庞大的数据,任意的格式甚至非结构化的处理。

Hadoop只能执行批量处理,并且只以顺序方式访问数据。这意味着必须搜索整个数据集,即使是最简单的搜索工作。

应用程序,如HBase, Cassandra, couchDB, Dynamo 和 MongoDB 都是一些存储大量数据和以随机方式访问数据的数据库。

HBase是建立在Hadoop文件系统之上的分布式面向列的数据库。它是一个开源项目,是横向扩展的。

HBase是一个数据模型,类似于谷歌的大表设计,可以提供快速随机访问海量结构化数据。它利用了Hadoop的文件系统(HDFS)提供的容错能力。

从功能上来讲,HBase不折不扣是一个数据库,与我们熟悉的Oracle、MySQL、MSSQL等一样,对外提供数据的存储和读取服务。而从应用的角度来说,HBase与一般的数据库又有所区别,HBase本身的存取接口相当简单,不支持复杂的数据存取,更不支持SQL等结构化的查询语言;HBase也没有除了rowkey以外的索引,所有的数据分布和查询都依赖rowkey。所以,HBase在表的设计上会有很严格的要求。架构上,HBase是分布式数据库的典范,这点比较像MongoDB的sharding模式,能根据键值的大小,把数据分布到不同的存储节点上,MongoDB根据configserver来定位数据落在哪个分区上,HBase通过访问Zookeeper来获取-ROOT-表所在地址,通过-ROOT-表得到相应.META.表信息,从而获取数据存储的region位置。

HDFS HBase
HDFS是适于存储大容量文件的分布式文件系统。 HBase是建立在HDFS之上的数据库。
HDFS不支持快速单独记录查找。 HBase提供在较大的表快速查找
它提供了高延迟批量处理;没有批处理概念。 它提供了数十亿条记录低延迟访问单个行记录(随机存取)。
它提供的数据只能顺序访问。 HBase内部使用哈希表和提供随机接入,并且其存储索引,可将在HDFS文件中的数据进行快速查找。

HBase是一个面向列的数据库,在表中它由行排序。表模式定义只能列族,也就是键值对。一个表有多个列族以及每一个列族可以有任意数量的列。后续列的值连续地存储在磁盘上。表中的每个单元格值都具有时间戳。总之,在一个HBase:

  • 表是行的集合。
  • 行是列族的集合。
  • 列族是列的集合。
  • 列是键值对的集合。
行式数据库 列式数据库
它适用于联机事务处理(OLTP)。 它适用于在线分析处理(OLAP)。
这样的数据库被设计为小数目的行和列。 面向列的数据库设计的巨大表。

区别

HBase RDBMS
HBase无模式,它不具有固定列模式的概念;仅定义列族。 RDBMS有它的模式,描述表的整体结构的约束。
它专门创建为宽表。 HBase是横向扩展。 这些都是细而专为小表。很难形成规模。
没有任何事务存在于HBase。 RDBMS是事务性的。
它反规范化的数据。 它具有规范化的数据。
它用于半结构以及结构化数据是非常好的。 用于结构化数据非常好。

hbase的安装配置

下载

http://mirrors.tuna.tsinghua.edu.cn/apache/hbase/2.0.0/hbase-2.0.0-bin.tar.gz

解压后配置hbase-site.xml

<configuration>
<property>
    <name>hbase.rootdir</name>
    <value>hdfs://host:9000/hbase</value>
</property>
<property>
     <name>hbase.cluster.distributed</name>
     <value>true</value>
  </property>
  <property>
    <name>hbase.zookeeper.quorum</name>
    <value>192.168.53.122</value>
  </property>
<!-- 指定HLog和Hfile的副本个数  -->
<property>
    <name>dfs.replication</name>
    <value>1</value>
</property>
<property> 
<name>hbase.master.info.port</name> 
<value>60010</value> 
</property> 
</configuration>

配置环境变量/etc/profile,~/.bashrc

根据实际路径配置

添加

export HBASE_HOME=/root/hbase-2.0.0
export PATH=$HBASE_HOME/bin:$PATH

启动hbase

[root@host bin]# start-hbase.sh
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/root/hbase-2.0.0/lib/slf4j-log4j12-1.7.25.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/root/hadoop/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]
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/root/hbase-2.0.0/lib/slf4j-log4j12-1.7.25.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/root/hadoop/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]
192.168.53.122: running zookeeper, logging to /root/hbase-2.0.0/logs/hbase-root-zookeeper-host.out
192.168.53.122: SLF4J: Class path contains multiple SLF4J bindings.
192.168.53.122: SLF4J: Found binding in [jar:file:/root/hbase-2.0.0/lib/slf4j-log4j12-1.7.25.jar!/org/slf4j/impl/StaticLoggerBinder.class]
192.168.53.122: SLF4J: Found binding in [jar:file:/root/hadoop/hadoop-2.7.4/share/hadoop/common/lib/slf4j-log4j12-1.7.10.jar!/org/slf4j/impl/StaticLoggerBinder.class]
192.168.53.122: SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
192.168.53.122: SLF4J: Actual binding is of type [org.slf4j.impl.Log4jLoggerFactory]
running master, logging to /root/hbase-2.0.0/logs/hbase-root-master-host.out
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/root/hbase-2.0.0/lib/slf4j-log4j12-1.7.25.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/root/hadoop/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]
: running regionserver, logging to /root/hbase-2.0.0/logs/hbase-root-regionserver-host.out
: SLF4J: Class path contains multiple SLF4J bindings.
: SLF4J: Found binding in [jar:file:/root/hbase-2.0.0/lib/slf4j-log4j12-1.7.25.jar!/org/slf4j/impl/StaticLoggerBinder.class]
: SLF4J: Found binding in [jar:file:/root/hadoop/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]

查看hdfs的hbase目录:

-rw-r--r--   1 root supergroup         42 2018-05-14 14:17 /hbase/hbase.id
-rw-r--r--   1 root supergroup          7 2018-05-14 14:17 /hbase/hbase.version
drwxr-xr-x   - root supergroup          0 2018-05-14 14:17 /hbase/mobdir
drwxr-xr-x   - root supergroup          0 2018-05-15 14:37 /hbase/oldWALs

----------------------------------------

启动停止主服务器

使用“local-master-backup.sh”就可以启动多达10台服务器。

[root@host bin]# local-master-backup.sh start 2
running master, logging to /root/hbase-2.0.0/logs/hbase-root-2-master-host.out
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/root/hbase-2.0.0/lib/slf4j-log4j12-1.7.25.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/root/hadoop/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]

要中止备份主服务,需要它的进程ID,它被存储在一个文件名为“/tmp/hbase-USER-X-master.pid”中,可以使用下面的命令中止备份主服务。

[root@host ~]# cat /tmp/hbase-root-2-master.pid
16817

$ cat /tmp/hbase-root-2-master.pid |xargs kill -16817

启动和停止区域服务器

可以使用下面的命令来运行在单一系统中的多个区域的服务器。未测

$ .bin/local-regionservers.sh start 2 3

要停止区域服务器,可以使用下面的命令。

$ .bin/local-regionservers.sh stop 3

启动HBase Shell

[root@host ~]# hbase shell
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/root/hbase-2.0.0/lib/slf4j-log4j12-1.7.25.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/root/hadoop/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
Use "help" to get list of supported commands.
Use "exit" to quit this interactive shell.
Version 2.0.0, r7483b111e4da77adbfc8062b3b22cbe7c2cb91c1, Sun Apr 22 20:26:55 PDT 2018
Took 0.0039 seconds                                                                                                                          
hbase(main):001:0>

HBase的Web界面

hbase-site.xml文件中,端口号配置为60010

界面链接为

http://192.168.53.122:60010

Hbase简介安装配置的更多相关文章

  1. 01 Node.js简介, 安装&配置

    Node.js 简介 Node.js 是什么 Node.js 有着强大而灵活的包管理器(node package manager,npm) 目前, 已经有强大第三方工具模块, 例如数据库连接, 网站开 ...

  2. Hbase的安装配置

    一.上传解压后的Hbase文件. 二.配置: 1..bash_profile文件: export HBASE_HOME=/home/kituser/bigdata/hbase-0.94.6-cdh4. ...

  3. ansible简介安装配置

    ansible简介 ansible是一款,自动化运维管理工具.顾名思义是用于批量去管理及安装服务及批量管理主机. ansible与saltstack对比 ansible优点:配置简单,部署容易除主管理 ...

  4. 【转】hive简介安装 配置常见问题和例子

    原文来自:  http://blog.csdn.net/zhumin726/article/details/8027802 1 HIVE概述 Hive是基于Hadoop的一个数据仓库工具,可以将结构化 ...

  5. HBase 的安装与配置

    实验简介 本次实验学习和了解 HBase 在不同模式下的配置和安装,以及 HBase 后续的启动和停止等. 一.实验环境说明 1. 环境登录 无需密码自动登录,系统用户名shiyanlou,密码shi ...

  6. Linux下DHCP服务安装配置

    简介 安装配置 一.简介 DHCP (Dynamic Host Configuration Protocol,动态主机管理协议)是一种基于UDP协议且仅限用于局域网的网络协议,主要用途是为局域网内部设 ...

  7. Hbase 教程-安装

    HBase安装 安装前设置 安装Hadoop在Linux环境下之前,需要建立和使用Linux SSH(安全Shell).按照下面设立Linux环境提供的步骤. 创建一个用户 首先,建议从Unix创建一 ...

  8. HBase学习笔记之HBase的安装和配置

    HBase学习笔记之HBase的安装和配置 我是为了调研和验证hbase的bulkload功能,才安装hbase,学习hbase的.为了快速的验证bulkload功能,我安装了一个节点的hadoop集 ...

  9. zookeeper工作原理、安装配置、工具命令简介

    1.Zookeeper简介 Zookeeper 是分布式服务框架,主要是用来解决分布式应用中经常遇到的一些数据管理问题,如:统一命名服务.状态同步服务.集群管理.分布式应用配置项的管理等等. 2.zo ...

随机推荐

  1. Hadoop伪分布模式操作

    http://blog.csdn.net/wangloveall/article/details/20195813 摘要:本文介绍Hadoop伪分布模式操作,适合于Hadoop学习.开发和调试. 关键 ...

  2. leetcode:Valid Palindrome【Python版】

    1.注意空字符串的处理: 2.注意是alphanumeric字符: 3.字符串添加字符直接用+就可以: class Solution: # @param s, a string # @return a ...

  3. 转 Katana 项目入门

    Katana 项目入门 Howard Dierking 当 ASP.NET 首次在 2002 年发布时,时代有所不同. 那时,Internet 仍处于起步阶段,大约有 5.69 亿用户,每个用户平均每 ...

  4. mysql增删查改和alter

    盗用两篇文章吧,因为觉得别人总结的已经够好了 http://blog.csdn.net/evankaka/article/details/45580845 http://www.blogjava.ne ...

  5. 用 c 写 CGI 程序简要指南

    文章摘要:  CGI规定了Web服务器调用其他可执行程序(CGI程 序)的接口协议标准.Web服务器通过调用CGI程序实现和Web浏览器的交互.CGI程序可以用任何程序设计语言编写,如Shell脚本语 ...

  6. ORTP库移植

    转载,侵删 1.ORTP的引入 为什么要使用RTP:http://blog.51cto.com/ticktick/462746RTP协议分析:http://www.xuebuyuan.com/7399 ...

  7. html 子元素和父元素都监听了 click 事件,点击子元素时为何先触发的是父元素的 click 事件?

    先上一段代码,点击子元素时先触发的是父元素的 click 事件 <html> <head> <script type="text/javascript" ...

  8. CXF运行wsdl2java :找不到系统路径

    已经配置好cxf的环境变量出现 解决方法:一定要设置JAVA_HOME这个变量

  9. PHP-redis api 中文说明(转)

    来源 : http://hi.baidu.com/gaolamp/item/1686aac07334bd0f0ad93a9f PHP-redis api 中文说明 phpredis 是 php 的一个 ...

  10. vs2015 去除 git 源代码 绑定,改成向tfs添加源码管理

    除了下文的方法是将源码管理从git改成tfs之外,还要做以下几步即可 向tfs添加源码 打开源码管理(管理连接),双击打开你要向其中添加的tfs连接 选中该解决方案,右键 将解决方案添加到源码管理 嵌 ...