文档章节

Hadoop HBase

manonline
 manonline
发布于 2017/07/25 00:27
字数 385
阅读 4
收藏 0

Comparison

RDBMS

HBase

Overview

Master

HBase Master Node orchestrates a cluster of one or more Region Servers

  • Bootstrap a virgin install
  • Assign regions to Region Servers
  • Recover Region Server failure

Region Server

  • Carry regions
  • Respond to client read/write requests
  • Inform Master Node the new region

Zookeeper

The authority on cluster state. The Zookeeper ensemble hosts vital:

  • Location of the hbase:meta table
  • Address of Master
  • Host the assignment transaction state (for recovery purpose)

Client

When bootstrapping a client connection to HBase cluster, the client must be passed the location of Zookeeper ensemble. Thereafter, client navigates the ZooKeeper hierarchy to learn about cluster attributes  

hbase:meta

HBase keep a special catalog table named hbase:meta, within which it maintains the current list, state and locations of all user-space regions afloat on the cluster. Entries in hbase:meta are keyed by region name, which is 

  • table_name,start_row,creation_time.MD5(table_namestart_rowcreation_time).

Fresh clients connect to the ZooKeeper cluster first to learn the location of hbase:meta. The client then does a lookup against the appropriate hbase:meta region to figure out the hosting user-space region and its location. Thereafter, the client interacts directly with the hosting region server.

As region transitions - split, disabled, enabled, deleted or redeployed, the catalog table is updated.

HBase Commands

By default, HBase writes to /${java.io.tmpdir}/hbase-${user.name}.${java.io.tmpdir} usually maps to /tmp, but you should configure HBase to use a more permanent location by setting hbase.tmp.dir in hbase-site.xml. In standalone mode, the HBase master, the regionserver, and a Zookeeper instance are all run in the same JVM.

  • HBase Shell
%hbase shell

# Create a table with one column family (with default column family attributes)
hbase(main):001:0>create 'table_name', 'column_family_name'

# Display tables 
hbase(main):002:0>list

# Insert some data
hbase(main):003:0>put 'table_name' 'row1', 'column_family_name:column_name', 'value1'
hbase(main):004:0>put 'table_name' 'row2', 'column_family_name:column_name', 'value2'
hbase(main):005:0>put 'table_name' 'row3', 'column_family_name:column_name', 'value3'

# Get a particular row with the row key
hbase(main):006:0>get 'table_name' 'row1'

# List the table content
hbase(main):007:0>scan 'table_name'

Client

Java Client, REST, Thrift and MapReduce API.

Load Data

For a large dataset, first, copy the raw file into HDFS, and then run a MapReduce job that can read the input and write to HBase.

 

© 著作权归作者所有

共有 人打赏支持
manonline
粉丝 0
博文 73
码字总数 66740
作品 0
2018-08-16期 HBase全分布模式集群及HMaster HA安装部署

一、安装介质 http://archive.apache.org/dist/hbase hbase-0.96.2-hadoop2-bin.tar.gz 二、安装JDK: [root@hadoop-server01 bin]# mkdir -p /usr/local/apps [root@hadoop-server01 bin]#......

JackmaSong
08/16
0
0
Hadoop2.x下安装HBase

环境:CentOS6.5 Hadoop2.5.2 HBase1.0.0 1.安装好 hadoop 集群,并启动 [grid@hadoop4 ~]$ sh hadoop-2.5.2/sbin/start-dfs.sh [grid@hadoop4 ~]$ sh hadoop-2.5.2/sbin/start-yarn.sh 查看......

张超
2015/03/19
0
3
Sqoop数据导入到HBase遇上的问题及解决方法

  【IT168 技术】运行bin/sqoop import --connect jdbc:mysql://ip:port/database --username * --password **--hbase-bulkload --hbase-create-table --column-family info --hbase-row-k......

中国大数据
05/31
0
0
hadoop及hbase集群启停的几种方式

1、生产环境集群 2、web管理页面 hadoop web管理页面(主备) http://192.168.10.101:50070 http://192.168.10.102:50070 hbase web管理页面(主备) http://192.168.10.101:16010 http://1......

断臂人
06/07
0
0
bulk-load装载hdfs数据到hbase小结

bulk-load的作用是用mapreduce的方式将hdfs上的文件装载到hbase中,对于海量数据装载入hbase非常有用,参考http://hbase.apache.org/docs/r0.89.20100621/bulk-loads.html: hbase提供了现成...

超人学院
2015/06/01
0
0

没有更多内容

加载失败,请刷新页面

加载更多

OSChina 周日乱弹 —— 恨不得给你买张飞机挂票

Osc乱弹歌单(2018)请戳(这里) 【今日歌曲】 @开源中国首席灵魂师:分享张希/曹方的单曲《认真地老去》 来不及认真的年轻过,就认真的老去! 《认真地老去》- 张希/曹方 手机党少年们想听...

小小编辑
今天
132
6
如何实现靠谱的分布式锁?

分布式锁,是用来控制分布式系统中互斥访问共享资源的一种手段,从而避免并行导致的结果不可控。基本的实现原理和单进程锁是一致的,通过一个共享标识来确定唯一性,对共享标识进行修改时能够...

郑加威
今天
1
0
Mac OS X下Maven的安装与配置

Mac OS X 安装Maven: 下载 Maven, 并解压到某个目录。例如/Users/robbie/apache-maven-3.3.3 打开Terminal,输入以下命令,设置Maven classpath $ vi ~/.bash_profile 添加下列两行代码,之后...

TonyStarkSir
今天
3
0
关于编程,你的练习是不是有效的?

最近由于工作及Solution项目的影响,我在重新学习DDD和领域建模的一些知识。然后,我突然就想到了这个问题,以及我是怎么做的? 对于我来说,提升技能的项目会有四种: 纯兴趣驱动的项目。即...

问题终结者
今天
9
0
打开eclipse出现an error has occurred see the log file

解决方法: 1,打开eclipse安装目录下的eclipse.ini文件; 2,打开的文本文件最后添加一行 --add-modules=ALL-SYSTEM 3,保存重新打开Eclipse。...

任梁荣
昨天
4
0

没有更多内容

加载失败,请刷新页面

加载更多

返回顶部
顶部