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.0export PATH=$PATH:$HBASE_HOME/bin
1. 修改hbase-env.sh文件,添加或修改内容:
export JAVA_HOME=/usr/java/jdk1.8.0_121export HBASE_CLASSPATH=/home/sri_udap/app/hbase-1.4.0/confexport HBASE_MANAGES_ZK=true
2.修改hbase-site.xml,添加内容如下:
#添加如下内容 hbase.rootdir #设置hbase数据库存放数据的目录hdfs://master:9000/hbase hbase.cluster.distributed #打开hbase分布模式true hbase.master #指定hbase集群主控节点master:60000 hbase.zookeeper.quorum master,slave8,slave9 #指定zookeeper集群节点名,因为是由zookeeper表决算法决定的hbase.zookeeper.property.dataDir #指zookeeper集群data目录/home/sri_udap/app/hbase-1.4.0/temp/zookeeper
修改 regionservers内容为:
[root@master conf]# cat regionservers slave8slave9
将内容拷贝到其他主机,然后bin目录下启动:
./start-hbase.sh
浏览器输入http://10.1.4.58:16030/rs-status查看一下状态:
简单使用下,,如下:
[root@master conf]# hbase shellSLF4J: 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 ShellUse "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 2017hbase(main):001:0> create 'resume','binfo','edu','work'0 row(s) in 1.4690 seconds=> Hbase::Table - resumehbase(main):002:0> listTABLE 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_VERSIONS => '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_VERSIONS => '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_VERSIONS => '0', BLOCKCACHE => 'true', BLOCKSIZE => '65536', REPLICATION_SCOPE => '0'} 3 row(s) in 0.1040 secondshbase(main):004:0>
完.