美文网首页
HBase搭建 之 单机模式

HBase搭建 之 单机模式

作者: 诺之林 | 来源:发表于2020-12-02 08:46 被阅读0次

    目录

    Standalone

    java -version
    # java version "11.0.8" 2020-07-14 LTS
    
    wget https://mirror.bit.edu.cn/apache/hbase/2.2.6/hbase-2.2.6-bin.tar.gz
    
    tar xf hbase-2.2.6-bin.tar.gz && cd hbase-2.2.6
    
    ./bin/start-hbase.sh
    # running master, logging to /path/to/hbase-2.2.6/bin/../logs/
    
    jps
    # 50847 HMaster
    # 51359 Jps
    
    • In standalone mode HBase runs all daemons within this single JVM, i.e. the HMaster, a single HRegionServer, and the ZooKeeper daemon.

    • 浏览器打开http://localhost:16010/

    参考文档2. Quick Start - Standalone HBase

    HBase Shell

    ./bin/hbase shell
    # help
    
    # 创建表 并设置表名和列簇名
    create 'test', 'cf'
    
    list
    
    describe 'test'
    
    put 'test', 'row1', 'cf:a', 'value1'
    
    put 'test', 'row2', 'cf:b', 'value2'
    
    put 'test', 'row3', 'cf:c', 'value3'
    
    scan 'test'
    # ROW                                                              COLUMN+CELL
    # row1                                                            column=cf:a, timestamp=1606804404848, value=value1
    # row2                                                            column=cf:b, timestamp=1606804408814, value=value2
    # row3                                                            column=cf:c, timestamp=1606804413633, value=value3
    # 3 row(s)
    
    get 'test', 'row1'
    # COLUMN                                                           CELL
    # cf:a                                                            timestamp=1606804404848, value=value1
    # 1 row(s)
    
    put 'test', 'row1', 'cf:a', 'value11'
    
    get 'test', 'row1'
    # COLUMN                                                           CELL
    # cf:a                                                            timestamp=1606804508879, value=value11
    # 1 row(s)
    
    get 'test', 'row1', {TIMESTAMP => 1606804404848}
    # COLUMN                                                           CELL
    # cf:a                                                            timestamp=1606804404848, value=value1
    # 1 row(s)
    

    参考文档The Apache HBase Shell

    相关文章

      网友评论

          本文标题:HBase搭建 之 单机模式

          本文链接:https://www.haomeiwen.com/subject/khkswktx.html