Support Questions

Find answers, ask questions, and share your expertise

Phoenix connection error while secure Hbase cluster

avatar

Hi

I have configured Phoenix on top of Hbase and facing below error while I'm trying to connect using jdbc:phoenix:<Zookeeper_host_name>:<port_number>:<secured_Zookeeper_node>:<principal_name>:<HBase_headless_keytab_file> for kerberized cluster. Any needfull help is highly appericated.

Error message:

Setting property: [isolation, TRANSACTION_READ_COMMITTED]
issuing: !connect jdbc:phoenix:jdbc:phoenix:hostname.domain.com:2181:/hbase-secure:hbase@HDP.DOMAIN.COM:/etc/security/keytabs/hbase.headless.keytab none none org.apache.phoenix.jdbc.PhoenixDriver
Connecting to jdbc:phoenix:jdbc:phoenix:hostname.domain.com:2181:/hbase-secure:hbase-hdppoc@HDP.DOMAIN.COM:/etc/security/keytabs/hbase.headless.keytab
Error: ERROR 102 (08001): Malformed connection url. :jdbc:phoenix:hostname.domain.com:2181:/hbase-secure:hbase-hdppoc@HDP.DOMAIN.COM:/etc/security/keytabs/hbase.headless.keytab (state=08001,code=102)
java.sql.SQLException: ERROR 102 (08001): Malformed connection url. :jdbc:phoenix:hostname.domain.com:2181:/hbase-secure:hbase-hdppoc@HDP.DOMAIN.COM:/etc/security/keytabs/hbase.headless.keytab
        at org.apache.phoenix.exception.SQLExceptionCode$Factory$1.newException(SQLExceptionCode.java:386)
        at org.apache.phoenix.exception.SQLExceptionInfo.buildException(SQLExceptionInfo.java:145)
        at org.apache.phoenix.jdbc.PhoenixEmbeddedDriver$ConnectionInfo.getMalFormedUrlException(PhoenixEmbeddedDriver.java:186)
        at org.apache.phoenix.jdbc.PhoenixEmbeddedDriver$ConnectionInfo.create(PhoenixEmbeddedDriver.java:228)
        at org.apache.phoenix.jdbc.PhoenixDriver.getConnectionQueryServices(PhoenixDriver.java:162)
        at org.apache.phoenix.jdbc.PhoenixEmbeddedDriver.connect(PhoenixEmbeddedDriver.java:132)
        at org.apache.phoenix.jdbc.PhoenixDriver.connect(PhoenixDriver.java:151)
        at sqlline.DatabaseConnection.connect(DatabaseConnection.java:157)
        at sqlline.DatabaseConnection.getConnection(DatabaseConnection.java:203)
        at sqlline.Commands.connect(Commands.java:1064)
        at sqlline.Commands.connect(Commands.java:996)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at sqlline.ReflectiveCommandHandler.execute(ReflectiveCommandHandler.java:36)
        at sqlline.SqlLine.dispatch(SqlLine.java:804)
        at sqlline.SqlLine.initArgs(SqlLine.java:588)
        at sqlline.SqlLine.begin(SqlLine.java:656)
        at sqlline.SqlLine.start(SqlLine.java:398)
        at sqlline.SqlLine.main(SqlLine.java:292)
sqlline version 1.1.8
0: jdbc:phoenix:jdbc:phoenix:hostname.>
0: jdbc:phoenix:jdbc:phoenix:hostname.> list
. . . . . . . . . . . . . . . . . . . . . . .> ;
No current connection
0: jdbc:phoenix:jdbc:phoenix:hostname.>
1 ACCEPTED SOLUTION

avatar
Super Collaborator

If you are using sqlline, you don't need "jdbc:phoenix:" prefix. It adds it automatically (that's why log shows "jdbc:phoenix:jdbc:phoenix:").

View solution in original post

10 REPLIES 10

avatar
Contributor

No. the above command is to be used inside beeline.

I am assuming you are trying to connect to phoenix python shell in which case these are the commands.

these are the commands in linux shell using which I was able to use to get in to phoenix shell in kerberized cluster.

export HBASE_CONF_PATH=/etc/hbase/conf:/etc/hadoop/conf

if you are logged in as your own user

kinit
/usr/hdp/current/phoenix-client/bin/sqlline.py hostname.domain.com:2181:/hbase-secure 

if using logged in as hbase user

kinit -k -t /etc/security/keytabs/hbase.headless.keytab hbase
/usr/hdp/current/phoenix-client/bin/sqlline.py hostname.domain.com:2181:/hbase-secure:hbase@domain.com:/etc/security/keytabs/hbase.headless.keytab

then you can run following commands to show list of phoenix tables

!tables