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 (2)

DB Visualizer is a popular free tool that allows developers to organize development tools for RDBMS development. With Apache Phoenix, that allows SQL like capability for Hbase, we can use DBVisualizer to connect to Apache Phoenix layer for HBase.

Verified with following versions.

  • DBVisualizer version 9.2.12
  • hbase-client-1.1.2.2.3.2.0-2950.jar
  • phoenix-4.4.0.2.3.2.0-2950-client.jar

First Add Phoenix driver to DBVisualizer. In DBVisualizer, go to Tools->Driver Manager and add a new driver. Add both hbase-client and phoenix-client jar. This will add a new Phoenix driver.

1. Connecting to Non-Kerberos cluster

To connect to a Non-Kerberos cluster, use jdbc:phoenix:<zookeeper host>:<zookeeper port>:<hbase_z_node> as connection string where hbase_z_node is :/hbase by default.

2. Connecting to Kerberos cluster using cached ticket

To connect to a Kerberos cluster,

a. add following files to DBVisualizer resources directory.

  • hdfs-site.xml
  • hbase-site.xml
  • core-site.xml

b. Copy krb5.conf file to local workstation.

c. Create a jaas file with following entry.

Client { 
com.sun.security.auth.module.Krb5LoginModule required  useTicketCache=true  renewTicket=true 
serviceName="zookeeper";};

Modify dbvisgui.bat file to add following parameters for launching DBVisualizer

-Djava.security.auth.login.config="<path-to-jaas-file>" -Djava.security.krb5.conf="<path-to-krb5-file>"

d. Connection string for cached keytab will be

jdbc:phoenix:<zookeeper host>:<zookeeper port>:/hbase-secure:<path-to-jaas file>

3. Connecting to Kerberos cluster using keytab

a. add following files to DBVisualizer resources directory.

  • hdfs-site.xml
  • hbase-site.xml
  • core-site.xml

b. Copy krb5.conf file to local workstation.

c. copy keytab file use for connecting to Hbase.

d. Create a jaas file with following entry.

Client {
com.sun.security.auth.module.Krb5LoginModule 
requireduseTicketCache=false
useKeytab=true
serviceName="zookeeper";};

Connection string for this case will be

jdbc:phoenix:<zookeeper host>:<zookeeper port>:/hbase-secure:<Principal>:<path-to-keytab>

Sample connection string

jdbc:phoenix:host0001:2181:/hbase-secure:<principal>:\users\z_hadoop_test.keytab

Test your connection !

7,770 Views
Comments
New Contributor

@Shishir Saxena I followed your instructions [Connecting to Kerberos cluster using keytab] on connecting to Phoenix through Db Visualizer for kerberos enabled cluster. Connection is getting timed out with below error message. Any suggestions? Thanks in advance.

An error occurred while establishing the connection: Long Message: callTimeout=600000, callDuration=620131: Details: Type: org.apache.phoenix.exception.PhoenixIOException Error Code: 101 SQL State: 08000

Point #2 of connecting DBVisualizer (or any tool) to Phoenix with Kerberos using a Ticket Cache does not work.

The Phoenix JDBC url does not support a JAAS configuration file as an argument and, even if it did, Phoenix does not support automated Kerberos logins via JAAS. This suggestion is wrong.

Contributor
New Contributor

@Shishir Saxena I also followed your instruction No. 3 [Connectting to Kerberos cluister using keytab] on connecting to Phoenix. But failed, my version is hdp 2.6.4, can you show more details? thank u so much.

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