- Subscribe to RSS Feed
- Mark Question as New
- Mark Question as Read
- Float this Question for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
Phoenix connection error while secure Hbase cluster
- Labels:
-
Apache HBase
-
Apache Phoenix
Created ‎06-06-2016 10:09 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.>
Created ‎06-06-2016 10:15 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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:").
Created ‎06-06-2016 10:15 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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:").
Created ‎06-06-2016 10:29 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks, Got progressed but it's not connecting to phoenix. For a long time, it stopped at below and not moving further.
Setting property: [isolation, TRANSACTION_READ_COMMITTED] issuing: !connect jdbc:phoenix:hostname.domain.com:2181:/hbase-secure:hbase-hdppoc@POC.HDP.DOMAIN.COM:/etc/security/keytabs/hbase.headless.keytab none none org.apache.phoenix.jdbc.PhoenixDriver Connecting to jdbc:phoenix:hostname.domain.com:2181:/hbase-secure:hbase-hdppoc@POC.HDP.DOMAIN.COM:/etc/security/keytabs/hbase.headless.keytab 16/06/06 17:18:01 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable 16/06/06 17:18:02 WARN impl.MetricsConfig: Cannot locate configuration: tried hadoop-metrics2-phoenix.properties,hadoop-metrics2.properties
Created ‎06-06-2016 11:06 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Make sure that you have hbase-site.xml and core-site.xml ( from hadoop) in the classpath. You may set it by env variables HBASE_CONF_DIR and HADOOP_CONF_DIR.
Since Phoenix client works directly with HBase in the secured environment it needs keytabs for master and region servers. That’s why the hbase-site.xml is required. HBase client itself needs to know that the hadoop cluster is secured, so it needs only hadoop.security.authentication property from core-site.xml
The principal/keytab Phoenix using in the jdbc URL are for the user authentication only.
Created ‎06-06-2016 11:14 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
There may also be some issue communicating with the Master/RegionServers that is causing the client to hang. Check the HBase Master UI and make sure your RS's are online, there are no regions in transition, no "big scary red boxes", etc.
Created ‎06-07-2016 12:52 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have check HBase Master/UI, RS are working. Even I'm able to login to 'hbase shell' and see tables. I'm getting above problem when I'm trying to connect with jdbc:phoenix only.
Created ‎06-06-2016 10:19 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I would say, follow this page
jdbc:phoenix:<Zookeeper_host_name>:<port_number>:<secured_Zookeeper_node>:<principal_name>:<HBase_headless_keytab_file>
try this
!connect jdbc:phoenix:zkhostname.domain.com:2181:/hbase-secure:hbase@HDP.DOMAIN.COM:/etc/security/keytabs/hbase.headless.keytab
you had an extra "phoenix:jdbc" in the command
let me know if it worked.
Created ‎06-06-2016 10:30 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Do I need to enter !connect option in Hbase shell same like beeline Hiveserver2 connection?. If yes, that's not working either in hbase shell or outside
Created ‎06-06-2016 10:35 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
No you donot need !connect in hbase shell.
only
"hbase shell"
Created ‎06-07-2016 12:47 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
When I run !connect jdbc:phoenix:zkhostname.domain.com:2181:/hbase-secure:hbase@HDP.DOMAIN.COM:/etc/security/keytabs/hbase.headless.keytab it's throwing below error.
"-bash: !connect: event not found"
