HBase Shell 命令

[HBase]二 HBase原生Shell命令大全 HBase原生Shell命令汇总1. General组 51.1. 查看集群状态:status 51.2. 查看表的操作方法:table_help 51.3. 查看HBase的版本信息:version 51.4. 查看当前用户:whoami 52. Namespace组 52.1. 创建命名空间:create_namespace 52.2. 显示命名空间列表:list_namespace 5。 阅读详情

This page describes the JRuby IRB-based HBase Shell. It replaces the SQL-like HQL, the Shell found in HBase versions 0.1.x and previous. Some discussion of new shell requirements can be found in the Shell Replacementdocument.

To run the shell, do  

 

Shell代码   收藏代码
  1. hadoop$redhat ${HBASE_HOME}/bin/hbase shell  

 

You'll be presented with a prompt like the following:

Shell代码   收藏代码
  1. HBase Shell; enter 'help<RETURN>' for list of supported commands.  
  2. Version: 0.2.0-dev, r670701, Mon Jun 23 17:26:36 PDT 2008  
  3. hbase(main):001:0>  

 

Type 'help' followed by a return to get a listing of commands

Shell代码   收藏代码
  1. hbase(main):001:0> help  
  2. HBASE SHELL COMMANDS:  
  3.  alter     Alter column family schema;  pass table name and a dictionary  
  4.            specifying new column family schema. Dictionaries are described  
  5.            below in the GENERAL NOTES section.  Dictionary must include name  
  6.            of column family to alter.  For example,  
  7.   
  8.            To change or add the 'f1' column family in table 't1' from defaults  
  9.            to instead keep a maximum of 5 cell VERSIONS, do:  
  10.            hbase> alter 't1', {NAME => 'f1', VERSIONS => 5}  
  11.   
  12.            To delete the 'f1' column family in table 't1', do:  
  13.            hbase> alter 't1', {NAME => 'f1', METHOD => 'delete'}  
  14.   
  15.            You can also change table-scope attributes like MAX_FILESIZE  
  16.            MEMSTORE_FLUSHSIZE and READONLY.  
  17.   
  18.            For example, to change the max size of a family to 128MB, do:  
  19.            hbase> alter 't1', {METHOD => 'table_att', MAX_FILESIZE => '134217728'}  
  20.   
  21.  count     Count the number of rows in a table. This operation may take a LONG  
  22.            time (Run '$HADOOP_HOME/bin/hadoop jar hbase.jar rowcount' to run a  
  23.            counting mapreduce job). Current count is shown every 1000 rows by  
  24.            default. Count interval may be optionally specified. Examples:  
  25.   
  26.            hbase> count 't1'  
  27.            hbase> count 't1', 100000  
  28.   
  29.  create    Create table; pass table name, a dictionary of specifications per  
  30.            column family, and optionally a dictionary of table configuration.  
  31.            Dictionaries are described below in the GENERAL NOTES section.  
  32.            Examples:  
  33.   
  34.            hbase> create 't1', {NAME => 'f1', VERSIONS => 5}  
  35.            hbase> create 't1', {NAME => 'f1'}, {NAME => 'f2'}, {NAME => 'f3'}  
  36.            hbase> # The above in shorthand would be the following:  
  37.            hbase> create 't1', 'f1', 'f2', 'f3'  
  38.            hbase> create 't1', {NAME => 'f1', VERSIONS => 1, TTL => 2592000, \  
  39.              BLOCKCACHE => true}  
  40.   
  41.  describe  Describe the named table: e.g. "hbase> describe 't1'"  
  42.   
  43.  delete    Put a delete cell value at specified table/row/column and optionally  
  44.            timestamp coordinates.  Deletes must match the deleted cell's  
  45.            coordinates exactly.  When scanning, a delete cell suppresses older  
  46.            versions. Takes arguments like the 'put' command described below  
  47.   
  48.  deleteall Delete all cells in a given row; pass a table name, row, and optionally  
  49.            a column and timestamp  
  50.   
  51.  disable   Disable the named table: e.g. "hbase> disable 't1'"  
  52.   
  53.  drop      Drop the named table. Table must first be disabled. If table has  
  54.            more than one region, run a major compaction on .META.:  
  55.   
  56.            hbase> major_compact ".META."  
  57.   
  58.  enable    Enable the named table  
  59.   
  60.  exists    Does the named table exist? e.g. "hbase> exists 't1'"  
  61.   
  62.  exit      Type "hbase> exit" to leave the HBase Shell  
  63.   
  64.  get       Get row or cell contents; pass table name, row, and optionally  
  65.            a dictionary of column(s), timestamp and versions.  Examples:  
  66.   
  67.            hbase> get 't1', 'r1'  
  68.            hbase> get 't1', 'r1', {COLUMN => 'c1'}  
  69.            hbase> get 't1', 'r1', {COLUMN => ['c1', 'c2', 'c3']}  
  70.            hbase> get 't1', 'r1', {COLUMN => 'c1', TIMESTAMP => ts1}  
  71.            hbase> get 't1', 'r1', {COLUMN => 'c1', TIMESTAMP => ts1, \  
  72.              VERSIONS => 4}  
  73.   
  74.  list      List all tables in hbase  
  75.   
  76.  put       Put a cell 'value' at specified table/row/column and optionally  
  77.            timestamp coordinates.  To put a cell value into table 't1' at  
  78.            row 'r1' under column 'c1' marked with the time 'ts1', do:  
  79.   
  80.            hbase> put 't1', 'r1', 'c1', 'value', ts1  
  81.   
  82.  tools     Listing of hbase surgery tools  
  83.   
  84.  scan      Scan a table; pass table name and optionally a dictionary of scanner  
  85.            specifications.  Scanner specifications may include one or more of  
  86.            the following: LIMIT, STARTROW, STOPROW, TIMESTAMP, or COLUMNS.  If  
  87.            no columns are specified, all columns will be scanned.  To scan all  
  88.            members of a column family, leave the qualifier empty as in  
  89.            'col_family:'.  Examples:  
  90.   
  91.            hbase> scan '.META.'  
  92.            hbase> scan '.META.', {COLUMNS => 'info:regioninfo'}  
  93.            hbase> scan 't1', {COLUMNS => ['c1', 'c2'], LIMIT => 10, \  
  94.              STARTROW => 'xyz'}  
  95.   
  96.            For experts, there is an additional option -- CACHE_BLOCKS -- which  
  97.            switches block caching for the scanner on (true) or off (false).  By  
  98.            default it is enabled.  Examples:  
  99.   
  100.            hbase> scan 't1', {COLUMNS => ['c1', 'c2'], CACHE_BLOCKS => false}  
  101.   
  102.  status    Show cluster status. Can be 'summary', 'simple', or 'detailed'. The  
  103.            default is 'summary'. Examples:  
  104.   
  105.            hbase> status  
  106.            hbase> status 'simple'  
  107.            hbase> status 'summary'  
  108.            hbase> status 'detailed'  
  109.   
  110.  shutdown  Shut down the cluster.  
  111.   
  112.  truncate  Disables, drops and recreates the specified table.  
  113.   
  114.  version   Output this HBase version  
  115.   
  116. GENERAL NOTES:  
  117. Quote all names in the hbase shell such as table and column names.  Don't  
  118. forget commas delimit command parameters.  Type <RETURN> after entering a  
  119. command to run it.  Dictionaries of configuration used in the creation and  
  120. alteration of tables are ruby Hashes. They look like this:  
  121.   
  122.   {'key1' => 'value1', 'key2' => 'value2', ...}  
  123.   
  124. They are opened and closed with curley-braces.  Key/values are delimited by  
  125. the '=>' character combination.  Usually keys are predefined constants such as  
  126. NAME, VERSIONS, COMPRESSION, etc.  Constants do not need to be quoted.  Type  
  127. 'Object.constants' to see a (messy) list of all constants in the environment.  
  128.   
  129. In case you are using binary keys or values and need to enter them into the  
  130. shell then use double-quotes to make use of hexadecimal or octal notations,  
  131. for example:  
  132.   
  133.   hbase> get 't1', "key\x03\x3f\xcd"  
  134.   hbase> get 't1', "key\003\023\011"  
  135.   hbase> put 't1', "test\xef\xff", 'f1:', "\x01\x33\x40"  
  136.   
  137. Using the double-quote notation you can directly use the values output by the  
  138. shell for example during a "scan" call.  
  139.   
  140. This HBase shell is the JRuby IRB with the above HBase-specific commands added.  
  141. For more on the HBase Shell, see <a href="http://wiki.apache.org/hadoop/Hbase/Shell">http://wiki.apache.org/hadoop/Hbase/Shell</a>  

 

