启动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. Linux Backup: Hard Disk Clone with "dd"

      Most of Windows users may know "Norton Ghost". Norton Ghost is a backup software for har ...

  2. c# 枚举和位标志

  3. 【问题】Difference between ">/dev/null 2>&1" and "2>&1 >/dev/null"

    https://www.unix.com/shell-programming-and-scripting/125947-difference-between-dev-null-2-1-2-1-dev- ...

  4. Python使用selenium模拟点击(一)

    本文适合有点Python基础阅读,(没基础的话,相对的比较蒙蔽,争取能让小白能一步一步跟上来) 2019-03-05 14:53:05 前几天由于需要到一个网站进行签到~~听说Python能够模拟请求 ...

  5. Ajax长连接和SignalR(刷新客户端数据)的区别

    ajax实现长连接   <%@ page language="java" import="java.util.*" pageEncoding=" ...

  6. java8大基本类型

    文章转载自:Java的8种基本数据类型 请阅读原文. 关于Java的8种基本数据类型,其名称.位数.默认值.取值范围及示例如下表所示: 序号 数据类型 位数 默认值 取值范围 举例说明 1 byte( ...

  7. SPFA的优化

    [为什么要优化] 关于SPFA,他死了(懂的都懂)   进入正题... 一般来说,我们有三种优化方法. SLF优化: SLF优化,即 Small Label First  策略,使用 双端队列 进行优 ...

  8. halcon基础数据类型详解

    #if defined(__CHAR_UNSIGNED__) || defined(__sgi) #define INT1 signed char /* integer, signed 1 Byte ...

  9. [HTML5] Lazyload below the fold images and iframes with native browser lazy-loading

    In this lesson, you'll learn how to use the loading="lazy" attribute available on images a ...

  10. ueditor实现ctrl+v粘贴word图片并上传

    图片的复制无非有两种方法,一种是图片直接上传到服务器,另外一种转换成二进制流的base64码 目前限chrome浏览器使用,但是项目要求需要支持所有的浏览器,包括Windows和macOS系统.没有办 ...