zoukankan      html  css  js  c++  java
  • Hbase Shell常用命令

    本文命令验证环境:CentOS7+hbase-2.1.2。

    1、进入shell命令行。在安装目录下的bin目录执行:./hbase shell

    ./hbase shell

    2、创建表。

    create 'person', 'code', 'name', 'info'

    4、添加记录

    put 'person', '01', 'name', 'lucy'
    put 'person', '01', 'info:age', '0'
    put 'person', '01', 'info:birthday', '2019-01-24'
    put 'person', '02', 'name', 'lily'
    put 'person', '02', 'info:age', '1'
    put 'person', '02', 'info:birthday', '2018-01-24'

    5、查看行记录

    get 'person', '01', 'name'
    get 'person', '01', 'info:age'
    get 'person', '01'

    6、查看所有数据

    scan 'person'
    scan 'person', {COLUMN=>'name'}
    scan 'person', {COLUMN=>'info:birthday'}

    以下为详细命令(在hbase shell下执行)

    名称

    表达式

    查看服务器状态

    status

    查看hbase版本

    version

    查看所有表

    list

    创建表

    create '表名称', '列族名称1','列族名称2','列族名称N'

    判断表是否存在

    exists '表名称'

    获取表的描述

    describe '表名称'

    禁用和启用表

    enable/disable '表名称'

    是否禁用和是否启用表

    is_enabled/is_disabled '表名称'

    删除表

    第一步:disable '表名称'

    第二步:drop '表名称'

    添加列

    alter '表名称', '列族名称'

    删除列

    alter '表名称', {NAME=>'列族名称', METHOD='delete'}

    添加记录

    put '表名称', '行ID', '列族名称', '值'

    put '表名称', '行ID', '列族名称:列限定符名称', '值'

    更新记录

     重复执行添加记录

    查看行记录

    get '表名称', '行ID'

    get '表名称', '行ID', '列族名称'

    get '表名称', '行ID', '列族名称:列限定符名称'

    查看记录总数

    count  '表名称'

    查看所有记录

    scan '表名称'

    scan '表名称', '列族名称'

    scan '表名称', '列族名称:列限定符名称'

    删除行其中列记录

    delete '表名称', '行ID', '列族名称'

    删除整行记录

    deleteall '表名称', '行ID'

  • 相关阅读:
    Maximum Flow Exhaustion of Paths Algorithm
    ubuntu下安装java环境
    visualbox使用(二)
    vxworks一个超级奇怪的错误(parse error before `char')
    February 4th, 2018 Week 6th Sunday
    February 3rd, 2018 Week 5th Saturday
    February 2nd, 2018 Week 5th Friday
    February 1st, 2018 Week 5th Thursday
    January 31st, 2018 Week 05th Wednesday
    January 30th, 2018 Week 05th Tuesday
  • 原文地址:https://www.cnblogs.com/zhi-leaf/p/10316936.html
Copyright © 2011-2022 走看看