Example case: 

 

1. 创建一张student表, ColumnFamily为name. 

Create 代码   收藏代码
  1. create 'student','name'  

 

2. 描述student表. 

Shell代码   收藏代码
  1. hbase(main):004:0> describe 'student'  
  2. DESCRIPTION                                                                                                        ENABLED  
  3.  {NAME => 'student', FAMILIES => [{NAME => 'name', BLOOMFILTER => 'NONE', REPLICATION_SCOPE => '0', COMPRESSION => true  
  4.   'NONE', VERSIONS => '3', TTL => '2147483647', BLOCKSIZE => '65536', IN_MEMORY => 'false', BLOCKCACHE => 'true'}]  
  5.  }  
  6. 1 row(s) in 0.0710 seconds  
  7.   
  8. hbase(main):005:0>  

 

3. 往表student插入数据 

Shell代码   收藏代码
  1. hbase(main):017:0> put 'student','111','name:firstname','kim'  
  2. 0 row(s) in 0.0380 seconds  

 

4. 查询student, 键为111的value 

Shell代码   收藏代码
  1. hbase(main):023:0> get 'student','111'  
  2. COLUMN                                        CELL  
  3.  name:firstname                               timestamp=1338877705167, value=kim  
  4. 1 row(s) in 0.0190 seconds  
  5.   
  6. hbase(main):024:0>  

 

