首页 > 系统服务 > 详细

Linux安装HBase

时间:2019-12-10 00:26:21      阅读:81      评论:0      收藏:0      [点我收藏+]

1、下载

http://archive.apache.org/dist/hbase/1.2.6/hbase-1.2.6-bin.tar.gz

2、解压

tar -xvf hbase-1.2.6-bin.tar.gz

3、配置环境变量SCALA_HOME 和 PATH

  • vim /etc/profile 或者 vim ~/.bashrc
#Hbase Environment
export HBASE_HOME=$USER_HOME/software/hbase-1.2.6
source /etc/profile 或者 source ~/.bashrc

4、起停脚本

$ZOOKEEPER_HOME/bin/zkServer.sh start
$HBASE_HOME/bin/start-hbase.sh
$HBASE_HOME/bin/stop-hbase.sh
$ZOOKEEPER_HOME/bin/zkServer.sh stop

启动之后:http://hadoop:16010/master-status

5、测试:$HBASE_HOME/bin/hbase shell

hadoop@hadoop:~/software/hbase-1.2.6/bin$ hbase shell
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/home/hadoop/software/hadoop-2.7.3/share/hadoop/common/lib/slf4j-log4j12-1.7.10.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/home/hadoop/software/hbase-1.2.6/lib/client-facing-thirdparty/slf4j-log4j12-1.7.5.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.
For Reference, please visit: http://hbase.apache.org/2.0/book.html#shell
Version 1.2.6, r5b7722f8551bca783adb36a920ca77e417ca99d1, Tue Mar 19 19:05:06 UTC 2019
Took 0.0098 seconds                                                            
hbase(main):001:0> list
TABLE                                                                          
0 row(s)
Took 1.9276 seconds                                                            
=> []
hbase(main):002:0> create 'mytable', 'cf'
Created table mytable
Took 1.4276 seconds                                                            
=> Hbase::Table - mytable
hbase(main):003:0> list
TABLE                                                                          
mytable                                                                        
1 row(s)
Took 0.0367 seconds                                                            
=> ["mytable"]
hbase(main):004:0> put 'mytable', '1', 'cf:msg', 'Hello World'
Took 0.2812 seconds
hbase(main):001:0> put 'mytable', '2', 'cf:blog', 'Hello Ubuntu'
Took 1.6015 seconds                                                            
hbase(main):002:0> get 'mytable', '1'
COLUMN               CELL                                                      
 cf:msg              timestamp=1555401849981, value=Hello World                
1 row(s)
Took 0.1640 seconds                                                            
hbase(main):003:0> scan 'mytable'
ROW                  COLUMN+CELL                                               
 1                   column=cf:msg, timestamp=1555401849981, value=Hello World 
 2                   column=cf:blog, timestamp=1555402006556, value=Hello Ubuntu                                                         
2 row(s)
Took 0.0458 seconds                                                            
hbase(main):004:0> exit

Linux安装HBase

原文:https://www.cnblogs.com/HappyEveryDay9013/p/12014019.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!