HBase入门及实践

关于HBase

[test@prod ~]$ hbase
Usage: hbase [] []
Options:
–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

Commands:
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
TABLE
0 row(s) in 0.1770 seconds

=> []

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

eg:建立一个表scores,有两个列族grad和courese。

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'

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值