5. 全部查询 

Shell代码   收藏代码
  1. hbase(main):010:0> scan 'student'  
  2. ROW                                           COLUMN+CELL  
  3.  111                                          column=name:firstname, timestamp=1338877705167, value=kim  
  4. 1 row(s) in 0.4250 seconds  
  5.   
  6. hbase(main):011:0>  

  

6. 查询 

Shell代码   收藏代码
  1. hbase(main):019:0> get 'student','111',{COLUMN=>'name:firstname',VERSIONS=>10}  
  2. COLUMN                                        CELL  
  3.  name:firstname                               timestamp=1338877705167, value=kim  
  4. 1 row(s) in 0.0250 seconds  
  5.   
  6. hbase(main):020:0>  

 

7. 删除表 

Drop代码   收藏代码
  1. disable 'tablename'  
  2. drop 'tablename'  
Hbase shell命令的使用 本实验任务主要完成基于ubuntu环境掌握Hbase shell命令的使用的工作。通过完成本实验任务,要求学生熟练掌握Hbase shell命令的使用的方法,为后续实验的开展奠定Hbase平台基础,也为从事大数据平台运维工程师、大数据技术支持工程师等岗位工作奠定夯实的技能基础。1、掌握Hbase shell命令的使用Ubuntu(三台节点:mater,slave1,slave2)、Hadoop2.7.3、Zookeeper3.4.5、Hbase1.2.6Hbase是一个分布式的、面向列的开源数据库,该技术来 阅读详情

相关推荐

H3C交换机Console口连接全攻略:从接线到PuTTY配置(附常见问题排查)

本文详细介绍了H3C交换机Console口的连接与配置方法,包括硬件线缆选择、驱动安装、PuTTY参数设置及常见问题排查。特别针对Console转USB线缆的兼容性和驱动安装难点提供实用建议,帮助网络工程师快速掌握串联调试技巧,解决连接中的黑屏、乱码等典型问题。

weixin_42549451的博客 674

HBase基础及shell操作

