Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

Accessing phoenix on kerberized cluster from squirrel

Accessing phoenix on kerberized cluster from squirrel

Rising Star

I'm trying to reach phoenix on my kerberized cluster from squirrel running on a edge server.

I followed instructions from https://phoenix.apache.org/installation.html, but couln't figure out what to set as URL connection, username and password :

Let's say my zookeeper quorum is "server1,server2,server3"

Then I tried out following URL : "jdbc:phoenix:server1,server2,server3"

I set my username & password (the ones I use for kinit on the edge server)

...And I got following exception :

java.util.concurrent.TimeoutException
    at java.util.concurrent.FutureTask.get(FutureTask.java:205)
    at net.sourceforge.squirrel_sql.client.mainframe.action.OpenConnectionCommand.awaitConnection(OpenConnectionCommand.java:132)
    at net.sourceforge.squirrel_sql.client.mainframe.action.OpenConnectionCommand.access$100(OpenConnectionCommand.java:45)
    at net.sourceforge.squirrel_sql.client.mainframe.action.OpenConnectionCommand$2.run(OpenConnectionCommand.java:115)

Based on https://community.hortonworks.com/questions/18737/squirrel-on-phoenix-sandbox.html I also tried :

jdbc:phoenix:server1,server2,server3:2181:/hbase-unsecure

but got the same error...

So my questions are :

Should I set the 3 servers of the zookeeper quorum or something else ?

Should I add the zookeeper port and "/hbase-unsecure" to the URL or not ?

Should I specify a user & password or let these fields empty ?

Thanks for your help

6 REPLIES 6

Re: Accessing phoenix on kerberized cluster from squirrel

Expert Contributor

since it is already kerberized, then you need to include principle in your jdbc url, also it will create /hbase-secure entry in zookeeper by default.

the url should look like:

jdbc:phoenix:server1,server2,server3:2181:/hbase-secure:/keytabs/myuser.headless.keytab:somebody@HDP.LOCAL

Re: Accessing phoenix on kerberized cluster from squirrel

Rising Star

Thank you Frank,

I gave a try to your suggestion, keeping both "user" and "password" fields empty in squirrel popup :

14882-squirrel.png

Complete URL : jdbc:phoenix:fr0-datalab-p21.bdata.corp,fr0-datalab-p22.bdata.corp,fr0-datalab-p23.bdata.corp:2181:/hbase-secure:/path_to_my_keytab.keytab:my_user@MY_DOMAIN

...But finally faced the exact same error.

Below is the content of squirrel logs :

