본문 바로가기
NoSQL/HBase

hbase shell 명령어

by Lohen 2016. 2. 5.

1. COMMAND GROUPS:
1) Group name: general
Commands: status, version

2) Group name: ddl
Commands: alter, alter_async, alter_status, create, describe, disable, disable_all, drop, drop_all, enable, enable_all, exists, is_disabled, is_enabled, list, show_filters

3) Group name: dml
Commands: count, delete, deleteall, get, get_counter, incr, put, scan, truncate

4) Group name: tools
Commands: assign, balance_switch, balancer, close_region, compact, flush, hlog_roll, major_compact, move, split, unassign, zk_dump

5) Group name: replication
Commands: add_peer, disable_peer, enable_peer, list_peers, remove_peer, start_replication, stop_replication

6) Group name: security
Commands: grant, revoke, user_permission 

 

1 list

: list - 전체 테이블 목록 확인

: list 'a' - 테이블명에 'a'가 포함된 특정 테이블 목록 확인


2 enable/disable

: enable(disable) 'table' - 특정 테이블 enable(disable) 시킴


3 create

: create 'table', 'cf' - "cf"라는 column familiy를 가지는 table을 생성함

(이때 테이블은 반드시 하나 이상의 column family를 가져야 한다!)


4 put

: put 'table', 'row1', 'cf', 'value1' - table에 cf이고 value가 "value1"인 row1을 넣음


5 get

: get 'table', 'row1' - table에서 row1을 출력

: get 'table', 'row1', 'cf' - table의 row1에서 column family가 cf인 값들을 출력


6 scan

: scan 'table' - table의 전체 row를 출력

: scan 'table', {COLUMNS => 'cf'} - table의 column family가 cf인 row들을 출력

 

2. SHELL USAGE:
Quote all names in HBase Shell such as table and column names.

Commas delimit command parameters.

Type <RETURN> after entering a command to run it.
Dictionaries of configuration used in the creation and alteration of tables are Ruby Hashes.

They look like this:

{'key1' => 'value1', 'key2' => 'value2', ...}

and are opened and closed with curley-braces.

Key/values are delimited by the
'=>' character combination.

Usually keys are predefined constants such as
NAME, VERSIONS, COMPRESSION, etc. Constants do not need to be quoted.

Type 'Object.constants' to see a (messy) list of all constants in the environment.

If you are using binary keys or values and need to enter them in the shell, use
double-quote'd hexadecimal representation. For example:

hbase> get 't1', "key\x03\x3f\xcd"
hbase> get 't1', "key\003\023\011"
hbase> put 't1', "test\xef\xff", 'f1:', "\x01\x33\x40"

The HBase shell is the (J)Ruby IRB with the above HBase-specific commands added.
For more on the HBase Shell, see http://hbase.apache.org/docs/current/book.html

반응형

'NoSQL > HBase' 카테고리의 다른 글

hbase api 사이트 (영문)  (0) 2016.02.05
HBase, BigTable, Cassandra Schema Design  (0) 2016.02.05
hbase Schema 이해하기 위한 링크들  (0) 2016.02.05
hbase tool 링크  (0) 2016.02.05
[이건 되는거다]hbase 설치  (0) 2016.02.05