什么是HBase HBase是采用java语言编写的一款 apache 开源的基于HDFS的NoSQL型数据库,不支持 SQL,不支持事务,不支持Join操作,没有表关系 HBase特点 1.不支持事务 2.主要存储结构化数据以及半结构化的数据 3.​HBase中数据存储都是以字节的形式来存储的 4.HBase是易于扩展的 HBase的表具有三大特征: 1- 大: 在一个表中可以存储上十亿行的数据, 可以拥有上百万个列 2- 面向列: 是基于列族进行管理操作, 基于列族进行列式存储方案 3- 稀疏性: 在

m0_58535137的博客 9106

VOF模型求解方法:从SIMPLEC到PISO的稳定性优化策略

本文深入探讨了VOF模型求解方法中SIMPLEC与PISO算法的稳定性优化策略,重点分析了两种算法在稳态和瞬态问题中的应用差异。通过对比PRESTO离散化方法与其他格式的优劣,提供了针对多相流模拟的实用设置建议和稳定性优化技巧,帮助工程师有效提升计算效率和精度。

yellow的专栏 1153

【博学谷学习记录】超强总结,用心分享|HBase常用的Shell命令

(2)查看HBase的命令帮助文档 (9)删除数据: delete 和 deleteAll (10)查看表结构 (11)清空表 (12)查询多条数据: scan (13)查看表共计有多少条数据 2 HBase的高级shell操作 (1) HBase的过滤器查询 (2)显示HBase当前登录使用用户:whoami (3)判断表是否存在:exists ‘表名’ (4)修改表结构信息

Sweet~~~ 3091

基于单片机自行车码表控制系统设计

*单片机设计介绍,基于单片机自行车码表控制系统设计。

QQ2193276455的博客 1487

MobaXterm结合SSH密钥对安全连接阿里云ECS的实战教程

本文详细介绍了如何使用MobaXterm结合SSH密钥对安全连接阿里云ECS的实战教程。通过对比传统密码登录的风险,重点讲解了密钥对的生成与配置、阿里云控制台的密钥绑定技巧,以及MobaXterm的高级设置和故障排查方法,帮助用户实现高效、安全的远程连接。

weixin_29208327的博客 466

Hbase的基本Shell命令

一、启动habse分布式集群 在集群的某个节点启动hbase集群的命令:start-hbase.sh 二、进入hbase的客服端命令: hbase shell 三、hbase基本shell命令: 注意HBase Shell 中的回格键没用,要用【Ctrl+Backspace】,每个命令之后不需要分号(;)结束。 HBase帮助命令:hbase(main):003:0> help ‘creat...

weixin_44695980的博客 2933

字节跳动高频111道核心前端面试题解析,web开发增强

但是本人觉得看书也很必要,可以节省很多时间,常见的javascript的书,例如:javascript的高级程序设计,是每位前端工程师必不可少的一本书,边看边用,了解js的一些基本知识,基本上很全面了,如果有时间可以读一些,js性能相关的书籍,以及设计者模式,在实践中都会用的到。内容包括html,css,JavaScript,ES6,计算机网络,浏览器,工程化,模块化,Node.js,框架,数据结构,性能优化,项目等等。自定义指令(v-check、v-focus)的方法有哪些?v-model是什么?

2401_84094620的博客 1200

hbase shell操作命令大全

一、hbase web操作 访问地址 http://h71:60010 h71的ip配置在$HBASE_HOME/conf/hbase-site.xml中 ip映射成主机名 在env/hosts中配置 在windows系统中的C:\Windows\System32\drivers\etc目录下的hosts文件中配置) 二、hbase shell 基本操作:

小强签名设计 的博客 1万+

VMware 安装 Windows11

一、下载win11的镜像文件 可以在MSDN网站下载: MSDN系统库-致力于原版windows生态服务 二、创建虚拟机 1.双击打开VMware虚拟机,点击创建新的虚拟机 2.选择典型(推荐),然后点击下一步 3.在安装程序光盘映像文件下,点击浏览按钮,选择Windows 11ISO镜像文件所在的路径,在Windows 11安装文件路径中不要有中文或其他特殊符号,否则有可能引起错误。然后点击下一步 4.在选择客户机操作系统界...