2017-04-26 15:01:01,661 [pool-11-thread-1] INFO org.apache.hadoop.conf.Configuration.deprecation - io.bytes.per.checksum is deprecated. Instead, use dfs.bytes-per-checksum 2017-04-26 15:01:01,676 [pool-11-thread-1] INFO org.apache.hadoop.conf.Configuration.deprecation - io.bytes.per.checksum is deprecated. Instead, use dfs.bytes-per-checksum 2017-04-26 15:01:01,678 [pool-11-thread-1] INFO org.apache.phoenix.query.ConnectionQueryServicesImpl - Trying to connect to a secure cluster with keytab:my_user@MY_DOMAIN 2017-04-26 15:01:01,678 [pool-11-thread-1] INFO org.apache.phoenix.query.ConnectionQueryServicesImpl - Successfull login to secure cluster!! 2017-04-26 15:01:01,679 [pool-11-thread-1] INFO org.apache.hadoop.hbase.zookeeper.RecoverableZooKeeper - Process identifier=hconnection-0x1fafa303 connecting to ZooKeeper ensemble=fr0-datalab-p21.bdata.corp:2181,fr0-datalab-p22.bdata.corp:2181,fr0-datalab-p23.bdata.corp:2181 2017-04-26 15:01:01,679 [pool-11-thread-1] INFO org.apache.zookeeper.ZooKeeper - Initiating client connection, connectString=fr0-datalab-p21.bdata.corp:2181,fr0-datalab-p22.bdata.corp:2181,fr0-datalab-p23.bdata.corp:2181 sessionTimeout=90000 watcher=hconnection-0x1fafa3030x0, quorum=fr0-datalab-p21.bdata.corp:2181,fr0-datalab-p22.bdata.corp:2181,fr0-datalab-p23.bdata.corp:2181, baseZNode=/hbase-secure 2017-04-26 15:01:01,680 [pool-11-thread-1-SendThread(fr0-datalab-p23.bdata.corp:2181)] INFO org.apache.zookeeper.ClientCnxn - Opening socket connection to server fr0-datalab-p23.bdata.corp/10.123.48.145:2181. Will not attempt to authenticate using SASL (unknown error) 2017-04-26 15:01:01,681 [pool-11-thread-1-SendThread(fr0-datalab-p23.bdata.corp:2181)] INFO org.apache.zookeeper.ClientCnxn - Socket connection established to fr0-datalab-p23.bdata.corp/10.123.48.145:2181, initiating session 2017-04-26 15:01:01,683 [pool-11-thread-1-SendThread(fr0-datalab-p23.bdata.corp:2181)] INFO org.apache.zookeeper.ClientCnxn - Session establishment complete on server fr0-datalab-p23.bdata.corp/10.123.48.145:2181, sessionid = 0x35ba95c65800727, negotiated timeout = 40000 2017-04-26 15:01:01,698 [pool-11-thread-1] INFO org.apache.hadoop.hbase.zookeeper.RecoverableZooKeeper - Process identifier=hconnection-0x108c2310 connecting to ZooKeeper ensemble=fr0-datalab-p21.bdata.corp:2181,fr0-datalab-p22.bdata.corp:2181,fr0-datalab-p23.bdata.corp:2181 2017-04-26 15:01:01,699 [pool-11-thread-1] INFO org.apache.zookeeper.ZooKeeper - Initiating client connection, connectString=fr0-datalab-p21.bdata.corp:2181,fr0-datalab-p22.bdata.corp:2181,fr0-datalab-p23.bdata.corp:2181 sessionTimeout=90000 watcher=hconnection-0x108c23100x0, quorum=fr0-datalab-p21.bdata.corp:2181,fr0-datalab-p22.bdata.corp:2181,fr0-datalab-p23.bdata.corp:2181, baseZNode=/hbase-secure 2017-04-26 15:01:01,700 [pool-11-thread-1-SendThread(fr0-datalab-p22.bdata.corp:2181)] INFO org.apache.zookeeper.ClientCnxn - Opening socket connection to server fr0-datalab-p22.bdata.corp/10.123.48.143:2181. Will not attempt to authenticate using SASL (unknown error) 2017-04-26 15:01:01,701 [pool-11-thread-1-SendThread(fr0-datalab-p22.bdata.corp:2181)] INFO org.apache.zookeeper.ClientCnxn - Socket connection established to fr0-datalab-p22.bdata.corp/10.123.48.143:2181, initiating session 2017-04-26 15:01:01,702 [pool-11-thread-1-SendThread(fr0-datalab-p22.bdata.corp:2181)] INFO org.apache.zookeeper.ClientCnxn - Session establishment complete on server fr0-datalab-p22.bdata.corp/10.123.48.143:2181, sessionid = 0x25ba95c5df807ce, negotiated timeout = 40000 2017-04-26 15:01:31,646 [AWT-EventQueue-1] ERROR net.sourceforge.squirrel_sql.client.gui.db.ConnectToAliasCallBack - Unexpected Error occurred attempting to open an SQL connection. java.util.concurrent.TimeoutException at java.util.concurrent.FutureTask.get(FutureTask.java:205) at net.sourceforge.squirrel_sql.client.mainframe.action.OpenConnectionCommand.awaitConnection(OpenConnectionCommand.java:132) at net.sourceforge.squirrel_sql.client.mainframe.action.OpenConnectionCommand.access$100(OpenConnectionCommand.java:45) at net.sourceforge.squirrel_sql.client.mainframe.action.OpenConnectionCommand$2.run(OpenConnectionCommand.java:115) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745)

Any idea about how to debug this problem ?

Re: Accessing phoenix on kerberized cluster from squirrel

Rising Star

Update : I also gave a try with following connection string without success :

jdbc:phoenix:fr0-datalab-p21.bdata.corp,fr0-datalab-p22.bdata.corp,fr0-datalab-p23.bdata.corp:2181:/hbase-secure:my_user@MY_DOMAIN:/path_to_my_keytab.keytab

Is there some particular configuration files (core-site.xml, hbase-site.xml...) that should be added to squirrel classpath ?

Re: Accessing phoenix on kerberized cluster from squirrel

Expert Contributor

you may try to use the same string to connect through sqlline:

cd /usr/hdp/current/phoenix-client/bin/

