Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

SQuirreL on phoenix - Sandbox

avatar
Master Guru

I am trying to use SQuirrel on phoenix and it does not connect.

Command line works ./sqlline.py localhost:/hbase-unsecure

I installed the driver in SQuirrel lib directory. I am using driver phoenix-4.4.0.2.3.2.0-2950-client.jar which I pulled from the sandbox /usr/hdp/current/phoenix-client/

I have tried the following url and none work:

jdbc:phoenix:localhost:2181:/hbase-unsecurejdbc:phoenix:localhost:/hbase-unsecurejdbc:phoenix:sandbox.hortonworks.com:2181:/hbase-unsecurejdbc:phoenix:sandbox.hortonworks.com:/hbase-unsecure

2335-2016-02-22-15-23-06.jpg

Here is error:

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)

Detailed dump:

2016-02-22 16:00:38,691 [pool-11-thread-1] WARN  org.apache.hadoop.hbase.zookeeper.RecoverableZooKeeper  - Possibly transient ZooKeeper, quorum=sandbox.hortoworks.com:2181, exception=org.apache.zookeeper.KeeperException$OperationTimeoutException: KeeperErrorCode = OperationTimeout
2016-02-22 16:00:40,692 [pool-11-thread-1] INFO  org.apache.zookeeper.ZooKeeper  - Initiating client connection, connectString=sandbox.hortoworks.com:2181 sessionTimeout=90000 watcher=hconnection-0x7b5238300x0, quorum=sandbox.hortoworks.com:2181, baseZNode=/hbase-unsecure
2016-02-22 16:00:40,692 [pool-11-thread-1] WARN  org.apache.hadoop.hbase.zookeeper.RecoverableZooKeeper  - Unable to create ZooKeeper Connection
java.net.UnknownHostException: sandbox.hortoworks.com
at java.net.InetAddress.getAllByName0(InetAddress.java:1280)
at java.net.InetAddress.getAllByName(InetAddress.java:1192)
at java.net.InetAddress.getAllByName(InetAddress.java:1126)
at org.apache.zookeeper.client.StaticHostProvider.<init>(StaticHostProvider.java:61)
at org.apache.zookeeper.ZooKeeper.<init>(ZooKeeper.java:445)
at org.apache.zookeeper.ZooKeeper.<init>(ZooKeeper.java:380)
at org.apache.hadoop.hbase.zookeeper.RecoverableZooKeeper.checkZk(RecoverableZooKeeper.java:141)
at org.apache.hadoop.hbase.zookeeper.RecoverableZooKeeper.exists(RecoverableZooKeeper.java:221)
at org.apache.hadoop.hbase.zookeeper.ZKUtil.checkExists(ZKUtil.java:541)
at org.apache.hadoop.hbase.client.ConnectionManager$HConnectionImplementation.checkIfBaseNodeAvailable(ConnectionManager.java:895)
at org.apache.hadoop.hbase.client.ConnectionManager$HConnectionImplementation.access$400(ConnectionManager.java:545)
at org.apache.hadoop.hbase.client.ConnectionManager$HConnectionImplementation$StubMaker.makeStubNoRetries(ConnectionManager.java:1483)
at org.apache.hadoop.hbase.client.ConnectionManager$HConnectionImplementation$StubMaker.makeStub(ConnectionManager.java:1524)
at org.apache.hadoop.hbase.client.ConnectionManager$HConnectionImplementation$MasterServiceStubMaker.makeStub(ConnectionManager.java:1553)
at org.apache.hadoop.hbase.client.ConnectionManager$HConnectionImplementation.getKeepAliveMasterService(ConnectionManager.java:1704)
at org.apache.hadoop.hbase.client.MasterCallable.prepare(MasterCallable.java:38)
at org.apache.hadoop.hbase.client.RpcRetryingCaller.callWithRetries(RpcRetryingCaller.java:124)
at org.apache.hadoop.hbase.client.HBaseAdmin.executeCallable(HBaseAdmin.java:3917)
at org.apache.hadoop.hbase.client.HBaseAdmin.getTableDescriptor(HBaseAdmin.java:441)
at org.apache.hadoop.hbase.client.HBaseAdmin.getTableDescriptor(HBaseAdmin.java:463)
at org.apache.phoenix.query.ConnectionQueryServicesImpl.ensureTableCreated(ConnectionQueryServicesImpl.java:815)
at org.apache.phoenix.query.ConnectionQueryServicesImpl.createTable(ConnectionQueryServicesImpl.java:1215)
at org.apache.phoenix.query.DelegateConnectionQueryServices.createTable(DelegateConnectionQueryServices.java:112)
at org.apache.phoenix.schema.MetaDataClient.createTableInternal(MetaDataClient.java:1902)
at org.apache.phoenix.schema.MetaDataClient.createTable(MetaDataClient.java:744)
at org.apache.phoenix.compile.CreateTableCompiler$2.execute(CreateTableCompiler.java:186)
at org.apache.phoenix.jdbc.PhoenixStatement$2.call(PhoenixStatement.java:304)
at org.apache.phoenix.jdbc.PhoenixStatement$2.call(PhoenixStatement.java:296)
at org.apache.phoenix.jdbc.PhoenixStatement.executeMutation(PhoenixStatement.java:294)
at org.apache.phoenix.jdbc.PhoenixStatement.executeUpdate(PhoenixStatement.java:1243)
at org.apache.phoenix.query.ConnectionQueryServicesImpl$12.call(ConnectionQueryServicesImpl.java:1893)
at org.apache.phoenix.query.ConnectionQueryServicesImpl$12.call(ConnectionQueryServicesImpl.java:1862)
at org.apache.phoenix.util.PhoenixContextExecutor.call(PhoenixContextExecutor.java:77)
at org.apache.phoenix.query.ConnectionQueryServicesImpl.init(ConnectionQueryServicesImpl.java:1862)
at org.apache.phoenix.jdbc.PhoenixDriver.getConnectionQueryServices(PhoenixDriver.java:180)
at org.apache.phoenix.jdbc.PhoenixEmbeddedDriver.connect(PhoenixEmbeddedDriver.java:132)
at org.apache.phoenix.jdbc.PhoenixDriver.connect(PhoenixDriver.java:151)
at net.sourceforge.squirrel_sql.fw.sql.SQLDriverManager.getConnection(SQLDriverManager.java:133)
at net.sourceforge.squirrel_sql.client.mainframe.action.OpenConnectionCommand.executeConnect(OpenConnectionCommand.java:167)
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)
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)
1 ACCEPTED SOLUTION