m0_56015193的博客 7016

BevFusion (5):逐行代码详解

论文中给出了Bevfusion的架构图,它的输入是多视角的相机和点云图,经过两个特定的head,分别用于做检测任务和分割任务。图1 Bevfusion 结构图Bevfusion因为有两个模态的输入:多视角相机和点云,所以对应两个分支:相机分支和点云分支。相机分支:输入6个视角的图片后,提取特征,然后经VT(View Transformer)转换之后得到相机的Bev特征。激光雷达分支:输入点云数据,经过Encoder编码得到体素化Lidar特征,然后沿z方向展平,得到Lidar Bev特征。

@bangbang的博客 3714

Hbase的shell命令(详细)

Hbase的shell命令,包括命名空间操作(namespace),表操作(DDL),数据操作(DML), 计数器,修饰词过滤,FILTER条件过滤器,与region有关的命令

weixin_52134189的博客 5856

OpenClaw(Clawdbot/Moltbot)如何正确的配置浏览器,实现对浏览器的自动化操作功能(浏览器状态为running:false怎么办)

OpenClaw(Clawdbot/Moltbot)浏览器自动化功能无效?🤖 本文详细介绍如何解决这个问题🔧,让你的OpenClaw(Clawdbot/Moltbot)真正具备"睁眼看世界"的能力,支持网页搜索、点击操作和截图等功能 ✅

XiaoqiangClub的博客 8107

HBase Shell命令大全

HBase关键名称: Row Key 列族 column family 单元 Cell 时间戳 timestamp HBase Shell 是官方提供的一组命令,用于操作HBase。如果配置了HBase的环境变量了,就可以知己在命令行中输入hbase shell 命令进入命令行。 hbase shell help命令 可以通过 help '命名名称'来查看命令行的具体使用 查询服务器状态st...

人不风流枉少年 14万+

Outlook Express 6 (OE6) for Win7/Win8/Win10

英文版 Outlook Express6.0, 兼容Win7/Win10/WinXP,解压就可用。

Data-Structures-and-Algorithm-Analysis-in-Java.pdf

作者: Weiss, Mark A. 出版社: Addison Wesley Data Structures and Algorithm Analysis in Java is an “advanced algorithms” book that fits between traditional CS2 and Algorithms Analysis courses. In the old ACM Curriculum Guidelines, this course was known as CS7. This text is for readers who want to learn good programming and algorithm analysis skills simultaneously so that they can develop such programs with the maximum amo...

HBase Shell命令

HBase包含可以与HBase进行通信的Shell。 HBase使用Hadoop文件系统来存储数据。所有这些任务发生在HDFS。下面给出的是一些由 常用的HBase Shell命令。 数据操纵语言 命令 说明 命令表达式 create 创建一个表 create '表名称', '列名称1','列名称2','列名称N' put 添加记录 put '表名称...

常年被追砍的博客 278

TMS_WebGMaps_1.9.8.0_Full_Source

TMS_WebGMaps_1.9.8.0_Full_Source 全源码 delphi cbuilder

HBase常用的shell命令

HBase可以用shell进行一些常规的HBase增删改查以及数据库管理操作,下面将介绍几种常见的HBase shell命令操作: 1.启动。 打开终端,直接输入hbase shell。 注意:需要配置HBase的环境变量,否则必须进入/usr/local/hbase1.1.2/bin目录执行。 hbase shell 2.查看表。 使...

梦忆故城的博客 1895

win10 跳过U8环境检测的IE WebControls.rar

win10 安装u8的时候 提示IE WebControls 不通过,这个工具可以欺骗u8的检查。 跳过U8环境检测的IE WebControls。提示导入失败后,重新检测通过。

Hbase【使用篇】01:HBase 常用Shell命令

基础命令、DDL命令、增删改查、命名空间相关命令

weixin_40612128的博客 4640

HBASE使用Shell命令创建表