./psql.py jdbc:phoenix:fr0-datalab-p21.bdata.corp,fr0-datalab-p22.bdata.corp,fr0-datalab-p23.bdata.corp:2181:/hbase-secure:my_user@MY_DOMAIN:/path_to_my_keytab.keytab /usr/hdp/current/phoenix-client/doc/examples/WEB_STAT.sql /usr/hdp/current/phoenix-client/doc/examples/WEB_STAT.csv /usr/hdp/current/phoenix-client/doc/examples/WEB_STAT_QUERIES.sql

If it still has issue, then you can check the phoenix log to see the problem. If it is passed, then the issue is with squirrel setting.

Re: Accessing phoenix on kerberized cluster from squirrel

Rising Star

Thank you for your help,

I managed to make psql.py script working with following command line :

./psql.py fr0-datalab-p21.bdata.corp,fr0-datalab-p22.bdata.corp,fr0-datalab-p23.bdata.corp:2181:/hbase-secure:my_user@MY_DOMAIN:/path_to_my_keytab.keytab /usr/hdp/current/phoenix-client/doc/examples/WEB_STAT.sql /usr/hdp/current/phoenix-client/doc/examples/WEB_STAT.csv /usr/hdp/current/phoenix-client/doc/examples/WEB_STAT_QUERIES.sql

=> I had to remove "jdbc:phoenix:" from my connection string...

However, If I do the same with squirrel connection string, I immediatly face following exception :

2017-04-28 16:41:04,429 [AWT-EventQueue-1] ERROR 
net.sourceforge.squirrel_sql.client.gui.db.ConnectToAliasCallBack  - 
Unexpected Error occurred attempting to open an SQL connection.
java.util.concurrent.ExecutionException:
 java.lang.RuntimeException: java.sql.SQLException: Unable to create 
connection. Check your URL.
   at java.util.concurrent.FutureTask.report(FutureTask.java:122)
   at java.util.concurrent.FutureTask.get(FutureTask.java:206)
   at net.sourceforge.squirrel_sql.client.mainframe.action.OpenConnectionCommand.awaitConnection(OpenConnectionCommand.java:132)
   at net.sourceforge.squirrel_sql.client.mainframe.action.OpenConnectionCommand.access$100(OpenConnectionCommand.java:45)
   at net.sourceforge.squirrel_sql.client.mainframe.action.OpenConnectionCommand$2.run(OpenConnectionCommand.java:115)
   at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
   at java.util.concurrent.FutureTask.run(FutureTask.java:266)
   at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
   at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
   at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.RuntimeException: java.sql.SQLException: Unable to create connection. Check your URL.
   at net.sourceforge.squirrel_sql.client.mainframe.action.OpenConnectionCommand.executeConnect(OpenConnectionCommand.java:171)
   at net.sourceforge.squirrel_sql.client.mainframe.action.OpenConnectionCommand.access$000(OpenConnectionCommand.java:45)
   at net.sourceforge.squirrel_sql.client.mainframe.action.OpenConnectionCommand$1.run(OpenConnectionCommand.java:104)
   ... 5 more
Caused by: java.sql.SQLException: Unable to create connection. Check your URL.
   at net.sourceforge.squirrel_sql.fw.sql.SQLDriverManager.getConnection(SQLDriverManager.java:136)
   at net.sourceforge.squirrel_sql.client.mainframe.action.OpenConnectionCommand.executeConnect(OpenConnectionCommand.java:167)
   ... 7 more

And if I put back "jdbc:phoenix:" as trailing part of my connection string, I face following exception in squirrel logs :

