Discussion:
Drill JDBC connection on windows in embedded node
Add Reply
Divya Gehlot
2017-08-07 02:37:12 UTC
Reply
Permalink
Raw Message
Hi,
I followed the this link
<https://drill.apache.org/docs/using-jdbc-with-squirrel-on-windows/> to
connect to drill in JDBC mode .

*Have installed drill 1.11 on windows 10 in embedded mode .*

Configurations which I used :

*JDBC Driver* :
apache-drill-1.11.0.tar\apache-drill-1.11.0\jars\jdbc-driver\drill-jdbc-all-1.11.0.jar

JDBC URL options which I tried :

*Option1 :* jdbc:drill:zk=localhost:2181/drill/drillbits1
*Option 2* : jdbc:drill:zk=localhost:2181
*Option 3 *: jdbc:drill:zk=<hostname>:2181

I am getting below error with all the the options

*ERROR* :
Unexpected Error occurred attempting to open an SQL connection.
class java.io.IOException: Failure to connect to the zookeeper cluster
service within the allotted time of 10000 milliseconds

Appreciate the help .


Thanks ,
Divya
Andries Engelbrecht
2017-08-07 15:16:49 UTC
Reply
Permalink
Raw Message
Try jdbc:drill:drillbit=localhost

Since embedded mode doesn’t use ZK you need to connect directly to the drillbit itself.

--Andries

On 8/6/17, 7:37 PM, "Divya Gehlot" <***@gmail.com> wrote:

Hi,
I followed the this link
<https://drill.apache.org/docs/using-jdbc-with-squirrel-on-windows/> to
connect to drill in JDBC mode .

*Have installed drill 1.11 on windows 10 in embedded mode .*

Configurations which I used :

*JDBC Driver* :
apache-drill-1.11.0.tar\apache-drill-1.11.0\jars\jdbc-driver\drill-jdbc-all-1.11.0.jar

JDBC URL options which I tried :

*Option1 :* jdbc:drill:zk=localhost:2181/drill/drillbits1
*Option 2* : jdbc:drill:zk=localhost:2181
*Option 3 *: jdbc:drill:zk=<hostname>:2181

I am getting below error with all the the options

*ERROR* :
Unexpected Error occurred attempting to open an SQL connection.
class java.io.IOException: Failure to connect to the zookeeper cluster
service within the allotted time of 10000 milliseconds

Appreciate the help .
Kunal Khatua
2017-08-07 18:26:12 UTC
Reply
Permalink
Raw Message
+1 to Andries' comment.

When you start Drill in Embedded mode, you are bringing up a single standalone Drillbit without any Zookeeper that would otherwise allow discovery of other Drillbits in the cluster.

Starting in embedded mode is done via SQLLine because in a practical usage, a single Drillbit doesn't accomplish much, beyond just trying out things (Drill or data exploration).
Once you have that running, then if a JDBC client needs to connect to that, you need to tell your JDBC client where to connect. In this case, since there is no Zookeeper (that, typically, listens on port 2181) that has knowledge about your Drillbit running in embedded-mode, we need to explicitly tell it to connect to the Drillbit server.

Hence, your JDBC URL needs to be
" jdbc:drill:drillbit=<IP-of-your-Drillbit-Server>"

Hope that helps

-----Original Message-----
From: Andries Engelbrecht [mailto:***@mapr.com]
Sent: Monday, August 07, 2017 8:17 AM
To: ***@drill.apache.org
Subject: Re: Drill JDBC connection on windows in embedded node

Try jdbc:drill:drillbit=localhost

Since embedded mode doesn’t use ZK you need to connect directly to the drillbit itself.

--Andries

On 8/6/17, 7:37 PM, "Divya Gehlot" <***@gmail.com> wrote:

Hi,
I followed the this link
<https://drill.apache.org/docs/using-jdbc-with-squirrel-on-windows/> to
connect to drill in JDBC mode .

*Have installed drill 1.11 on windows 10 in embedded mode .*

Configurations which I used :

*JDBC Driver* :
apache-drill-1.11.0.tar\apache-drill-1.11.0\jars\jdbc-driver\drill-jdbc-all-1.11.0.jar

JDBC URL options which I tried :

*Option1 :* jdbc:drill:zk=localhost:2181/drill/drillbits1
*Option 2* : jdbc:drill:zk=localhost:2181
*Option 3 *: jdbc:drill:zk=<hostname>:2181

I am getting below error with all the the options

*ERROR* :
Unexpected Error occurred attempting to open an SQL connection.
class java.io.IOException: Failure to connect to the zookeeper cluster
service within the allotted time of 10000 milliseconds

Appreciate the help .


Thanks ,
Divya Gehlot
2017-08-08 01:44:18 UTC
Reply
Permalink
Raw Message
Thanks a lot Kunal and Andries.
It worked :)
Post by Kunal Khatua
+1 to Andries' comment.
When you start Drill in Embedded mode, you are bringing up a single
standalone Drillbit without any Zookeeper that would otherwise allow
discovery of other Drillbits in the cluster.
Starting in embedded mode is done via SQLLine because in a practical
usage, a single Drillbit doesn't accomplish much, beyond just trying out
things (Drill or data exploration).
Once you have that running, then if a JDBC client needs to connect to
that, you need to tell your JDBC client where to connect. In this case,
since there is no Zookeeper (that, typically, listens on port 2181) that
has knowledge about your Drillbit running in embedded-mode, we need to
explicitly tell it to connect to the Drillbit server.
Hence, your JDBC URL needs to be
" jdbc:drill:drillbit=<IP-of-your-Drillbit-Server>"
Hope that helps
-----Original Message-----
Sent: Monday, August 07, 2017 8:17 AM
Subject: Re: Drill JDBC connection on windows in embedded node
Try jdbc:drill:drillbit=localhost
Since embedded mode doesn’t use ZK you need to connect directly to the
drillbit itself.
--Andries
Hi,
I followed the this link
<https://drill.apache.org/docs/using-jdbc-with-squirrel-on-windows/> to
connect to drill in JDBC mode .
*Have installed drill 1.11 on windows 10 in embedded mode .*
apache-drill-1.11.0.tar\apache-drill-1.11.0\jars\jdbc-
driver\drill-jdbc-all-1.11.0.jar
*Option1 :* jdbc:drill:zk=localhost:2181/drill/drillbits1
*Option 2* : jdbc:drill:zk=localhost:2181
*Option 3 *: jdbc:drill:zk=<hostname>:2181
I am getting below error with all the the options
Unexpected Error occurred attempting to open an SQL connection.
class java.io.IOException: Failure to connect to the zookeeper cluster
service within the allotted time of 10000 milliseconds
Appreciate the help .
Thanks ,
Divya
Loading...