启动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. 堆(heap)和栈(stack)、内存泄漏(memory leak)和内存溢出

    来源:http://blog.itpub.net/8797129/viewspace-693648/ 简单的可以理解为:heap:是由malloc之类函数分配的空间所在地.地址是由低向高增长的.sta ...

  2. 一分钟了解Linux文件系统

    Linux文件系统原理在所有的操作系统中文件都有文件名与数据,在Linux系统上文件系统分成两个部分:用户数据 (user data) 与元数据 (metadata).用户数据,即文件数据块 (dat ...

  3. 深入理解Kubernetes资源限制:内存

    写在前面 当我开始大范围使用Kubernetes的时候,我开始考虑一个我做实验时没有遇到的问题:当集群里的节点没有足够资源的时候,Pod会卡在Pending状态.你是没有办法给节点增加CPU或者内存的 ...

  4. 带参数的动态sql

    CREATE PROC Procout(@input INT, @result INT output) AS BEGIN SET @result = @input END go DECLARE @in ...

  5. 【基础数位DP-模板】HDU-2089-不要62

    不要62 Time Limit: / MS (Java/Others) Memory Limit: / K (Java/Others) Total Submission(s): Accepted Su ...

  6. 2BIT

    bit是比特,是英文 binary digit的缩写.而Byte是字节又叫bait. bit是表示信息的最小单位,是二进制数的一位包含的信息或2个选项中特别指定1个的需要信息量.一般来说,n比特的信息 ...

  7. 创建conda虚拟环境以及python的virtualenv虚拟环境

    我觉得我,嗯...可能脑袋里面有水 首先说一个,就是我电脑安装了conda2和conda3,原来怎么查看conda版本都是2,所以就没有创建虚拟环境 系统变量里面的path要改,总共有3个: D:\A ...

  8. 设计模式-模板方法设计模式--Template Method design pattern

    /** * Abstract implementation of the {@link org.springframework.context.ApplicationContext} * interf ...

  9. 多git项目中账户的管理

    每个项目配置用户名: git config user.name "your_name" git config user.email "your_email" 如 ...

  10. Spring Boot 之FilterRegistrationBean --支持web Filter 排序的使用(转)

    Spring Boot 之FilterRegistrationBean  --支持web Filter 排序的使用Spring 提供了FilterRegistrationBean类,此类提供setOr ...