Community Articles
Find and share helpful community-sourced technical articles
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.
Labels (1)

The Phoenix documentation here leaves out a few pieces in order to make a successful connection to HBase, through the Phoenix Driver. They assume that the connection is from the 'localhost'. May work great, but that's unlikely in the real world.

Required Jars

phoenix-client.jar hbase-client.jar (not mentioned in the Phoenix Docs)

URL Details

The full adbc connection URL syntax for phoenix is:

Basic Connections jdbc:phoneix[:zk_quorum][:zk_port][:zk_hbase_path]

The "zk_quorum" is a comma separated list of the ZooKeeper Servers.

The "zk_port" is the ZooKeeper port.

The "zk_hbase_path" is the path used by Hbase to stop information about the instance. On a 'non' kerberized cluster the default zk_hbase_path for HDP is '/hbase-unsecure'.

Sample JDBC URL
jdbc:phoenix:m1.hdp.local,m2.hdp.local,d1.hdp.local:2181:/hbase-unsecure
For Kerberos Cluster Connections
jdbc:phoneix[:zk_quorum][:zk_port][:zk_hbase_path][:headless_keytab_file:principal]
Sample JDBC URL
jdbc:phoenix:m1.hdp.local,m2.hdp.local,d1.hdp.local:2181:/hbase-secure:/Users/dstreev/keytabs/myuser.headless.keytab:dstreev@HDP.LOCAL

They say that the above items in the url beyond 'phoenix' are optional if the clusters 'hbase-site.xml' file is in the path. I found that when I presented a copy of the 'hbase-site.xml' from the cluster and left off the optional elements, I got errors referencing 'Failed to create local dir'.

When I connected successfully from DBVisualizer to HBase with the Phoenix JDBC Driver, it took about 10-20 seconds to connect.

10,661 Views
Comments

Hey @David Streever

I think you have the ordering of keytab and principal in the URL reversed. Per the code, it reads the principal and then the keytab.

Not applicable

How can i pass reference of hbase-site.xml file in Phoenix JDBC java code?

New Contributor

I think this is for thick driver since thin one does not require HBase client jar.

Don't have an account?
Coming from Hortonworks? Activate your account here
Version history
Revision #:
1 of 1
Last update:
‎10-02-2015 08:51 PM
Updated by:
 
Contributors
Top Kudoed Authors