By | 2019年2月12日

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/wxs060524/article/details/80495106


[test@prod ~]$ hbase
Usage: hbase [] []
–config DIR Configuration direction to use. Default: ./conf
–hosts HOSTS Override the list in ‘regionservers’ file
–auth-as-server Authenticate to ZooKeeper using servers configuration

Some commands take arguments. Pass no args or -h for usage.
shell Run the HBase shell
hbck Run the hbase ‘fsck’ tool
snapshot Create a new snapshot of a table
snapshotinfo Tool for dumping snapshot information
wal Write-ahead-log analyzer
hfile Store file analyzer
zkcli Run the ZooKeeper shell
upgrade Upgrade hbase
master Run an HBase HMaster node
regionserver Run an HBase HRegionServer node
zookeeper Run a Zookeeper server
rest Run an HBase REST server
thrift Run the HBase Thrift server
thrift2 Run the HBase Thrift2 server
clean Run the HBase clean up script
classpath Dump hbase CLASSPATH
mapredcp Dump CLASSPATH entries required by mapreduce
pe Run PerformanceEvaluation
ltt Run LoadTestTool
version Print the version
CLASSNAME Run the class named CLASSNAME


[test@prod80 ~]$ hbase shell
18/05/29 11:19:52 INFO Configuration.deprecation: hadoop.native.lib is deprecated. Instead, use io.native.lib.available
HBase Shell; enter ‘help’ for list of supported commands.
Type “exit” to leave the HBase Shell
Version 1.2.0-cdh5.14.2, rUnknown, Tue Mar 27 13:32:35 PDT 2018


hbase(main):001:0> list
0 row(s) in 0.1770 seconds

=> []

create ‘表名称’,‘列名称1’,…,‘列名称n’


hbase(main):004:0> `create 'order','id','type',SPLITS => ['1300','1310','1320','1520','1550','1560','1850','1860']`


hbase(main):009:0> put 'scores','Tom','id:','5'
hbase(main):011:0> put 'scores','Tom','type:1','100'
hbase(main):012:0> put 'scores','Tom','type:2','100'