hbase1.4.0安装和使用

jia下载地址:  http://mirrors.shuosc.org/apache/hbase/1.4.0/

解压 tar -zxvf hbase-1.4.0-bin.tar.gz

修改环境变量

[root@10 hbase-1.4.0]# vi /etc/profile
[root@10 hbase-1.4.0]# source /etc/profile

添加内容:

export HBASE_HOME=/home/sri_udap/app/hbase-1.4.0
export PATH=$PATH:$HBASE_HOME/bin

1. 修改hbase-env.sh文件,添加或修改内容:

export JAVA_HOME=/usr/java/jdk1.8.0_121
export HBASE_CLASSPATH=/home/sri_udap/app/hbase-1.4.0/conf
export HBASE_MANAGES_ZK=true

2.修改hbase-site.xml,添加内容如下:

<configuration>
 #添加如下内容
<property>
    <name>hbase.rootdir</name> #设置hbase数据库存放数据的目录
    <value>hdfs://master:9000/hbase</value>
</property>
<property>
    <name>hbase.cluster.distributed</name>  #打开hbase分布模式
    <value>true</value>
</property>
<property>
    <name>hbase.master</name> #指定hbase集群主控节点
    <value>master:60000</value>
</property>
<property>
    <name>hbase.zookeeper.quorum</name>
    <value>master,slave8,slave9</value> #指定zookeeper集群节点名,因为是由zookeeper表决算法决定的
</property>
<property>
    <name>hbase.zookeeper.property.dataDir</name> #指zookeeper集群data目录
    <value>/home/sri_udap/app/hbase-1.4.0/temp/zookeeper</value>
</property>
</configuration>

修改 regionservers内容为:

[root@master conf]# cat regionservers 
slave8
slave9

将内容拷贝到其他主机,然后bin目录下启动:

./start-hbase.sh

浏览器输入http://10.1.4.58:16030/rs-status查看一下状态:

简单使用下,,如下:

[root@master conf]# hbase shell
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/home/sri_udap/app/hbase-1.4.0/lib/slf4j-log4j12-1.7.10.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/home/sri_udap/app/hadoop-2.7.2/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 1.4.0, r10b9b9fae6b557157644fb9a0dc641bb8cb26e39, Fri Dec  8 16:09:13 PST 2017

hbase(main):001:0> create 'resume','binfo','edu','work'
0 row(s) in 1.4690 seconds

=> Hbase::Table - resume
hbase(main):002:0> list
TABLE                                                                                                                                                                                          
member                                                                                                                                                                                         
resume                                                                                                                                                                                         
2 row(s) in 0.0410 seconds

=> ["member", "resume"]
hbase(main):003:0> describe 'resume'
Table resume is ENABLED                                                                                                                                                                        
resume                                                                                                                                                                                         
COLUMN FAMILIES DESCRIPTION                                                                                                                                                                    
{NAME => 'binfo', BLOOMFILTER => 'ROW', VERSIONS => '1', IN_MEMORY => 'false', KEEP_DELETED_CELLS => 'FALSE', DATA_BLOCK_ENCODING => 'NONE', TTL => 'FOREVER', COMPRESSION => 'NONE', MIN_VERSI
ONS => '0', BLOCKCACHE => 'true', BLOCKSIZE => '65536', REPLICATION_SCOPE => '0'}                                                                                                              
{NAME => 'edu', BLOOMFILTER => 'ROW', VERSIONS => '1', IN_MEMORY => 'false', KEEP_DELETED_CELLS => 'FALSE', DATA_BLOCK_ENCODING => 'NONE', TTL => 'FOREVER', COMPRESSION => 'NONE', MIN_VERSION
S => '0', BLOCKCACHE => 'true', BLOCKSIZE => '65536', REPLICATION_SCOPE => '0'}                                                                                                                
{NAME => 'work', BLOOMFILTER => 'ROW', VERSIONS => '1', IN_MEMORY => 'false', KEEP_DELETED_CELLS => 'FALSE', DATA_BLOCK_ENCODING => 'NONE', TTL => 'FOREVER', COMPRESSION => 'NONE', MIN_VERSIO
NS => '0', BLOCKCACHE => 'true', BLOCKSIZE => '65536', REPLICATION_SCOPE => '0'}                                                                                                               
3 row(s) in 0.1040 seconds

hbase(main):004:0> 

完.

posted @ 2017-12-29 17:15  但行好事-莫问前程  阅读(2431)  评论(0编辑  收藏