Phoenix 构建cdh版hbase遇到的坑

1. 安装phoenix

下载:在github上下载对应版本https://github.com/apache/phoenix

解压:略

编译

修改根目录及其子目录下的pom.xml文件,使cdh版本对应自己集群版本。如图所示

注意:编译中修改版本号遵循原始的写法。4.14.0-cdh5.12.1 版本不可以写成4.14-cdh5.12.1,因为在编译时会有正则校验,书写不规范会导致编译不通过。

命令:

 vim pom.xml
/cdh5. #搜索

修改所有的cdh版本号

编译:mvn clean package -DskipTests

拷贝jar :将下面的jar包拷贝至每一台RegionServer的lib下面

/opt/phoenix/APACHE_PHOENIX-4.14.-cdh5.12.1.p0./lib/phoenix/phoenix-4.14.-cdh5.12.1-server.jar

2. 配置hbase-site.xml

注意前方高能:phoenix4.8版本是个分水岭,配置有所不同

  • phoenix4.8以下版本的配置如下:

配置HMaster的hbase-site.xml

<!-- Phoenix订制的索引负载均衡器 -->
<property>
<name>hbase.master.loadbalancer.class</name> <value>org.apache.phoenix.hbase.index.balancer.IndexLoadBalancer</value>
</property>
<!-- Phoenix订制的索引观察者 -->
<property>
<name>hbase.coprocessor.master.classes</name> <value>org.apache.phoenix.hbase.index.master.IndexMasterObserver</value>
</property>

配置RegionServer的hbase-site.xml

<!-- Enables custom WAL edits to be written, ensuring proper writing/replay of the index updates. This codec supports the usual host of WALEdit options, most notably WALEdit compression. -->
<property>
<name>hbase.regionserver.wal.codec</name>
<value>org.apache.hadoop.hbase.regionserver.wal.IndexedWALEditCodec</value>
</property>
<!-- Prevent deadlocks from occurring during index maintenance for global indexes (HBase 0.98.4+ and Phoenix 4.3.1+ only) by ensuring index updates are processed with a higher priority than data updates. It also prevents deadlocks by ensuring metadata rpc calls are processed with a higher priority than data rpc calls -->
<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>
<!-- To support local index regions merge on data regions merge you will need to add the following parameter to hbase-site.xml in all the region servers and restart. (It’s applicable for Phoenix 4.3+ versions) -->
<property>
<name>hbase.coprocessor.regionserver.classes</name>
<value>org.apache.hadoop.hbase.regionserver.LocalIndexMerger</value>
</property>
  • phoenix4.8+版本只需添加以下配置
<!-- Enables custom WAL edits to be written, ensuring proper writing/replay of the index updates. This codec supports the usual host of WALEdit options, most notably WALEdit compression. -->
<property>
<name>hbase.regionserver.wal.codec</name>
<value>org.apache.hadoop.hbase.regionserver.wal.IndexedWALEditCodec</value>
</property>
<!-- Prevent deadlocks from occurring during index maintenance for global indexes (HBase 0.98.4+ and Phoenix 4.3.1+ only) by ensuring index updates are processed with a higher priority than data updates. It also prevents deadlocks by ensuring metadata rpc calls are processed with a higher priority than data rpc calls -->
<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.8版本之后,安装Phoenix需要把hbase-site.xml文件中的这三个配置项给删掉,因为这三个配置项在4.7及之前的版本会导致在”security enabled”的情况下,每次建立和phoenix server的会话时都会建立一个新的连接实例,短时间内创建大量连接会触发Zookeeper内置的保护机制,拒绝连接。

简单来说,就是HBase在重启的时候,之前赋值到hbase lib目录下的phoenix-4.X.X-HBase-1.X-server.jar包会读取hbase-site.xml文件,结果发现了这三个过期的配置项,然后引起了异常,把这三个配置项删掉就好。。。。。。

(MMP,就这个搞了半天)

山重水复已无路,柳暗花明又一村。感谢这位熊蝶

https://blog.csdn.net/silentasriddle/article/details/78758950

如果是cdh版本的hbase,则在管理界面可直接修改,如下图(phoenxi 4.14的)

3. 修改和zookeeper相关的配置保证启动时通信不超时

修改zookeeper的配置maxSessionTimeout

默认是6000,改为1200000,单位是ms。这个值要大于hbase中的值。

修改hbase的配置

QQ:1710816711(欢迎交流,广告勿扰)