HBase Shell 基本操作

Why Do You Run 1万+

hbase shell 查看列名_HBase Shell命令

【hbase shell命令】进入命令行:hbase shell查看所有表:list查询表:scan "库名:表名",{LIMIT => 10}举例:scan "COSCP:TAG_CUST_BASE",{LIMIT => 10}查询表全部数据:scan '库名:表名'查询某一字段:get 'COSCP:TAG_CUST_BASE','9c97df04c75c7741c2a7f753b...

weixin_39848998的博客 4669

HBase的shell命令

hbase常用的shell命令 1、进入hbase客户端命令操作界面 hbase shell 2、查看帮助命令 help 3、查看当前数据库中有哪些表 list 4、创建一张表 create '表名','列族1','列族2' 5、添加数据 put '表名','row key','列族:列标示符','值' 6、查询数据操作 通过rowkey进行查询 get ‘user’,‘r...

木樨 898

【hdfs】【hBase】【大数据技术基础】 作业二 HBase shell命令

业2 hbase-shell命令 一、运行HBase 1.启动hadoop 首先登陆ssh,之前设置了无密码登陆,因此这里不需要密码; 再切换目录至/usr/local/hadoop ; 再启动hadoop,如果已经启动hadoop请跳过此步骤。 命令如下: ssh localhost cd /usr/local/hadoop ./sbin/start-dfs.sh 2.验证hadoop是否启动 输入命令jps 能看到NameNode,DataNode和SecondaryNameNode都已经成功启动

Kika写代码的博客 1438

Hbase shell命令 基本使用

Hbase shell命令1. 通用操作statusversionwhoamitable_help2. DDL操作createlistalterdisabledisable_allis_disabledenableenable_allis_enabledescribeexistsdropdrop_all3. DML操作 1. 通用操作 status version whoami table_help 2. DDL操作 create list alter disable disable_all is_disa

qq2351227851的博客 3949

Hbase shell命令大全与表结构详解案例展示

1.hbase Shell概述 Apache HBase Shell 是(J)Ruby的 IRB,其中添加了一些 HBase 特定命令。您可以在 IRB 中执行的任何操作,您都应该可以在 HBase Shell 中执行。 0. 首先创建hbase集群的操作用户 hbase_test 1.首先root用户在本地客户端添加hbase_test用户 [root@10-90-50-77-jhdxyjd ~]# useradd hbase_test 2.切换hbase集群的超级用户,创建/u...

涤生大数据 1万+

Hbase shell命令

Hbase shell命令 1.基础概念 (1)表( table ):HBase采用表来组织数据; (2)行( row ):每个表都由行组成,每个行由行键( row key )来标识,行键可以是任意字符串; (3)列族( column family ):一个table有许多个列族,列族是列的集合,属于表结构,也是表的基 本访问控制单元; (4)列标识(column qualifier):属于某一个Column Family:Column Qualifier形式标识,每条记录 可动态添加 (5)时间戳( ti

qq_43203949的博客 2171

Hbase的shell命令练习

Hbase shell命令练习准备启动HBase,要确认已启动Hadoop集群,Zookeeper[root@node5 hadoop-2.5.1]# start-hbase.sh 进入Hbase[root@node5 ~]# hbase shell 显示Hbase中的表hbase(main):001:0> list 1、创建user表,包含info、data两个列族创建表方式一:hbase(mai

爱偷吃香蕉的萌猴子 1557

HBase 常见Shell命令总结

用HBase的时候,老是忘记一些shell命令,每次都需要上网查,好麻烦,干脆就把常见的shell都总结一下吧。进入命令行界面1、进入shell命令行界面./hbase shell表结构相关命令2、创建表结构,这里创建test表,包含fcol1,fcol2create 'test', 'fcol1', 'fcol2' #或 create 'test', {NAME => 'fcol1', VERSI

打不死的小强 1287
上一篇: HBase学习之五:HBase的RowKey设计原则
下一篇: 终端 timed out waiting for input: auto-logout解决!
王树民
博客等级 码龄10年 912粉丝 560原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值