Hbase shell 的使用

来源:互联网 发布:论文查重软件 编辑:程序博客网 时间:2024/05/16 09:55

1.进入hbase shell

[root@yufan ~]# hbase shellSLF4J: Class path contains multiple SLF4J bindings.SLF4J: Found binding in [jar:file:/home/bigdata/hbase/hbase-1.1.8/lib/slf4j-log4j12-1.7.5.jar!/org/slf4j/impl/StaticLoggerBinder.class]SLF4J: Found binding in [jar:file:/home/bigdata/hadoop/hadoop-2.2/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.SLF4J: Actual binding is of type [org.slf4j.impl.Log4jLoggerFactory]HBase Shell; enter 'help<RETURN>' for list of supported commands.Type "exit<RETURN>" to leave the HBase ShellVersion 1.1.8, r1687ca79bd7dba1977167e5e7ea20f245bc661b6, Mon Dec 12 21:09:46 PST 2016hbase(main):001:0>
2.创建表

create ‘表名’, ‘列族’

hbase(main):003:0> create 'users', 'info'0 row(s) in 3.1070 seconds=> Hbase::Table - users

3.检查表状态

a)列出存在的表 list

hbase(main):004:0> listTABLE                                                                                                      maizi_table                                                                                                users                                                                                                      2 row(s) in 0.0110 seconds=> ["maizi_table", "users"]
b)查看表的详细信息  describe

hbase(main):005:0> describe 'users'Table users is ENABLED                                                                                     users                                                                                                      COLUMN FAMILIES DESCRIPTION                                                                                {NAME => 'info', BLOOMFILTER => 'ROW', VERSIONS => '1', IN_MEMORY => 'false', KEEP_DELETED_CELLS => 'FALSE', DATA_BLOCK_ENCODING => 'NONE', TTL => 'FOREVER', COMPRESSION => 'NONE', MIN_VERSIONS => '0', BLOCKCACHE => 'true', BLOCKSIZE => '65536', REPLICATION_SCOPE => '0'}                                                  1 row(s) in 0.3780 seconds


原创粉丝点击