首页 > 其他分享 >1004-HBase的基本操作

1004-HBase的基本操作

时间:2023-04-03 21:33:23浏览次数:58  
标签:1004 cf 命令 test 基本操作 HBase main hbase

1、连接HBase

./bin/hbase shell

2、创建一个表

使用create命令创建一个表,必须给出特定的表名(table name)和列族( the ColumnFamily name)

hbase(main):001:0> create 'test', 'cf'

3、列出表信息

hbase(main):002:0> list 'test'

4、put 数据到指定的表

使用put命令,并指定表,行建,列族中的列(Column),数值。

hbase(main):004:0> put 'test', 'row2', 'cf:b', 'value2'

hbase(main):003:0> put 'test', 'row1', 'cf:a', 'value1'

在HBase中的所有列(Columns)以列族(ColumnFamily)为前缀,例如: cf:a表示cf为列成员组,a表示具体的列,cf为前缀

5、使用Scan命令扫名HBase表的所有数据

hbase(main):006:0> scan 'test'

6、通过get命令从HBase获取一条数据

hbase(main):007:0> get 'test', 'row1'

7、Disable 一个表

如果你想删除一个表或改变其设置,首先你需要禁用该表(使用Disable命令),然后重新启用(使用enable命令)

hbase(main):024:0> disable 'test'

8、Drop一个表

hbase(main):011:0> drop 'test'

9、quit命令退出HBase Shell 命令窗口

若退出HBase Shell ,断开HBase的连接,使用quit命令,这种情况的退出HBase会一直在后台运行


10、停止

 bin/stop-hbase.sh

停止HBase服务,需要花费几分钟,可以使用jps命令确保HMaster and HRegionServer 进程是否关闭

参考文章:

http://hbase.apache.org/book.html#_introduction

http://www.uml.org.cn/sjjm/201212141.asp


标签:1004,cf,命令,test,基本操作,HBase,main,hbase
From: https://blog.51cto.com/u_14361901/6167568

相关文章

  • hbase常用操作
    原文参考:www.51niux.com一、Hbase常用操作1.1hbase命令行介绍$/opt/soft/hbase/bin/hbase--helpBASICUsage:hbase[<options>]<command>[<args>]Options:--configDIR使用的配置目录。默认值:./conf--hostsHOSTS覆盖“regionserver”文件中的列表--aut......
  • 大数据学习之Hbase shell的基本操作
    HBase的命令行工具,最简单的接口,适合HBase管理使用,可以使用shell命令来查询HBase中数据的详细情况。安装完HBase之后,启动hadoop集群(利用hdfs存储),启动zookeeper,使用start-hbase.sh命令开启hbase服务,最后在shell中执行hbaseshell就可以进入命令行界面Habseshell的help对语法的介绍......
  • Springboot 系列 (27) - Springboot+HBase 大数据存储(五)| HBase REST 服务
    REST(RepresentationalStateTransfer)即表述性状态传递,是RoyFielding博士2000年在他的博士论文中提出来的一种软件架构风格。它是一种针对网络应用的设计和开发方式,可以降低开发的复杂性,提高系统的可伸缩性。在三种主流的Web服务实现方案中,与复杂的SOAP和XML-RPC相......
  • 2023-04-01-队链LinkQueue的基本操作
    //队链#include<stdio.h>#include<malloc.h>#include<stdbool.h>typedefstructLinkNode//定义队链结点{intdata;structLinkNode*next;}LinkNode;typedefstruct{LinkNode*front,*rear;}*LinkQueue;voidinitLinkQueue(L......
  • 关于 HBase 的一些经验
    1.理解HBase[1]深入理解HBaseCompaction机制[2]HBase架构详解及读写流程[3]HBase问题合集一个列族对于一个Store一个Store包含一个MemStore每次从MemStoreFlush都会产生StoreFlie(底层是HFile格式的文件)每次Flush都会检查是否需要compactStoreF......
  • Springboot 系列 (26) - Springboot+HBase 大数据存储(四)| Springboot 项目通过 HBase
    ApacheHBase是Java语言编写的一款Apache开源的NoSQL型数据库,不支持SQL,不支持事务,不支持Join操作,没有表关系。ApacheHBase构建在ApacheHadoop和ApacheZookeeper之上。ApacheHBase:https://hbase.apache.org/HBase的安装配置,请参考“Springboot系列(24)-......
  • 《Mysql基础》【Mysql表的基本操作 新建表、修改表、删除表、外键约束、主键约束、完
     --mysql数据库程序设计笔记:表基本操作:1、新建表:格式如:1)、建表加主键:createtable表名(idintNOTNULLauto_incrementcomment'自增主键id',列名类型(范围)comment'列备注',...primarykey(id))engine=InnoDB;2)、建表加候选键副键约束createtable表名......
  • 2023-04-01-循环队列CycleSqQueue的基本操作
    //循环链表//牺牲一个单元来区分队空还是队满#include<stdio.h>#include<stdbool.h>#defineMAXSIZE6typedefstruct{intdata[MAXSIZE];intfront,rear;}CySqQueue;voidinitCySqQueue(CySqQueue*C)//初始化循环链表{C->front=0;C->rear=0;......
  • 2023-03-31-顺序队列SqQueue的基本操作
    //基本顺序队列#include<stdio.h>#include<stdbool.h>#defineMAXSIZE50typedefstruct{intdata[MAXSIZE];intfront,rear;}SqQueue;voidinitSqQueue(SqQueue*Q)//进行队的初始化{Q->front=0;Q->rear=0;}boolisEmpty(SqQueue......
  • java查询hbase
    Mark——java查询hbase,https://blog.csdn.net/weixin_46408961/article/details/124224169查询Hbase数据分为Get方式查询,Scan方式查询,Scan配合Filter过滤查询01.Get方式查询importorg.apache.hadoop.conf.Configuration;importorg.apache.hadoop.hbase.Cell;importorg.ap......