美文网首页
HBase启动等操作

HBase启动等操作

作者: 来往穿梭 | 来源:发表于2017-03-23 16:36 被阅读109次

启动HBase:

  • 先启动zookeeper
启动zookeeper
  • 启动hbase
启动hbase
  • 去60010端口查看
    出现此页面证明启动成功
去60010端口查看

启动hbase的shell

[xc2046@master bin]$ hbase shell
2017-03-23 16:11:56,974 INFO  [main] Configuration.deprecation: hadoop.native.lib is deprecated. Instead, use io.native.lib.available
HBase Shell; enter 'help<RETURN>' for list of supported commands.
Type "exit<RETURN>" to leave the HBase Shell
Version 0.98.9-hadoop2, r96878ece501b0643e879254645d7f3a40eaf101f, Mon Dec 15 23:00:20 PST 2014

hbase(main):001:0> list
TABLE                                                                           
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/home/xc2046/hbase-0.98.9-hadoop2/lib/slf4j-log4j12-1.6.4.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/home/xc2046/hadoop-2.6.0/share/hadoop/common/lib/slf4j-log4j12-1.7.5.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
2017-03-23 16:12:09,238 WARN  [main] util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
0 row(s) in 2.4790 seconds

=> []
hbase(main):002:0> create 'scores','grade','course'
0 row(s) in 0.8920 seconds

=> Hbase::Table - scores
hbase(main):003:0> list
TABLE                                                                           
scores                                                                          
1 row(s) in 0.0240 seconds

=> ["scores"]


hbase(main):004:0> describe 'scores'
Table scores is ENABLED                                                         
COLUMN FAMILIES DESCRIPTION                                                     
{NAME => 'course', DATA_BLOCK_ENCODING => 'NONE', BLOOMFILTER => 'ROW', REPLICAT
ION_SCOPE => '0', VERSIONS => '1', COMPRESSION => 'NONE', MIN_VERSIONS => '0', T
TL => 'FOREVER', KEEP_DELETED_CELLS => 'FALSE', BLOCKSIZE => '65536', IN_MEMORY 
=> 'false', BLOCKCACHE => 'true'}                                               
{NAME => 'grade', DATA_BLOCK_ENCODING => 'NONE', BLOOMFILTER => 'ROW', REPLICATI
ON_SCOPE => '0', VERSIONS => '1', COMPRESSION => 'NONE', MIN_VERSIONS => '0', TT
L => 'FOREVER', KEEP_DELETED_CELLS => 'FALSE', BLOCKSIZE => '65536', IN_MEMORY =
> 'false', BLOCKCACHE => 'true'}                                                
2 row(s) in 0.0650 seconds



  hbase> put 'ns1:t1', 'r1', 'c1', 'value'
  hbase> put 't1', 'r1', 'c1', 'value'
  hbase> put 't1', 'r1', 'c1', 'value', ts1
  hbase> put 't1', 'r1', 'c1', 'value', {ATTRIBUTES=>{'mykey'=>'myvalue'}}
  hbase> put 't1', 'r1', 'c1', 'value', ts1, {ATTRIBUTES=>{'mykey'=>'myvalue'}}
  hbase> put 't1', 'r1', 'c1', 'value', ts1, {VISIBILITY=>'PRIVATE|SECRET'}

The same commands also can be run on a table reference. Suppose you had a reference
t to table 't1', the corresponding command would be:

  hbase> t.put 'r1', 'c1', 'value', ts1, {ATTRIBUTES=>{'mykey'=>'myvalue'}}

hbase(main):007:0> put'scores','Tom','grade',5
0 row(s) in 0.1090 seconds

hbase(main):008:0> put 'scores','Tom','grade',5
0 row(s) in 0.0100 seconds

hbase(main):009:0> put 'scores','Tom','course:math',97
0 row(s) in 0.0590 seconds

hbase(main):010:0> list
TABLE                                                                           
scores                                                                          
1 row(s) in 0.0410 seconds

=> ["scores"]
hbase(main):011:0> get 'scores','Tom'
COLUMN                CELL                                                      
 course:math          timestamp=1490257052698, value=97                         
 grade:               timestamp=1490257030209, value=5                          
2 row(s) in 0.0490 seconds

hbase(main):012:0> scan'scores',{COLUMNS=>'course'}
ROW                   COLUMN+CELL                                               
 Tom                  column=course:math, timestamp=1490257052698, value=97     
1 row(s) in 0.0470 seconds

hbase(main):013:0> delete'scores','Tom','course:math'
0 row(s) in 0.0330 seconds

hbase(main):014:0> get 'scores','Tom'
COLUMN                CELL                                                      
 grade:               timestamp=1490257030209, value=5                          
1 row(s) in 0.0260 seconds

相关文章

  • HBase启动等操作

    启动HBase: 先启动zookeeper 启动hbase 去60010端口查看出现此页面证明启动成功 启动hba...

  • HBase从入门到精通(三) - 基本操作

    0. HBase Shell HBase Shell是HBase内置的操作控制台。 启动HBase Shell:命...

  • Hbase rest 举例

    写在前面: 启动rest服务,使用http请求操作hbase(设置端口为8080)。对于hbase rest的使用...

  • Hbase操作

    启动Hbase要先启动ZK 和HDFS 启动/停止Hbase start-hbase.sh stop-hbase....

  • HBase 数据模型

    理解 HBase 的数据模型,能够更好的理解 HBase 针对 Region 的操作(Split、Compact等...

  • hbase 服务化文档

    hbase 单独抽出平台 说白了 就是解决 hbase put ,scan 操作 ,开发比较吃力 ,不优雅等问题。...

  • 使用 Spark 读写 HBase 数据

    Use Spark to read and write HBase data 启动 hbase 在 HBase 中...

  • PHP使用Thrift操作Hbase

    HBase 启动 Thrift服务 hbase启动thrift服务 需要注意的是,这里启动的是thrift2服务,...

  • hbase 启动错误no active master locat

    问题描述 hadoop启动后,启动 hbase, 进入 hbase shell,执行命令时出现 “zookeepe...

  • HBase学习目录

    Hbase安装Hbase Shell general操作 ddl操作 dml操作 内置过滤器samplehttp:...

网友评论

      本文标题:HBase启动等操作

      本文链接:https://www.haomeiwen.com/subject/vvktottx.html