前言
HBase是Hadoop家族中的一个分布式数据库产品,HBase支持高并发读写,列式数据存储,高效的索引,自动分片,自动Region迁移等许多优点,已经越来越多的被界业认可并实施。
目录
- 在Ubuntu中环境准备
- HBase安装
- Thrift安装
1 在Ubuntu中环境准备
HBase是基于Java开发的运行Hadoop平台上分布式NoSQL数据库软件,HBase没有提供Windows系统安装版本。我在这里也只介绍HBase在Linux Ubuntu系统中的安装。
由于HBase是运行在Hadoop平台上面的,因此我们需要先安装好Hadoop的环境,Hadoop的安装请参考文章:[Hadoop历史版本安装](http://blog.fens.me/hadoop-history-source-install/)
HBase没有提供apt的软件源安装,我们需要自己去官方网络下载HBase软件包进行安装。HBase下载页:http://www.apache.org/dyn/closer.cgi/hbase/
系统环境:
- Linux Ubuntu 12.04.2 LTS 64bit server
- Java JDK 1.6.0_45
- Hadoop 1.1.2
2 HBase安装
2.1 下载HBase
# 通过wget命令下载
~ wget http://www.gaidso.com/apache/hbase/stable/hbase-0.94.18.tar.gz
# 解压HBase
~ tar xvf hbase-0.94.18.tar.gz
# 移动HBase目录到文件夹
~ mv hbase-0.94.18/ /home/conan/hadoop/
# 进入目录
~ cd /home/conan/hadoop/hbase-0.94.18
2.2 配置HBase
2.2.1 修改启动文件hbase-env.sh
~ vi conf/hbase-env.sh
#打开注释
export JAVA_HOME=/home/conan/toolkit/jdk16
export HBASE_CLASSPATH=/home/conan/hadoop/hadoop-1.1.2/conf
export HBASE_MANAGES_ZK=true
2.2.2 修改配置文件 hbase-site.xml
~ vi conf/hbase-site.xml
<configuration>
<property>
<name>hbase.rootdir</name>
<value>hdfs://master:9000/hbase</value>
</property>
<property>
<name>hbase.cluster.distributed</name>
<value>true</value>
</property>
<property>
<name>dfs.replication</name>
<value>1</value>
</property>
<property>
<name>hbase.zookeeper.quorum</name>
<value>master</value>
</property>
<property>
<name>hbase.zookeeper.property.clientPort</name>
<value>2181</value>
</property>
<property>
<name>hbase.zookeeper.property.dataDir</name>
<value>/home/conan/hadoop/hdata</value>
</property>
</configuration>
复制hadoop环境的配置文件和类库
~ cp ~/hadoop/hadoop-1.1.2/conf/hdfs-site.xml conf/
~ cp ~/hadoop/hadoop-1.1.2/hadoop-core-1.1.2.jar lib/
~ mkdir /home/conan/hadoop/hdata
2.3 启动hadoop和hbase
~ /home/conan/hadoop/hadoop-1.1.2/bin/start-all.sh
~ /home/conan/hadoop/hbase-0.94.18/bin/start-hbase.sh
# 查看hbase进程
~ jps
13838 TaskTracker
13541 JobTracker
15946 HMaster
16756 Jps
12851 NameNode
13450 SecondaryNameNode
13133 DataNode
15817 HQuorumPeer
16283 HRegionServer
2.4 打开HBase命令行客户端访问Hbase
~ bin/hbase shell
HBase Shell; enter 'help' for list of supported commands.
Type "exit" to leave the HBase Shell
Version 0.94.18, r1577788, Sat Mar 15 04:46:47 UTC 2014
hbase(main):002:0> help
HBase Shell, version 0.94.18, r1577788, Sat Mar 15 04:46:47 UTC 2014
Type 'help "COMMAND"', (e.g. 'help "get"' -- the quotes are necessary) for help on a specific command.
Commands are grouped. Type 'help "COMMAND_GROUP"', (e.g. 'help "general"') for help on a command group.
COMMAND GROUPS:
Group name: general
Commands: status, version, whoami
Group name: ddl
Commands: alter, alter_async, alter_status, create, describe, disable, disable_all, drop, drop_all, enable, enable_all, exists, is_disabled, is_enabled, list, show_filters
Group name: dml
Commands: count, delete, deleteall, get, get_counter, incr, put, scan, truncate
Group name: tools
Commands: assign, balance_switch, balancer, close_region, compact, flush, hlog_roll, major_compact, move, split, unassign, zk_dump
Group name: replication
Commands: add_peer, disable_peer, enable_peer, list_peers, list_replicated_tables, remove_peer, start_replication, stop_replication
Group name: snapshot
Commands: clone_snapshot, delete_snapshot, list_snapshots, restore_snapshot, snapshot
Group name: security
Commands: grant, revoke, user_permission
SHELL USAGE:
Quote all names in HBase Shell such as table and column names. Commas delimit
command parameters. Type after entering a command to run it.
Dictionaries of configuration used in the creation and alteration of tables are
Ruby Hashes. They look like this:
{'key1' => 'value1', 'key2' => 'value2', ...}
and are opened and closed with curley-braces. Key/values are delimited by the
'=>' character combination. Usually keys are predefined constants such as
NAME, VERSIONS, COMPRESSION, etc. Constants do not need to be quoted. Type
'Object.constants' to see a (messy) list of all constants in the environment.
If you are using binary keys or values and need to enter them in the shell, use
double-quote'd hexadecimal representation. For example:
hbase> get 't1', "key\x03\x3f\xcd"
hbase> get 't1', "key\003\023\011"
hbase> put 't1', "test\xef\xff", 'f1:', "\x01\x33\x40"
The HBase shell is the (J)Ruby IRB with the above HBase-specific commands added.
For more on the HBase Shell, see http://hbase.apache.org/docs/current/book.html
2.5 HBase简单命令操作
#创建一个新表student
hbase(main):003:0> create 'student','info'
0 row(s) in 1.2680 seconds
#查看所有的表
hbase(main):004:0> list
TABLE
student
1 row(s) in 0.0330 seconds
#查看student的表结构
hbase(main):005:0> describe 'student'
DESCRIPTION ENABLED
'student', {NAME => 'info', DATA_BLOCK_ENCODING => 'NONE', true
BLOOMFILTER => 'NONE', REPLICATION_SCOPE => '0', VERSIONS
=> '3', COMPRESSION => 'NONE', MIN_VERSIONS => '0', TTL =
> '2147483647', KEEP_DELETED_CELLS => 'false', BLOCKSIZE =
> '65536', IN_MEMORY => 'false', ENCODE_ON_DISK => 'true',
BLOCKCACHE => 'true'}
1 row(s) in 0.1100 seconds
#同student表中插入一条数据
hbase(main):007:0> put 'student','mary','info:age','19'
0 row(s) in 0.0490 seconds
#从student表中取出mary的数据
hbase(main):008:0> get 'student','mary'
COLUMN CELL
info:age timestamp=1396366643298, value=19
1 row(s) in 0.0190 seconds
#让student表失效
hbase(main):009:0> disable 'student'
0 row(s) in 1.2400 seconds
#列出所有表
hbase(main):010:0> list
TABLE
student
1 row(s) in 0.0310 seconds
#删除student表
hbase(main):013:0> drop 'student'
0 row(s) in 1.1100 seconds
#列出所有表
hbase(main):014:0> list
TABLE
相关推荐
虚拟机中详细配置hbase
基于Ubuntu安装Hbase环境。亲测编写,步骤清晰明了,很适合大数据学习爱好者搭建Hbase环境。包括:系统环境,安装步骤(配置文件,hadoop软链接,时钟同步),服务启停等。
hbase2.0环境搭建,ubuntu16.04操作系统下安装配置hbase2.0
ubuntu上的Hbase安装教程
ubuntu系统部署完全分布式hadoop时,先部署了zookeeper和hbase
jdk1.8+hadoop2.7.3+hbase1.2.6在ubuntu14.06上安装步骤,在这里,没有说明ubuntu的安装步骤,读者要先将ubuntu安装好,然后将需要的安装包分别到官网下载准备。
批量执行hbase shell 命令 #!/bin/bash source /etc/profile exec $HBASE_HOME/bin/hbase shell <<EOF truncate 'tracker_total_apk_fact_zyt' major_compact('t_abc') disable 't_abc' drop 't_abc' create...
1. 【服务器】获取阿云ECS 2. 【服务器】了解快照 4. 配置SSH密码登陆 6. 【服务器】图形化界 9. 参考资料 1. 【服务器】获取阿云ECS 2
ubuntu10, JDK, hadoop, hbase安装白皮书,其它相关云计算等技术可参观我的论坛: http://www.vikirobot.com:8080/thread.php?fid=22
1. 【服务器】获取阿云ECS 2. 【服务器】了解快照 4. 配置SSH密码登陆 6. 【服务器】图形化界 9. 参考资料 1. 【服务器】获取阿云ECS 2
使用github中最新的nutch-2.x源码,奋战10天拿下的Hadoop-2.4.0+Hbase-0.94.18+Nutch-2.3配置攻略,在ubuntu14.04上成功运行本地和分布式爬虫。文档详细描述了三者版本不兼容问题的解决方案以及各个配置文件的详细...
1. 理解HBase在Hadoop体系结构中的角色; 2. 熟练使用HBase操作常用的Shell命令; 3. 熟悉HBase操作常用的Java API。 二、实验平台 1. 操作系统:Linux(建议Ubuntu16.04或Ubuntu18.04); 2. Hadoop版本:3.1.3; 3...
资源名称:hadoop2完全分布式及整合hbase0.96安装文档 内容简介: 首先说一下这个安装过程需要注意的地方一、使用新建用户可能会遇到的问题(1)权限问题:对于新手经常使用root,刚开始可以使用,...
在Ubuntu中安装并配置mysql 1.我们采用MySQL数据库保存Hive的元数据,而不是采用Hive自带的derby来存储元数据,因此需要在Ubuntu里安装MySQL 使用以下命令即可进行mysql安装: 2.MySQL安装完成之后,可用以下命令...
Hadoop2.2+Zookeeper3.4.5+HBase0.96集群环境搭建
1.集群配置,包含三个结点,主节点控制所有的子节点 2.集群已经搭建好了,解压之后...3.包含全套组件:hdfs,hbase,hive,sqoop,mysql,pig,spark等大数据组件 4.如果不知道如何使用,或者需要做Hadoop项目可以私信博主
本篇PDF是我学习Hadoop过程中,基于网上的ubuntu部署过程,整理的自己在centos环境中的部署步骤,免费供大学使用。
文件名: hbase-2.5.5-bin.tar.gz 这是 HBase 2.5.5 版本的二进制文件,包含了 HBase 的完整功能和组件。HBase 是一个高可靠、高性能、面向列、可...请确保在下载和使用此文件时,已经熟悉 HBase 的安装和配置过程。
VM是Ubuntu 14.04(可信任)盒,已通过。 在运行了vagrant up ,将以伪分布式模式设置单个HBase节点,并在单节点Hadoop HDFS文件系统上运行。 Thrift服务器也正在运行,从而允许从JVM之外的语言进行访问。 入门 在...
新建虚拟机,安装Ubuntu 3 锐捷校园认证下虚拟机Ubuntu 的联网设置 11 熟悉Ubuntu系统 13 安装SSH、配置SSH无密码登陆 20 安装Java环境 22 安装Hadoop 24 Hadoop伪分布式配置 25 启动Hadoop 26 运行Hadoop伪...