java多线程    Java入门    vsftp    ftp    linux配置    centos    FRP教程    HBase    Html5缓存    webp    zabbix    分布式    neo4j图数据库    

单机Hbase安装及基本命令

下载stable版本

http://www.apache.org/dyn/closer.cgi/hbase/

我下载的时候hbase-2.2.3-bin.tar.gz

tar -zvxf hbase-2.2.3-bin.tar.gz

cd hbase-2.2.3

决定将HBase写入到哪里目录

vi conf/hbase-site.xml

 
    hbase.rootdir
    /Users/ge/mysoft/hbase-2.2.3/data
  

设置JAVA_HOME

export JAVA_HOME=$(/usr/libexec/java_home)
export PATH=$JAVA_HOME/bin:$PATH
export CLASS_PATH=$JAVA_HOME/lib

这么命令行输入,只能起效一次

cd ~
vi .bash_profile
加在底部

export JAVA_HOME=$(/usr/libexec/java_home)
export PATH=$JAVA_HOME/bin:$PATH
export CLASS_PATH=$JAVA_HOME/lib
localhost:~ $ source .bash_profile
localhost:~ $ echo $JAVA_HOME
/Library/Java/JavaVirtualMachines/jdk1.8.0_40.jdk/Contents/Home
$ ./bin/start-hbase.sh
2020-01-22 21:02:55,071 WARN  [main] util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
HBase Shell
Use "help" to get list of supported commands.
Use "exit" to quit this interactive shell.
Version 1.4.12, r6ae4a77408ad35d6a7a4e5cebfd401fc4b72b5ec, Sun Nov 24 13:25:41 CST 2019
hbase(main):001:0>

创建一个表名字叫Test 列族叫cf

hbase(main):001:0> create 'test', 'cf'

看下这个表

hbase(main):003:0> list 'test'
TABLE                                                                           
test                                                                            
1 row(s) in 0.0250 seconds

=> ["test"]

hbase(main):004:0> put 'test', 'row1', 'cf:a1', 'v1'
hbase(main):005:0> put 'test', 'row2', 'cf:a2', 'v2'

hbase(main):006:0> scan 'test'
ROW                   COLUMN+CELL
 row1                 column=cf:a1, timestamp=1579698357881, value=v1           
 row2                 column=cf:a2, timestamp=1579698364045, value=v2 
2 row(s) in 0.0290 seconds


hbase(main):007:0> get 'test', 'row1'
COLUMN                CELL                                                      
 cf:a1                 timestamp=1579698357881, value=v1 

hbase(main):008:0> disable 'test'
0 row(s) in 2.3640 seconds

hbase(main):009:0> drop 'test'
0 row(s) in 1.2700 seconds

hbase(main):010:0> exit
./bin/stop-hbase.sh 
stopping hbase....

 

浏览器查看hbase状态 http://127.0.0.1:16010/master-status


This entry was posted in JAVA, 高并发与大数据 and tagged . Bookmark the permalink.
月小升QQ 2651044202, 技术交流QQ群 178491360
首发地址:月小升博客https://java-er.com/blog/danji-hbase-install-command/
无特殊说明,文章均为月小升原创,欢迎转载,转载请注明本文地址,谢谢
您的评论是我写作的动力.

Leave a Reply