其他分享
首页 > 其他分享> > cdh5.8.0集成phoenix

cdh5.8.0集成phoenix

作者:互联网

cdh5.8.0集成phoenix

1、下载编译cdh版本适配phoenix

#下载源码
git clone https://github.com/chiastic-security/phoenix-for-cloudera.git
cd phoenix-for-cloudera/
git branch --all
git checkout remotes/origin/4.8-HBase-1.2-cdh5.8
#编译
mvn clean package -DskipTests -Dcdh.flume.version=1.6.0

2、获取编译后的压缩包

3、拷贝安装

  1. 将phoenix-4.8.0-cdh5.8.0.tar.gz远程copy至对应服务器
  2. 解压phoenix-4.8.0-cdh5.8.0.tar.gz至/opt目录
  3. 进入解压目录,找到phoenix-4.8.0-cdh5.8.0-server.jar,将其拷贝到每个RegionServer目录(/opt/cloudera/parcels/CDH/lib/hbase/lib)下

4、hbase配置文件

<property>
    <name>hbase.table.sanity.checks</name>
    <value>false</value>
</property>
<property>
    <name>hbase.regionserver.wal.codec</name>
    <value>org.apache.hadoop.hbase.regionserver.wal.IndexedWALEditCodec</value>
</property>
<property>
    <name>hbase.region.server.rpc.scheduler.factory.class</name>
    <value>org.apache.hadoop.hbase.ipc.PhoenixRpcSchedulerFactory</value>
    <description>Factory to create the Phoenix RPC Scheduler that uses separate queues for index and metadata updates</description>
</property>
<property>
    <name>hbase.rpc.controllerfactory.class</name>
    <value>org.apache.hadoop.hbase.ipc.controller.ServerRpcControllerFactory</value>
    <description>Factory to create the Phoenix RPC Scheduler that uses separate queues for index and metadata updates</description>
</property>

4、连接测试

进入phoenix-4.8.0-cdh5.8.0/bin目录,使用sqlline.py连接hbase,成功即可

./sqlline.py zk:2181/hbase

5、操作命令

!tables
CREATE TABLE USER (ID BIGINT NOT NULL PRIMARY KEY, NAME VARCHAR  NULL,AGE INTEGER  NULL, ADDRESS VARCHAR NULL) ;
CREATE LOCAL INDEX USER_IDX ON USER(NAME);
UPSERT INTO USER(ID,NAME,AGE,ADDRESS) VALUES(1,'name1',11,'china');
SELECT * FROM USER;

标签:集成,phoenix,cdh5.8,4.8,编译,USER,hbase
来源: https://blog.csdn.net/weixin_43379828/article/details/118539746