1. 官网资料

Use JDBC to get a connection to an HBase cluster like this:

Connection conn = DriverManager.getConnection("jdbc:phoenix:server1,server2:3333",props);

where props are optional properties which may include Phoenix and HBase configuration properties, and the connection string which is composed of:

jdbc:phoenix [ :<zookeeper quorum> [ :<port number> [ :<root node> [ :<principal> [ :<keytab file> ] ] ] ] ] 

For any omitted parts, the relevant property value, hbase.zookeeper.quorum, hbase.zookeeper.property.clientPort, and zookeeper.znode.parent will be used from hbase-site.xml configuration file. The optional principal and keytab file may be used to connect to a Kerberos secured cluster. If only principal is specified, then this defines the user name with each distinct user having their own dedicated HBase connection (HConnection). This provides a means of having multiple, different connections each with different configuration properties on the same JVM.

For example, the following connection string might be used for longer running queries, where the longRunningProps specifies Phoenix and HBase configuration properties with longer timeouts:

Connection conn = DriverManager.getConnection(“jdbc:phoenix:my_server:longRunning”, longRunningProps);

while the following connection string might be used for shorter running queries:

Connection conn = DriverManager.getConnection("jdbc:phoenix:my_server:shortRunning", shortRunningProps);

Please read the relevant FAQ entry for example URLs.

2. 源码其他配置方法

经过查看phoenix源代码,发现
getConnection还有一个带properties的接口,应该是连接属性,

properties.setProperty("hbase.zookeeper.quorum", "172.16.31.165,172.16.31.166,172.16.31.167");
properties.setProperty("hbase.master.kerberos.principal", "hbase/_HOST@COM");
properties.setProperty("hbase.master.keytab.file", "/etc/security/keytabs/hbase.service.keytab");
properties.setProperty("hbase.regionserver.kerberos.principal", "hbase/_HOST@COM"); 
properties.setProperty("hbase.regionserver.keytab.file", "/etc/security/keytabs/hbase.service.keytab");
properties.setProperty("phoenix.queryserver.kerberos.principal", "hbase/_HOST@COM"); 
properties.setProperty("phoenix.queryserver.keytab.file", "/etc/security/keytabs/hbase.service.keytab");
properties.setProperty("hbase.security.authentication", "kerberos"); 
properties.setProperty("hadoop.security.authentication", "kerberos");
properties.setProperty("zookeeper.znode.parent", "/hbase");
con = DriverManager.getConnection("jdbc:phoenix:172.16.31.165,172.16.31.166,172.16.31.167:2181:/hbase:"+principal+":"+keytab, properties);

phoenix kerberos 连接配置的更多相关文章

  1. Kerberos主从配置文档

    Kerberos主从配置文档   1. Kerberos主从同步机制 在Master上通过以下命令同步数据: kdb5_util dump /var/kerberos/krb5kdc/slave_db ...

  2. [转] kerberos安装配置与使用

    [From] https://blog.csdn.net/lovebomei/article/details/79807484 1.Kerberos协议: Kerberos协议主要用于计算机网络的身份 ...

  3. HBase单机安装及Phoenix JDBC连接

    HBase是建立在Hadoop文件系统之上的分布式面向列的数据库,它是横向扩展的.它利用了Hadoop的文件系统(HDFS)提供的容错能力. HBase提供对数据的随机实时读/写访问,可以直接HBas ...

  4. “连接配置中心失败,将无法进行正常管理”--腾讯通RTX管理器

    [故障现象]: 腾讯通RTX管理器提示“连接配置中心失败,将无法进行正常管理” [解决办法]: 在系统服务中启动“RTX_ConfigCenter”服务即可. 文章收集自网络

  5. Nginx与Tomcat、Client之间请求的长连接配置不一致问题解决[转]

    http://bert82503.iteye.com/blog/2152613 前些天,线上出现“服务端长连接与客户端短连接引起Nginx的Writing.Active连接数过高问题”,这个是由于“服 ...

  6. SharePoint服务器将连接配置数据库的连接字符串保存在什么地方?

    经常有人问我这个问题,SharePoint服务器将连接配置数据库的连接字符串保存在什么地方?虽然其他SharePoint服务器场设置都是保存到了配置数据库里面,但连接配置数据库本身的连接字符串,肯定是 ...

  7. Android - 设置adb的usb连接配置

    设置adb的usb连接配置 本文地址: http://blog.csdn.net/caroline_wendy 把须要測试的手机连接入电脑.通过系统查找USB连接配置,找到厂商ID: 把ID加入进ad ...

  8. Oracle BEQ方式连接配置

    Oracle BEQ方式连接配置 服务端和客户端在同一台机器上,可以使用BEQ连接,BEQ连接可以理解为进程间直接通信,不需要走网络监听,性能更高. 可以参考MOS:How To Connect Us ...

  9. mongodb远程连接配置

    mongodb远程连接配置如下: 1.修改配置文件mongodb.conf 命令:vim /etc/mongodb.conf 把 bind_ip=127.0.0.1 这一行注释掉或者是修改成 bind ...

随机推荐

  1. zabbix配置邮箱报警功能

    1.查看是否安装mailx rpm -qa |grep mailx,本人机器上面已经安装如果没有安装直接用yum安装即可 yum -y install mailx2.vim /etc/mail.rc ...

  2. Leetcode——2. 两数相加

    难度: 中等 题目 You are given two non-empty linked lists representing two non-negative integers. The digit ...

  3. 目标检测论文解读13——FPN

    引言 对于小目标通常需要用到多尺度检测,作者提出的FPN是一种快速且效果好的多尺度检测方法. 方法 a,b,c是之前的方法,其中a,c用到了多尺度检测的思想,但他们都存在明显的缺点. a方法:把每图片 ...

  4. 微信小程序,相关代码

    table th:nth-of-type(1) { width: 200px; } 代码 作用 bindtap bindload 当图片载入完毕时触发,event.detail = {height, ...

  5. 08-人脸识别-FaceNet-classify.py代码阅读(说明见注释)

    """An example of how to use your own dataset to train a classifier that recognizes pe ...

  6. janusgraph的数据模型

    janusgraph的数据模型--->参考 1.简介 janusgraph的数据模型,就是一数据结构中得图结构相似.所以janusgraph的数据schema主要定义在三个要素上:顶点,边,属性 ...

  7. AtCoder Grand Contest 033 题解

    传送门 我比赛的时候怕不是在睡觉啊-- \(A\ Darker\ and\ Darker\) 我是不是想得太复杂了--根本没必要像我这样做吧-- 首先问题可以转化成令\(p_{i,j}\)表示到\(( ...

  8. 分享:手把手教你如何免费且光荣地使用正版IntelliJ IDEA

    https://mp.weixin.qq.com/s/6nRYmn6gAWFLg3mUIN_ojg TIPS 近日在个人技术讨论QQ群里,谈论到IDEA的那些事儿.有童鞋居然在某电商网站花钱买激活码. ...

  9. Babel7 转码

    ES6 (ES2015)更新了很多新的js语法, 也添加了一些新的API, 但不是所有的浏览器对这些新特性都支持的很好, 通过babel可以高版本的js转成低版本的js (ES 5.1), 同时对于J ...

  10. zy的日志报表执行有问题。crontab显示执行了任务,代码中应该有问题

    crontab定时任务在日志记录中是执行了 但是在执行脚本的过程中报错了, 找不到问题原因,以后也要在脚本中加入日志记录, 但是奇怪的是在中午和晚上是正常的, 应该是那个时间段的判断逻辑有问题,导致程 ...