启动hbase shell

./bin/hbase shell

1、创建表,查看表

create 'tableName', 'familykey1','familykey2',....
eg.
create 'student','info','course'
list #查看表

2、查看表信息

    desc 'student'

3、 修改表结构

alter 'student',{'NAME'=>'course','VERSIONS'=>'3'}

4、insert数据到表中

table-->student  rowkey-->201601  familykey:column-->info:name  4:timestamp
put 'tableName' ,'rowkey','familykey:column' ,'columnValue',timestamp eg.
put 'student','201601','info:name','liu',4
put 'student','201601','info:age',15
put 'student','201601','info:sex','nv'
put 'student','201601','info:dept','PE'

5、获取数据

get 'tableName','rowkey'

    eg.
get 'student','201601' #获取student表中rowkey为201601的所有列族数据
get 'student','201601','info:name' #获取student表中rowkey为201601且info列族中name的值

6、更新数据(和插入数据一样,只是少了timestamp)

put 'tableName','rowkey','familykey:column' , 'columnValue'

eg.
put 'student','201601','info:name','yangwj'

7、使用scan进行查询

scan 'student',{COLUMN => 'info:dept'}  #查询student表中所有列为info:dept的值

scan 'student',FILTER=>"RowFilter(=,'substring:2')"  ###?????

8、表的快照

   snapshot 'student','stu_snap'  #创建表的快照

    list_snapshots #显示所有快照表

    clone_snapshot 'stu_snap','stu_info' #克隆快照从而生成新的表

    delete_snapshot 'stu_snap' #删除快照

9、删除表 (先禁用表再删除)

   disable 'student'  #禁用表
is_disabled 'student' #查看表是否被禁用 true:禁用
drop 'student' #删除表

10、总结

 

完毕!

 

Hbase shell操作表的更多相关文章

  1. HBase Shell操作

    Hbase 是一个分布式的.面向列的开源数据库,其实现是建立在google 的bigTable 理论之上,并基于hadoop HDFS文件系统.     Hbase不同于一般的关系型数据库(RDBMS ...

  2. HBase Shell 常用命令及例子

    下面我们看看HBase Shell的一些基本操作命令,我列出了几个常用的HBase Shell命令,如下: 名称 命令表达式 创建表 create '表名称', '列名称1','列名称2','列名称N ...

  3. hbase shell command

    进入hbase shell console $HBASE_HOME/bin/hbase shell 如果有kerberos认证,需要事先使用相应的keytab进行一下认证(使用kinit命令),认证成 ...

  4. hbase shell基础和常用命令详解(转)

    HBase shell的基本用法 hbase提供了一个shell的终端给用户交互.使用命令hbase shell进入命令界面.通过执行 help可以看到命令的帮助信息. 以网上的一个学生成绩表的例子来 ...

  5. hbase shell 基本命令总结

    访问hbase,以及操作hbase,命令不用使用分号hbase shell 进入hbase list 查看表hbase shell -d hbase(main):024:0> scan '.ME ...

  6. hbase shell 常用命令

    进入hbase shell console$HBASE_HOME/bin/hbase shell如果有kerberos认证,需要事先使用相应的keytab进行一下认证(使用kinit命令),认证成功之 ...

  7. Hbase Shell常用命令

    hbase shell常用的操作命令有create,describe,disable,drop,list,scan,put,get,delete,deleteall,count,status等,通过h ...

  8. hbase shell中log4j重复问题

    [root@centos ~]# hbase shellSLF4J: Class path contains multiple SLF4J bindings.SLF4J: Found binding ...

  9. (转)Hbase shell 常用命令(1)

    Hbase shell 常用命令(1) link:http://blog.csdn.net/scutshuxue/article/details/6988348 下面我们看看HBase Shell的一 ...

随机推荐

  1. springboot系列(二) 创建springboot工程

    本文转载自:https://www.cnblogs.com/magicalSam/p/7171716.html 简介 Spring Boot是由Pivotal团队提供的全新框架,其设计目的是用来简化新 ...

  2. .NET Core中使用水印

    .NET Core中使用水印 在项目中,我需要给上传的图片添加水印,通过网上查找针对.NET Core 的找到两个方案: 使用 CoreCompat.System.Drawing 及用于非Window ...

  3. Paper Reading:DetNet

    论文:DetNet: A Backbone network for Object Detection 发表时间:2018 发表作者:(Face++)Chao Peng, Gang Yu (Tsingh ...

  4. Java字节码常量池深入剖析

    继续来分析Java字节码,上一节分析了魔数的规则,接下来继续往下分析,其上次总结的规则也一起贴出来: 1.使用javap -verbose命令分析一个字节码文件时,将会分析该字节码文件的魔数.版本号. ...

  5. The "web.xml" is called web application deployment descriptor

    3.3  Configure the Application Deployment Descriptor - "web.xml" A web user invokes a serv ...

  6. Selenium(二)开发环境的搭建

    1.安装python的开发集成环境 我之前有写,可参考https://www.cnblogs.com/dydxw/p/10405797.html 2.使用selenium打开火狐浏览器 先从selen ...

  7. gitlab自动备份脚本auto_backup_to_remote

    !/bin/bash gitlab 服务器备份路径 LocalBackDir=/var/opt/gitlab/backups 远程备份服务器 gitlab备份文件存放路径 RemoteBackDir= ...

  8. tableviewer自动调整列宽

    public void resizeTableColumn(TableColumn[] treeColumns) { for (TableColumn tc : treeColumns) tc.pac ...

  9. hudson 使用节点打包出现ClassNotFoundException: org.jvnet.hudson.maven3.agent.Maven3Main 错误

    java.lang.NoClassDefFoundError: org/jvnet/hudson/maven3/agent/Maven3Main Caused by: java.lang.ClassN ...

  10. BZOJ 5496: [2019省队联测]字符串问题 (后缀数组+主席树优化建图+拓扑排序)

    题意 略 分析 考场上写了暴力建图40分溜了-(结果只得了30分) 然后只要优化建边就行了 首先给出的支配关系无法优化,就直接A向它支配的B连边. 考虑B向以B作为前缀的所有A连边,做一遍后缀数组,两 ...