hbase使用Phoenix

10 篇文章 0 订阅
10 篇文章 0 订阅

Phoenix

Hbase查询工具,提供在hbase中sql方式查询。提供了很多sql语法,二级索引等传统数据库支持的功能。新版本中有支持transaction(beta)。

官网

http://phoenix.apache.org/Phoenix-in-15-minutes-or-less.html、

二进制文件下载

http://mirror.bit.edu.cn/apache/phoenix/apache-phoenix-4.9.0-HBase-1.2/bin/

 

部署安装

http://www.zhangshuai.top/2015/09/01/phoenix%E5%AE%89%E8%A3%85%E4%B8%8E%E4%BD%BF%E7%94%A8%E6%96%87%E6%A1%A3/

 

To install a pre-built phoenix, use thesedirections:

·        Download and expand the latest phoenix-[version]-bin.tar.

·        Add the phoenix-[version]-server.jar to the classpath ofall HBase region server and master and remove any previous version. An easy wayto do this is to copy it into the HBase lib directory (usephoenix-core-[version].jar for Phoenix 3.x)

·        Restart HBase.

·        Add the phoenix-[version]-client.jar to the classpath ofany Phoenix client.

·        4、配置Phoenix

·        4.1、将phoenix-4.9.0-HBase-1.2-bin/目录下phoenix-core-4.9.0-HBase-1.2.jar、phoenix-4.9.0-HBase-1.2-server.jar拷贝到各个hbase的lib目录下。

·        4.2、将hbase的配置文件hbase-site.xml、Hadoop/etc/hadoop下的core-site.xml、hdfs-site.xml放到phoenix-4.9.0-HBase-1.2-bin/bin/下,替换Phoenix原来的配置文件。

·        4.3、重启hbase集群,使Phoenix的jar包生效。

 

 

Hbase表映射到Phoenix

1、安装好phoenix后对于Hbase中已经存在的数据表不会自动进行映射,所以想要再phoenix中操作HBase已有数据表就需要手动进行配置。

官网,how i map a existing hbase table

http://blog.csdn.net/maomaosi2009/article/details/45598985

2、在Phoenix中建立相对于hbase表的视图 view

http://stackoverflow.com/questions/29840477/phoenix-map-existing-hbase-table

Java开发

http://www.itdadao.com/articles/c15a1289911p0.html

 

 hbase清除数据

Usage: hbase clean (--cleanZk|--cleanHdfs|--cleanAll)
Options: 
        --cleanZk   cleans hbase related data from zookeeper.
        --cleanHdfs cleans hbase related data from hdfs.
        --cleanAll  cleans hbase related data from both zookeeper and hdfs.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值