cdh版hbase构建Phoenix 遇到的坑的更多相关文章

  1. CDH版hbase-0.98.1单机安装

    HBase 的安装有两种方式:单机安装和分布式安装.HBase的单机安装了解即可,大家重点掌握HBase 分布式集群的安装.下面我们分别进行介绍. HBase 单机安装 HBase 需要运行在 Had ...

  2. 使用phoenix踩的坑与设计思考

    本文主要介绍在压测HBase的二级索引phoenix时踩的一个坑,使用时需要特别注意,而且背后的原因也很有意思,可以看出HBase和Phoenix对元数据设计上的差异. 1.问题介绍 在做phoeni ...

  3. Maven编译并打包Mahout CDH版源码

    目录 1. 问题描述 最近在使用Mahout里的推荐算法进行实验,由于业务需求,需要修改Mahout源码,将原本输出到HDFS上的结果输出到HBase中.由于Mahout发布的源码都是Maven项目, ...

  4. Unable to connect to HBase using Phoenix JDBC Driver

    Feb 01, 2017; 5:21pm Unable to connect to HBase using Phoenix JDBC Driver 9 posts Hi All,   I am try ...

  5. CDH版Phoenix的安装(图文详解)

    不多说,直接上干货! 写在前面的话 我这里,四个节点的bigdata集群.分别为cmbigdata1.cmbigdata2.cmbigdata3和cmbigdata4. https://i.cnblo ...

  6. Hbase与Phoenix整合

    目录 一.简介 二.安装 三.Phoenix Shell操作 SCHEMA操作 1.创建schema 2.使用schema 3.删除schema 表操作 1.显示所有表 2.创建表 3.表数据的增删改 ...

  7. CDH版本Hbase二级索引方案Solr key value index

    概述 在Hbase中,表的RowKey 按照字典排序, Region按照RowKey设置split point进行shard,通过这种方式实现的全局.分布式索引. 成为了其成功的最大的砝码. 然而单一 ...

  8. Hadoop zookeeper hbase spark phoenix (HA)搭建过程

    环境介绍: 系统:centos7 软件包: apache-phoenix-4.14.0-HBase-1.4-bin.tar.gz  下载链接:http://mirror.bit.edu.cn/apac ...

  9. hbase构建二级索引解决方案

    关注公众号:大数据技术派,回复"资料",领取1024G资料. 1 为什么需要二级索引 HBase的一级索引就是rowkey,我们仅仅能通过rowkey进行检索.假设我们相对Hbas ...

随机推荐

  1. We Need More Bosses CodeForces - 1000E (无向图缩点)

    大意: 给定无向连通图, 定义两个点$s,t$个价值为切断一条边可以使$s,t$不连通的边数. 求最大价值. 显然只有桥会产生贡献. 先对边双连通分量缩点建树, 然后求直径即为答案. #include ...

  2. 数据库及MYSQL基础(2)

    数据库及MySQL基础(1) SQL进阶及查询练习 1,单表的查询练习 SELECT * FROM emp WHERE deptno=30; SELECT ename,empno,deptno FRO ...

  3. MySql8.0 安装重要的两步。

    1.去官网下载mysql社区版 windows安装包. 2.在安装包 安装的过程中,有一步就是启动mysql 会失败: 然后修改服务后,再次回到安装界面点击:execute,就会成功了. 先去配置一下 ...

  4. springboot mvc自动配置(一)自动配置DispatcherServlet和DispatcherServletRegistry

    所有文章 https://www.cnblogs.com/lay2017/p/11775787.html 正文 springboot的自动配置基于SPI机制,实现自动配置的核心要点就是添加一个自动配置 ...

  5. socket基本用法

    socket介绍 1.什么是socket socket是应用层与传输层中间的一个软件抽象层,它是一组接口.它把TCP/IP这些复杂的协议统一封装起来 这样我们只要知道如何使用socket就好,就已经符 ...

  6. js获取URL请求参数与改变src

    js实现: <script> function GetQueryString(name) { var reg = new RegExp("(^|&)" + na ...

  7. man手册--iostat

    iostat手册 IOSTAT(1) Linux User's Manual IOSTAT(1) NAME iostat - Report Central Processing Unit (CPU) ...

  8. windows系统编辑过的脚本文件,在linxu上执行报错 /bin/sh^M: bad interpreter: No such file or directory

    如题! 现象: 当时的场景是这样的:我在IDEA中编辑了项目中的脚本sh,然后利用maven打成zip包.把zip包上传到linux服务器解压运行. 当在linux服务器上运行该sh脚本文件时,提示错 ...

  9. 02 WIndows编程——危险的sizeof

    C语言中,对 sizeof() 的处理都是在编译阶段进行. 下面代码,注意可变参数是怎么使用的 #include<Windows.h> #include<stdio.h> in ...

  10. (转载)小白的linux设备驱动归纳总结(一):内核的相关基础概念---学习总结

    1. 学习总结 小白的博客讲的linux内核驱动这一块的东西比较基础,因此想通过学习他的博客,搭配着看书的方式来学习linux内核和驱动.我会依次更新在学习小白的博客的过程的感悟和体会. 2.1 内核 ...