2017-04-28 16:29:25,488 [pool-5-thread-1] INFO  org.apache.phoenix.query.ConnectionQueryServicesImpl  - Trying to connect to a secure cluster with keytab:/path_to_my_keytab.keytab
2017-04-28 16:29:25,490 [pool-5-thread-1] INFO  org.apache.phoenix.query.ConnectionQueryServicesImpl  - Successfull login to secure cluster!!
2017-04-28 16:29:25,492 [pool-5-thread-1] INFO  org.apache.hadoop.hbase.zookeeper.RecoverableZooKeeper  - Process identifier=hconnection-0x6e039bcc connecting to ZooKeeper ensemble=fr0-datalab-p21.bdata.corp:2181,fr0-datalab-p22.bdata.corp:2181,fr0-datalab-p23.bdata.corp:2181
2017-04-28 16:29:25,492 [pool-5-thread-1] INFO  org.apache.zookeeper.ZooKeeper  - Initiating client connection, connectString=fr0-datalab-p21.bdata.corp:2181,fr0-datalab-p22.bdata.corp:2181,fr0-datalab-p23.bdata.corp:2181 sessionTimeout=90000 watcher=hconnection-0x6e039bcc0x0, quorum=fr0-datalab-p21.bdata.corp:2181,fr0-datalab-p22.bdata.corp:2181,fr0-datalab-p23.bdata.corp:2181, baseZNode=/hbase-secure
2017-04-28 16:29:25,498 [pool-5-thread-1-SendThread(fr0-datalab-p23.bdata.corp:2181)] INFO  org.apache.zookeeper.ClientCnxn  - Opening socket connection to server fr0-datalab-p23.bdata.corp/10.123.48.145:2181. Will not attempt to authenticate using SASL (unknown error)
2017-04-28 16:29:25,498 [pool-5-thread-1-SendThread(fr0-datalab-p23.bdata.corp:2181)] INFO  org.apache.zookeeper.ClientCnxn  - Socket connection established to fr0-datalab-p23.bdata.corp/10.123.48.145:2181, initiating session
2017-04-28 16:29:25,501 [pool-5-thread-1-SendThread(fr0-datalab-p23.bdata.corp:2181)] INFO  org.apache.zookeeper.ClientCnxn  - Session establishment complete on server fr0-datalab-p23.bdata.corp/10.123.48.145:2181, sessionid = 0x35ba95c65801de1, negotiated timeout = 40000
2017-04-28 16:29:25,554 [pool-5-thread-1] INFO  org.apache.hadoop.hbase.zookeeper.RecoverableZooKeeper  - Process identifier=hconnection-0x2700983 connecting to ZooKeeper ensemble=fr0-datalab-p21.bdata.corp:2181,fr0-datalab-p22.bdata.corp:2181,fr0-datalab-p23.bdata.corp:2181
2017-04-28 16:29:25,554 [pool-5-thread-1] INFO  org.apache.zookeeper.ZooKeeper  - Initiating client connection, connectString=fr0-datalab-p21.bdata.corp:2181,fr0-datalab-p22.bdata.corp:2181,fr0-datalab-p23.bdata.corp:2181 sessionTimeout=90000 watcher=hconnection-0x27009830x0, quorum=fr0-datalab-p21.bdata.corp:2181,fr0-datalab-p22.bdata.corp:2181,fr0-datalab-p23.bdata.corp:2181, baseZNode=/hbase-secure
2017-04-28 16:29:25,556 [pool-5-thread-1-SendThread(fr0-datalab-p23.bdata.corp:2181)] INFO  org.apache.zookeeper.ClientCnxn  - Opening socket connection to server fr0-datalab-p23.bdata.corp/10.123.48.145:2181. Will not attempt to authenticate using SASL (unknown error)
2017-04-28 16:29:25,557 [pool-5-thread-1-SendThread(fr0-datalab-p23.bdata.corp:2181)] INFO  org.apache.zookeeper.ClientCnxn  - Socket connection established to fr0-datalab-p23.bdata.corp/10.123.48.145:2181, initiating session
2017-04-28 16:29:25,559 [pool-5-thread-1-SendThread(fr0-datalab-p23.bdata.corp:2181)] INFO  org.apache.zookeeper.ClientCnxn  - Session establishment complete on server fr0-datalab-p23.bdata.corp/10.123.48.145:2181, sessionid = 0x35ba95c65801de2, negotiated timeout = 40000
2017-04-28 16:29:55,377 [AWT-EventQueue-1] ERROR net.sourceforge.squirrel_sql.client.gui.db.ConnectToAliasCallBack  - Unexpected Error occurred attempting to open an SQL connection.
java.util.concurrent.TimeoutException
    at java.util.concurrent.FutureTask.get(FutureTask.java:205)
    at net.sourceforge.squirrel_sql.client.mainframe.action.OpenConnectionCommand.awaitConnection(OpenConnectionCommand.java:132)
    at net.sourceforge.squirrel_sql.client.mainframe.action.OpenConnectionCommand.access$100(OpenConnectionCommand.java:45)
    at net.sourceforge.squirrel_sql.client.mainframe.action.OpenConnectionCommand$2.run(OpenConnectionCommand.java:115)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)
