下载安装包
首先下载 phoenix 对应 hbase jar包
http://phoenix.apache.org/download.html
测试环境已下载
apache-phoenix-4.14.1-HBase-1.2-bin.tar.gz (80 /data/soft)
安装
将 apache-phoenix-4.14.1-HBase-1.2-bin.tar.gz放入hbase master(eagle67) 服务器上(作phoenix的客户端)
$cd /data/soft
$mkdir phoenix
$cd phoenix
$mkdir phoenix
$scp -P 39876 apache-phoenix-4.14.1-HBase-1.2-bin.tar.gz eagle@eagle67:/data/soft
$tar -zxvf apache-phoenix-4.14.1-HBase-1.2-bin.tar.gz
$mv apache-phoenix-4.11.1-HBase-1.2-bin/ phoenix
将
phoenix-4.14.1-HBase-1.2-client.jar(这个jar包主要是异步建索引需要,可在dataNode节点 使用创建)(不要放在有hive的机器上,会与hive冲突)
phoenix-4.14.1-HBase-1.2-server.jar
phoenix-4.14.1-HBase-1.2-queryserver.jar
phoenix-core-4.14.1-HBase-1.2.jar
phoenix-queryserver-4.14.1-HBase-1.2.jar
拷贝到hbase集群中的所有region server的hbase的lib目录下
$scp -P 39876 phoenix-core-4.14.1-HBase-1.2.jar eagle@eagle55:/data/soft/hbase/lib
在 hbase-site.xml 中 添加非事务可变索引配置,本地索引4.8 以上版本已支持,不用做添加配置支持
<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>
重启hbase
$cd /data/soft/hbase/bin
$./stop-hbase.sh
$./start-hbase.sh