通过Xshell 、 Xftp上传 压缩包
解压压缩包
tar -zxvf hbase-1.1.5-bin.tar.gz -C /usr/local/hbase/
修改环境变量 使用vim /etc/profile 命令
export HBASE_HOME= /usr/local/hbase/hbase-1.1.5
export ## PATH=
P
A
T
H
:
PATH:
PATH:HBASE_HOME/bin
使环境变量生效并验证环境变量生效
source /etc/profile
查看版本信息
hbase version
如图所示安装成功!
测试:
hbase shell
创建表
create ‘testtable’,‘colfaml’
查询表
list ‘testtable’
存放数据
put ‘testtable’,‘myrow-1’,‘colfaml:q1’,‘value-1’
put ‘testtable’,‘myrow-2’,‘colfaml:q2’,‘value-2’
put ‘testtable’,‘myrow-3’,‘colfaml:q3’,‘value-3’
put ‘testtable’,‘myrow-2’,‘colfaml:q3’,‘value-3’
通过scan检索数据:
scan ‘testtable’
通过get命令可以获得单个文件的值:
get ‘testtable’,‘myrow-1’
通过delete命令可以删除数据:
delete ‘testtable’,‘myrow-2’,‘colfaml:q3’