启动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. Route Loops

    当网络10.4.0.0发生故障时,RouterC检测到故障,并停止其E0接口的路由报文. 然而,路由器A和B还没有收到失败的通知. 路由器A仍然认为可以通过路由器B访问10.4.0.0.路由器A的路由 ...

  2. centos7下安装zookeeper&zookeeper集群的搭建

    一.centos7下安装zookeeper 1.zookeeper 下载地址 https://mirrors.tuna.tsinghua.edu.cn/apache/zookeeper/ 2.安装步骤 ...

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

    写在前面 在上一篇关于Kubernetes资源限制的文章我们讨论了如何通过ResourceRequirements设置Pod中容器内存限制,以及容器运行时是如何利用Linux Cgroups实现这些限 ...

  4. 【javascript】h5页面禁止返回上一页

    window.history.pushState("","","#"); window.addEventListener("pop ...

  5. MVVM框架-MVVMLight

    项目URL:http://www.mvvmlight.net/ 一.安装MVVMLight 在NuGet程序包中搜索MVVMLight,然后安装. 二.使用 安装完MVVMLight后项目中会自动生成 ...

  6. [ 转载 ]hashCode及HashMap中的hash()函数

    hashCode及HashMap中的hash()函数   一.hashcode是什么 要理解hashcode首先要理解hash表这个概念 1. 哈希表 hash表也称散列表(Hash table),是 ...

  7. Spring Bean装配(上)

    Bean:在spring的IOC里面,把配置到IOC容器里面的实体或者是对象都称为Bean Bean配置项 Bean的作用域 Bean的生命周期 Bean的自动装配 Resources&Res ...

  8. ASP.NET MVC Liu_Cabbage 个人博客

    RightControl_Blog 介绍 前台使用燕十三博客前端模板,后台基于RightControl .NET通用角色权限管理系统搭建,已完成.项目地址:http://www.baocaige.to ...

  9. SVG矢量绘图 path路径详解(贝塞尔曲线及平滑)

    以二次贝塞尔曲线的公式为例: js函数: //p0.p1.p2三个点,其中p0为起点,p2为终点,p1为控制点 //它们的坐标用数组表示[x,y] //t的范围是0-1 function qBerzi ...

  10. CF940F Machine Learning 带修改莫队

    题意:支持两种操作:$1.$ 查询 $[l,r]$ 每个数字出现次数的 $mex$,$2.$ 单点修改某一位置的值. 这里复习一下带修改莫队. 普通的莫队中,以左端点所在块编号为第一关键字,右端点大小 ...