zoukankan      html  css  js  c++  java
  • How to use DBVisualizer to connect to Hbase using Apache Phoenix

    How to use DBVisualizer to connect to Hbase using Apache Phoenix

    Article

    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.

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

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

    1. -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.

    1. Client {
    2. com.sun.security.auth.module.Krb5LoginModule
    3. requireduseTicketCache=false
    4. useKeytab=true
    5. 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>:usersz_hadoop_test.keytab

    Test your connection !






  • 相关阅读:
    Apache 阿帕奇 配置运行环境
    2019年6月多校联训b层——搜索算法 Problem A 宽搜 营救
    西安集训B Day1 test 问题 C: 小明的城堡
    西安集训B层Day1 test 问题 A: 旅行日记
    二分答案—洛谷P1182 数列分段`Section II`
    2019.5.25 Noip模拟测试2 T2题解
    2019.5.25 Noip模拟测试2 T1题解
    DP专题练习 toasting
    2019.5.1 DP专题训练 山峰数(hill)
    React 点击按钮显示div与隐藏div
  • 原文地址:https://www.cnblogs.com/jins-note/p/9513470.html
Copyright © 2011-2022 走看看