2017-04-28 16:30:14,001 [pool-5-thread-1] INFO  org.apache.hadoop.hbase.client.RpcRetryingCaller  - Call exception, tries=10, retries=35, started=48439 ms ago, cancelled=false, msg=
2017-04-28 16:30:34,088 [pool-5-thread-1] INFO  org.apache.hadoop.hbase.client.RpcRetryingCaller  - Call exception, tries=11, retries=35, started=68526 ms ago, cancelled=false, msg=
2017-04-28 16:30:54,275 [pool-5-thread-1] INFO  org.apache.hadoop.hbase.client.RpcRetryingCaller  - Call exception, tries=12, retries=35, started=88713 ms ago, cancelled=false, msg=
2017-04-28 16:31:14,473 [pool-5-thread-1] INFO  org.apache.hadoop.hbase.client.RpcRetryingCaller  - Call exception, tries=13, retries=35, started=108911 ms ago, cancelled=false, msg=
2017-04-28 16:31:54,731 [pool-5-thread-1] INFO  org.apache.hadoop.hbase.client.RpcRetryingCaller  - Call exception, tries=15, retries=35, started=149169 ms ago, cancelled=false, msg=
2017-04-28 16:32:14,836 [pool-5-thread-1] INFO  org.apache.hadoop.hbase.client.RpcRetryingCaller  - Call exception, tries=16, retries=35, started=169274 ms ago, cancelled=false, msg=
2017-04-28 16:32:34,944 [pool-5-thread-1] INFO  org.apache.hadoop.hbase.client.RpcRetryingCaller  - Call exception, tries=17, retries=35, started=189382 ms ago, cancelled=false, msg=
2017-04-28 16:32:55,100 [pool-5-thread-1] INFO  org.apache.hadoop.hbase.client.RpcRetryingCaller  - Call exception, tries=18, retries=35, started=209538 ms ago, cancelled=false, msg=
2017-04-28 16:33:15,208 [pool-5-thread-1] INFO  org.apache.hadoop.hbase.client.RpcRetryingCaller  - Call exception, tries=19, retries=35, started=229646 ms ago, cancelled=false, msg=
2017-04-28 16:33:35,289 [pool-5-thread-1] INFO  org.apache.hadoop.hbase.client.RpcRetryingCaller  - Call exception, tries=20, retries=35, started=249727 ms ago, cancelled=false, msg=
2017-04-28 16:33:55,370 [pool-5-thread-1] INFO  org.apache.hadoop.hbase.client.RpcRetryingCaller  - Call exception, tries=21, retries=35, started=269808 ms ago, cancelled=false, msg=
2017-04-28 16:34:15,413 [pool-5-thread-1] INFO  org.apache.hadoop.hbase.client.RpcRetryingCaller  - Call exception, tries=22, retries=35, started=289851 ms ago, cancelled=false, msg=
2017-04-28 16:34:35,499 [pool-5-thread-1] INFO  org.apache.hadoop.hbase.client.RpcRetryingCaller  - Call exception, tries=23, retries=35, started=309937 ms ago, cancelled=false, msg=
2017-04-28 16:34:55,662 [pool-5-thread-1] INFO  org.apache.hadoop.hbase.client.RpcRetryingCaller  - Call exception, tries=24, retries=35, started=330100 ms ago, cancelled=false, msg=
2017-04-28 16:35:15,708 [pool-5-thread-1] INFO  org.apache.hadoop.hbase.client.RpcRetryingCaller  - Call exception, tries=25, retries=35, started=350146 ms ago, cancelled=false, msg=
2017-04-28 16:35:35,783 [pool-5-thread-1] INFO  org.apache.hadoop.hbase.client.RpcRetryingCaller  - Call exception, tries=26, retries=35, started=370221 ms ago, cancelled=false, msg=
2017-04-28 16:35:55,885 [pool-5-thread-1] INFO  org.apache.hadoop.hbase.client.RpcRetryingCaller  - Call exception, tries=27, retries=35, started=390323 ms ago, cancelled=false, msg=

And you will note that connection to the cluster is successfull ...

I also tried to copy hbase-site.xml and core-site.xml to my squirrel bin folder, but it didn't change anything.

After struggling couple of hours on this point, I wonder if this is simply feasible ... no idea where to look for additional logs or clues...Little bit frustrating.

Re: Accessing phoenix on kerberized cluster from squirrel

Rising Star