avatar
Master Guru

I got it working. Here is how I fixed it.

Changed from using dns name ie sandbox.hortonworks.com to phyical IP of my vm. and I use :/hbase-unsecure as znode

screen shot of my connection to help others using squirrel on sandbox (i removed my IP):

2379-2016-02-24-15-57-30.jpg

View solution in original post

10 REPLIES 10

avatar
Contributor

Download both phoenix and hbase client into Squirrel lib and try.

avatar
Super Guru

It looks like SQuirreL is trying to instantiate the Phoenix JDBC driver, but I'm not sure with the information you provided why it's hanging. Is it possible to increase the log level of SQuirreL to see if there is some useful messages coming out of the HBase/Phoenix libraries?

avatar
Guru

It seems to be failing due to this:

java.net.UnknownHostException: sandbox.hortoworks.com

You can make sure that the hostname resolution is correct.

avatar
Master Guru

Here is the latest log:

2016-02-22 18:44:38,414 [pool-1-thread-1] INFO org.apache.zookeeper.ZooKeeper - Initiating client connection, connectString=sandbox.hortonworks.com:2181 sessionTimeout=90000 watcher=hconnection-0x287a29a40x0, quorum=sandbox.hortonworks.com:2181, baseZNode=/hbase-unsecure 2016-02-22 18:44:38,443 [pool-1-thread-1-SendThread(sandbox.hortonworks.com:2181)] INFO org.apache.zookeeper.ClientCnxn - Opening socket connection to server sandbox.hortonworks.com/172.16.248.128:2181. Will not attempt to authenticate using SASL (unknown error) 2016-02-22 18:44:38,469 [pool-1-thread-1-SendThread(sandbox.hortonworks.com:2181)] INFO org.apache.zookeeper.ClientCnxn - Socket connection established to sandbox.hortonworks.com/172.16.248.128:2181, initiating session 2016-02-22 18:44:38,476 [pool-1-thread-1-SendThread(sandbox.hortonworks.com:2181)] INFO org.apache.zookeeper.ClientCnxn - Session establishment complete on server sandbox.hortonworks.com/172.16.248.128:2181, sessionid = 0x152a41a235f02b0, negotiated timeout = 40000 2016-02-22 18:44:38,592 [pool-1-thread-1] INFO org.apache.phoenix.metrics.Metrics - Initializing metrics system: phoenix 2016-02-22 18:44:38,613 [pool-1-thread-1] WARN org.apache.hadoop.metrics2.impl.MetricsConfig - Cannot locate configuration: tried hadoop-metrics2-phoenix.properties,hadoop-metrics2.properties 2016-02-22 18:44:38,663 [pool-1-thread-1] INFO org.apache.hadoop.metrics2.impl.MetricsSystemImpl - Scheduled snapshot period at 10 second(s). 2016-02-22 18:44:38,664 [pool-1-thread-1] INFO org.apache.hadoop.metrics2.impl.MetricsSystemImpl - phoenix metrics system started 2016-02-22 18:44:39,008 [pool-1-thread-1] INFO org.apache.hadoop.hbase.zookeeper.RecoverableZooKeeper - Process identifier=hconnection-0x712b0900 connecting to ZooKeeper ensemble=sandbox.hortonworks.com:2181 2016-02-22 18:44:39,008 [pool-1-thread-1] INFO org.apache.zookeeper.ZooKeeper - Initiating client connection, connectString=sandbox.hortonworks.com:2181 sessionTimeout=90000 watcher=hconnection-0x712b09000x0, quorum=sandbox.hortonworks.com:2181, baseZNode=/hbase-unsecure 2016-02-22 18:44:39,009 [pool-1-thread-1-SendThread(sandbox.hortonworks.com:2181)] INFO org.apache.zookeeper.ClientCnxn - Opening socket connection to server sandbox.hortonworks.com/172.16.248.128:2181. Will not attempt to authenticate using SASL (unknown error) 2016-02-22 18:44:39,009 [pool-1-thread-1-SendThread(sandbox.hortonworks.com:2181)] INFO org.apache.zookeeper.ClientCnxn - Socket connection established to sandbox.hortonworks.com/172.16.248.128:2181, initiating session 2016-02-22 18:44:39,014 [pool-1-thread-1-SendThread(sandbox.hortonworks.com:2181)] INFO org.apache.zookeeper.ClientCnxn - Session establishment complete on server sandbox.hortonworks.com/172.16.248.128:2181, sessionid = 0x152a41a235f02b1, negotiated timeout = 40000 2016-02-22 18:45:07,545 [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) 2016-02-22 18:45:27,345 [pool-1-thread-1] INFO org.apache.hadoop.hbase.client.RpcRetryingCaller - Call exception, tries=10, retries=35, started=48328 ms ago, cancelled=false, msg= 2016-02-22 18:45:47,490 [pool-1-thread-1] INFO org.apache.hadoop.hbase.client.RpcRetryingCaller - Call exception, tries=11, retries=35, started=68473 ms ago, cancelled=false, msg= 2016-02-22 18:46:07,680 [pool-1-thread-1] INFO org.apache.hadoop.hbase.client.RpcRetryingCaller - Call exception, tries=12, retries=35, started=88663 ms ago, cancelled=false, msg= 2016-02-22 18:46:27,853 [pool-1-thread-1] INFO org.apache.hadoop.hbase.client.RpcRetryingCaller - Call exception, tries=13, retries=35, started=108836 ms ago, cancelled=false, msg=

