hive映射phoenix && cdh hive组件升级

 

Phoenix Storage Handler for Apache Hive

官网帮助  https://phoenix.apache.org/hive_storage_handler.html

 

要求版本:

Phoenix 4.8.0+

Hive 1.2.1+

 

基于CM搭建的CDH集群之hive组件升级

 

1、cd /opt/cloudera/parcels/CDH/lib/hive;mkdir lib121 

2、下载hive1.2.1版本,并将该版本lib下所有文件拷贝到lib121中
3、修改/opt/cloudera/parcels/CDH/lib/hive/bin/hive中HIVE_LIB变量
HIVE_LIB=${HIVE_HOME}/lib121

 

参考  https://blog.csdn.net/xjping0794/article/details/77542096

 

升级到hive1.2.1   之前hive1.1的不能连接

 

 

 

测试:

 

create table phoenix_table (
  s1 string,
  i1 string,
  f1 string,
  d1 string
)
STORED BY 'org.apache.phoenix.hive.PhoenixStorageHandler'
TBLPROPERTIES (
  "phoenix.table.name" = "phoenix_table",
  "phoenix.zookeeper.quorum" = "10.30.18.12",
  "phoenix.zookeeper.znode.parent" = "/hbase",
  "phoenix.zookeeper.client.port" = "2181",
  "phoenix.rowkeys" = "s1, i1",
  "phoenix.column.mapping" = "s1:s1, i1:i1, f1:f1, d1:d1",
  "phoenix.table.options" = "SALT_BUCKETS=10, DATA_BLOCK_ENCODING='DIFF'"
);

 

insert into phoenix_table values("aaa","bbb","ccc","ddd");

 

create external table phoenix_ext_table (
  s1 string,
  i1 string,
  f1 string,
  d1 string
)
STORED BY 'org.apache.phoenix.hive.PhoenixStorageHandler'
TBLPROPERTIES (
  "phoenix.table.name" = "phoenix_table",
  "phoenix.zookeeper.quorum" = "10.30.18.12",
  "phoenix.zookeeper.znode.parent" = "/hbase",
  "phoenix.zookeeper.client.port" = "2181",
  "phoenix.rowkeys" = "s1, i1",
  "phoenix.column.mapping" = "s1:s1, i1:i1, f1:f1, d1:d1",
  "phoenix.table.options" = "SALT_BUCKETS=10, DATA_BLOCK_ENCODING='DIFF'"
);

 

 

遇到的问题:
1.cdh升级hive1.1到1.2.1 客户端不能连接
2.小写的pheonix 怎么关联hive
3.Hbase数据更新Phoenix对应索引表不更新。

 

问题还没有解决

您可以选择一种方式赞助本站