avatar
Super Collaborator

I have spent a few days back then to get this to work.

What you need is :

jdbc:phoenix:sandbox.hortonworks.com:2181:/hbase-unsecure

no username / password needed.

And in your host file you need (I presume you run squirrel on windows) :

127.0.0.1 sandbox.hortonworks.com

avatar
Master Guru

I am not getting any further hits on this. Maybe I will close and ask community if they have squirrel working and to provide exact steps.

avatar
Master Mentor

avatar
Master Guru

I got it working. Here is how I fixed it.

Changed from using dns name ie sandbox.hortonworks.com to phyical IP of my vm. and I use :/hbase-unsecure as znode

screen shot of my connection to help others using squirrel on sandbox (i removed my IP):

2379-2016-02-24-15-57-30.jpg

avatar
Contributor

If you are using the Sandbox with Virtual Box, you need to open several additional ports.

You need all the HBase and Region Server ports forwarded, 16000, 16010, 16020, 16030. I think I had to add Zookeeper's port too; 2181. To do this, click on the Settings button for the VM instance you are working with (HDP 2.3.x or HDP 2.4). Then click the Network button in the pop up window. There is a port forwarding button at the bottom, click it. Click to add each of the following ports that you don't currently have. Follow the pattern you see. Here is an example:

4331-hortonworks-sandbox-with-hdp-2-4-network-and-oracl.jpg

I hope this helps.

Eric