You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@drill.apache.org by Tushar Pathare <tp...@sidra.org> on 2019/01/09 07:10:24 UTC

Drill connection using jdbc

Hello Team,
                    We have installed drill 1.12.0 and trying to connect using a client to the drill cluster
Our config for connection is

Drill class is : org.apache.drill.jdbc.Driver
Driver location is /Users/tpathare/Downloads/apache-drill-1.12.0/jars/jdbc-driver/drill-jdbc-all-1.12.0.jar
Jdbc url is : jdbc:drill:zk=172.32.63.64:2181,172.32.63.65:2181,172.32.63.67:2181

When I hit connect I see the following error.Though the cluster is up and running and ZK is also good.

ERROR: An error occurred while trying to make a connection to
the database:

JDBC URL:
jdbc:drill:zk=172.32.63.64:2181,172.32.63.65:2181,172.32.63.67:2181/sidra-drillbit

Failure in connecting to Drill:
oadd.org.apache.drill.exec.rpc.RpcException: Failure setting up
ZK for client.



[cid:image001.png@01D3B9E9.23323D90]

Tushar Bhalchandra Pathare
Bigdata,GPFS,CSXF – Research Department
t. +974 4003 7443
m. +974 74793547
PO BOX 26999 Doha, Qatar
sidra.org<http://www.sidra.org/>


Disclaimer: This email and its attachments may be confidential and are intended solely for the use of the individual to whom it is addressed. If you are not the intended recipient, any reading, printing, storage, disclosure, copying or any other action taken in respect of this e-mail is prohibited and may be unlawful. If you are not the intended recipient, please notify the sender immediately by using the reply function and then permanently delete what you have received. Any views or opinions expressed are solely those of the author and do not necessarily represent those of Sidra Medical and Research Center.

Re: Drill connection using jdbc

Posted by Tushar Pathare <tp...@sidra.org>.
Hello Team,
                     Please find the log data.

Thanks

Tushar Bhalchandra Pathare
Bigdata,GPFS,CSXF – Research Department
t. +974 4003 7443
m. +974 74793547
PO BOX 26999 Doha, Qatar
sidra.org <http://www.sidra.org/>


On 1/9/19, 10:24 AM, "Kunal Khatua" <ku...@apache.org> wrote:

    There must be a stack trace in the logs.could you share that?

    On Tue, Jan 8, 2019, 11:10 PM Tushar Pathare <tpathare@sidra.org wrote:

    > Hello Team,
    >
    >                     We have installed drill 1.12.0 and trying to connect
    > using a client to the drill cluster
    >
    > Our config for connection is
    >
    >
    >
    > Drill class is : org.apache.drill.jdbc.Driver
    >
    > Driver location is
    > /Users/tpathare/Downloads/apache-drill-1.12.0/jars/jdbc-driver/drill-jdbc-all-1.12.0.jar
    >
    > Jdbc url is : jdbc:drill:zk=172.32.63.64:2181,172.32.63.65:2181,
    > 172.32.63.67:2181
    >
    >
    >
    > When I hit connect I see the following error.Though the cluster is up and
    > running and ZK is also good.
    >
    >
    >
    > *ERROR: An error occurred while trying to make a connection to *
    >
    > *the database:  *
    >
    >
    >
    > *JDBC URL: *
    >
    > *jdbc:drill:zk=172.32.63.64:2181
    > <http://172.32.63.64:2181>,172.32.63.65:2181
    > <http://172.32.63.65:2181>,172.32.63.67:2181/sidra-drillbit
    > <http://172.32.63.67:2181/sidra-drillbit> *
    >
    >
    >
    > *Failure in connecting to Drill: *
    >
    > *oadd.org.apache.drill.exec.rpc.RpcException: Failure setting up *
    >
    > *ZK for client.*
    >
    >
    >
    >
    >
    >
    >
    > [image: cid:image001.png@01D3B9E9.23323D90]
    >
    > *Tushar Bhalchandra Pathare*
    >
    > Bigdata,GPFS,CSXF – Research Department
    >
    > *t. *+974 4003 7443
    >
    > *m.* +974 74793547
    >
    > PO BOX 26999 Doha, Qatar
    >
    > sidra.org <http://www.sidra.org/>
    >
    >
    > Disclaimer: This email and its attachments may be confidential and are
    > intended solely for the use of the individual to whom it is addressed. If
    > you are not the intended recipient, any reading, printing, storage,
    > disclosure, copying or any other action taken in respect of this e-mail is
    > prohibited and may be unlawful. If you are not the intended recipient,
    > please notify the sender immediately by using the reply function and then
    > permanently delete what you have received. Any views or opinions expressed
    > are solely those of the author and do not necessarily represent those of
    > Sidra Medical and Research Center.
    >


Disclaimer: This email and its attachments may be confidential and are intended solely for the use of the individual to whom it is addressed. If you are not the intended recipient, any reading, printing, storage, disclosure, copying or any other action taken in respect of this e-mail is prohibited and may be unlawful. If you are not the intended recipient, please notify the sender immediately by using the reply function and then permanently delete what you have received. Any views or opinions expressed are solely those of the author and do not necessarily represent those of Sidra Medical and Research Center.

Re: Drill connection using jdbc

Posted by Kunal Khatua <ku...@apache.org>.
There must be a stack trace in the logs.could you share that?

On Tue, Jan 8, 2019, 11:10 PM Tushar Pathare <tpathare@sidra.org wrote:

> Hello Team,
>
>                     We have installed drill 1.12.0 and trying to connect
> using a client to the drill cluster
>
> Our config for connection is
>
>
>
> Drill class is : org.apache.drill.jdbc.Driver
>
> Driver location is
> /Users/tpathare/Downloads/apache-drill-1.12.0/jars/jdbc-driver/drill-jdbc-all-1.12.0.jar
>
> Jdbc url is : jdbc:drill:zk=172.32.63.64:2181,172.32.63.65:2181,
> 172.32.63.67:2181
>
>
>
> When I hit connect I see the following error.Though the cluster is up and
> running and ZK is also good.
>
>
>
> *ERROR: An error occurred while trying to make a connection to *
>
> *the database:  *
>
>
>
> *JDBC URL: *
>
> *jdbc:drill:zk=172.32.63.64:2181
> <http://172.32.63.64:2181>,172.32.63.65:2181
> <http://172.32.63.65:2181>,172.32.63.67:2181/sidra-drillbit
> <http://172.32.63.67:2181/sidra-drillbit> *
>
>
>
> *Failure in connecting to Drill: *
>
> *oadd.org.apache.drill.exec.rpc.RpcException: Failure setting up *
>
> *ZK for client.*
>
>
>
>
>
>
>
> [image: cid:image001.png@01D3B9E9.23323D90]
>
> *Tushar Bhalchandra Pathare*
>
> Bigdata,GPFS,CSXF – Research Department
>
> *t. *+974 4003 7443
>
> *m.* +974 74793547
>
> PO BOX 26999 Doha, Qatar
>
> sidra.org <http://www.sidra.org/>
>
>
> Disclaimer: This email and its attachments may be confidential and are
> intended solely for the use of the individual to whom it is addressed. If
> you are not the intended recipient, any reading, printing, storage,
> disclosure, copying or any other action taken in respect of this e-mail is
> prohibited and may be unlawful. If you are not the intended recipient,
> please notify the sender immediately by using the reply function and then
> permanently delete what you have received. Any views or opinions expressed
> are solely those of the author and do not necessarily represent those of
> Sidra Medical and Research Center.
>

Re: Drill connection using jdbc

Posted by Tushar Pathare <tp...@sidra.org>.
Hello Arjun,
Please find the error below

ERROR: An error occurred while trying to make a connection to
the database:

JDBC URL:
jdbc:drill:zk=172.32.63.64:2181/opt/apache-drill/sidra-drillbit

Failure in creating DrillConnectionImpl:
java.lang.IllegalStateException: No active Drillbit endpoint
found from ZooKeeper. Check connection parameters?


Thanks


Tushar Bhalchandra Pathare
Bigdata,GPFS,CSXF – Research Department
t. +974 4003 7443
m. +974 74793547
PO BOX 26999 Doha, Qatar
sidra.org <http://www.sidra.org/>


On 1/9/19, 11:02 AM, "Arjun kr" <ar...@outlook.com> wrote:

    Yes. I believe its a necessary parameter if non default cluster I'd is used and given in the connection url. You can check if it works with directory specified.

    Get Outlook for Android<https://aka.ms/ghei36>

    ________________________________
    From: Tushar Pathare <tp...@sidra.org>
    Sent: Tuesday, January 8, 2019 11:40:22 PM
    To: user@drill.apache.org
    Subject: Re: Drill connection using jdbc

    Is it necessary because I thought it is optional including the cluster ID


    Tushar Bhalchandra Pathare
    Bigdata,GPFS,CSXF – Research Department
    t. +974 4003 7443
    m. +974 74793547
    PO BOX 26999 Doha, Qatar
    sidra.org <http://www.sidra.org/>


    On 1/9/19, 10:39 AM, "Arjun kr" <ar...@outlook.com> wrote:

        Are you missing drill zk directory in connection url?
        By default, it's value is drill.

        jdbc:drill:zk=<zk name>[:<port>][,<zk name2>[:<port>]...
        <directory>/<cluster ID>;[schema=<storage plugin>]


        https://drill.apache.org/docs/using-the-<https://drill.apache.org/docs/using-the-jdbc-driver/>jdbc<https://drill.apache.org/docs/using-the-jdbc-driver/>-driver/<https://drill.apache.org/docs/using-the-jdbc-driver/>

        Thanks,

        Arjun

        Get Outlook for Android<https://aka.ms/ghei36>

        ________________________________
        From: Khurram Faraaz <kf...@mapr.com>
        Sent: Tuesday, January 8, 2019 11:17:58 PM
        To: user@drill.apache.org
        Subject: Re: Drill connection using jdbc

        Hi Tushar,

        This example works just fine for me, you may want to use the template

        import org.apache.log4j.Logger;

        import java.sql.Connection;
        import java.sql.ResultSet;
        import java.sql.SQLException;
        import java.sql.Statement;
        import java.sql.Types;
        import java.sql.*;
        import java.io.*;
        import java.lang.*;
        import java.util.*;
        import java.util.Scanner;

        public class TestQuery {

        public static void main(String s[]) throws Exception {

            Connection conn = null;
            PreparedStatement prdstmnt = null;
            try {
                    // Please replace test1302-145 with your hostname, name of host
        where Drillbit is up and running
                    final String URL_STRING =
        "jdbc:drill:schema=dfs.tmp;drillbit=test1302-145";
                    Class.forName("org.apache.drill.jdbc.Driver").newInstance();

                    // Please replace username and password with your username and
        password
                    conn = DriverManager.getConnection(URL_STRING,"mapr","mapr");
                    prdstmnt = conn.prepareStatement("SELECT * FROM
        cp.`employee.json`");
                    prdstmnt.executeQuery();
                    prdstmnt.close();
            } catch (Exception e) {
               System.out.println(e.getMessage());
               e.printStackTrace();
            } finally {
                if(conn != null)
                    try { conn.close(); } catch(SQLException sqlexcpn){
        sqlexcpn.printStackTrace(); }
                if(prdstmnt != null)
                    try { prdstmnt.close(); } catch(SQLException sqlexcpn){
        sqlexcpn.printStackTrace(); }
                }
            }
        }

        Regards,
        Khurram

        On Tue, Jan 8, 2019 at 11:10 PM Tushar Pathare <tp...@sidra.org> wrote:

        > Hello Team,
        >
        >                     We have installed drill 1.12.0 and trying to connect
        > using a client to the drill cluster
        >
        > Our config for connection is
        >
        >
        >
        > Drill class is : org.apache.drill.jdbc.Driver
        >
        > Driver location is
        > /Users/tpathare/Downloads/apache-drill-1.12.0/jars/jdbc-driver/drill-jdbc-all-1.12.0.jar
        >
        > Jdbc url is : jdbc:drill:zk=172.32.63.64:2181,172.32.63.65:2181,
        > 172.32.63.67:2181
        >
        >
        >
        > When I hit connect I see the following error.Though the cluster is up and
        > running and ZK is also good.
        >
        >
        >
        > *ERROR: An error occurred while trying to make a connection to *
        >
        > *the database:  *
        >
        >
        >
        > *JDBC URL: *
        >
        > *jdbc:drill:zk=172.32.63.64:2181
        > <http://172.32.63.64:2181>,172.32.63.65:2181
        > <http://172.32.63.65:2181>,172.32.63.67:2181/sidra-drillbit
        > <http://172.32.63.67:2181/sidra-drillbit> *
        >
        >
        >
        > *Failure in connecting to Drill: *
        >
        > *oadd.org.apache.drill.exec.rpc.RpcException: Failure setting up *
        >
        > *ZK for client.*
        >
        >
        >
        >
        >
        >
        >
        > [image: cid:image001.png@01D3B9E9.23323D90]
        >
        > *Tushar Bhalchandra Pathare*
        >
        > Bigdata,GPFS,CSXF – Research Department
        >
        > *t. *+974 4003 7443
        >
        > *m.* +974 74793547
        >
        > PO BOX 26999 Doha, Qatar
        >
        > sidra.org
        > <https://urldefense.proofpoint.com/v2/url?u=http-3A__www.sidra.org_&d=DwMGaQ&c=cskdkSMqhcnjZxdQVpwTXg&r=H5JEl9vb-mBIjic10QAbDD2vkUUKAxjO6wZO322RtdI&m=xCohfm7_vub0ExT6cMTEbB4WbjdIEPLdaXqXAOANq4A&s=kqudpk5v3cRasIbaMG8kwLBXafZ87VEhutJj7vxwhS4&e=>
        >
        >
        > Disclaimer: This email and its attachments may be confidential and are
        > intended solely for the use of the individual to whom it is addressed. If
        > you are not the intended recipient, any reading, printing, storage,
        > disclosure, copying or any other action taken in respect of this e-mail is
        > prohibited and may be unlawful. If you are not the intended recipient,
        > please notify the sender immediately by using the reply function and then
        > permanently delete what you have received. Any views or opinions expressed
        > are solely those of the author and do not necessarily represent those of
        > Sidra Medical and Research Center.
        >


    Disclaimer: This email and its attachments may be confidential and are intended solely for the use of the individual to whom it is addressed. If you are not the intended recipient, any reading, printing, storage, disclosure, copying or any other action taken in respect of this e-mail is prohibited and may be unlawful. If you are not the intended recipient, please notify the sender immediately by using the reply function and then permanently delete what you have received. Any views or opinions expressed are solely those of the author and do not necessarily represent those of Sidra Medical and Research Center.


Disclaimer: This email and its attachments may be confidential and are intended solely for the use of the individual to whom it is addressed. If you are not the intended recipient, any reading, printing, storage, disclosure, copying or any other action taken in respect of this e-mail is prohibited and may be unlawful. If you are not the intended recipient, please notify the sender immediately by using the reply function and then permanently delete what you have received. Any views or opinions expressed are solely those of the author and do not necessarily represent those of Sidra Medical and Research Center.

Re: Drill connection using jdbc

Posted by Tushar Pathare <tp...@sidra.org>.
Hello Arjun,
                   This below example you have given for direct connection to drillbit.Could you help me connect to zk cluster using the same example

Thanks


Tushar Bhalchandra Pathare
Bigdata,GPFS,CSXF – Research Department
t. +974 4003 7443
m. +974 74793547
PO BOX 26999 Doha, Qatar
sidra.org <http://www.sidra.org/>


On 1/9/19, 11:02 AM, "Arjun kr" <ar...@outlook.com> wrote:

    Yes. I believe its a necessary parameter if non default cluster I'd is used and given in the connection url. You can check if it works with directory specified.

    Get Outlook for Android<https://aka.ms/ghei36>

    ________________________________
    From: Tushar Pathare <tp...@sidra.org>
    Sent: Tuesday, January 8, 2019 11:40:22 PM
    To: user@drill.apache.org
    Subject: Re: Drill connection using jdbc

    Is it necessary because I thought it is optional including the cluster ID


    Tushar Bhalchandra Pathare
    Bigdata,GPFS,CSXF – Research Department
    t. +974 4003 7443
    m. +974 74793547
    PO BOX 26999 Doha, Qatar
    sidra.org <http://www.sidra.org/>


    On 1/9/19, 10:39 AM, "Arjun kr" <ar...@outlook.com> wrote:

        Are you missing drill zk directory in connection url?
        By default, it's value is drill.

        jdbc:drill:zk=<zk name>[:<port>][,<zk name2>[:<port>]...
        <directory>/<cluster ID>;[schema=<storage plugin>]


        https://drill.apache.org/docs/using-the-<https://drill.apache.org/docs/using-the-jdbc-driver/>jdbc<https://drill.apache.org/docs/using-the-jdbc-driver/>-driver/<https://drill.apache.org/docs/using-the-jdbc-driver/>

        Thanks,

        Arjun

        Get Outlook for Android<https://aka.ms/ghei36>

        ________________________________
        From: Khurram Faraaz <kf...@mapr.com>
        Sent: Tuesday, January 8, 2019 11:17:58 PM
        To: user@drill.apache.org
        Subject: Re: Drill connection using jdbc

        Hi Tushar,

        This example works just fine for me, you may want to use the template

        import org.apache.log4j.Logger;

        import java.sql.Connection;
        import java.sql.ResultSet;
        import java.sql.SQLException;
        import java.sql.Statement;
        import java.sql.Types;
        import java.sql.*;
        import java.io.*;
        import java.lang.*;
        import java.util.*;
        import java.util.Scanner;

        public class TestQuery {

        public static void main(String s[]) throws Exception {

            Connection conn = null;
            PreparedStatement prdstmnt = null;
            try {
                    // Please replace test1302-145 with your hostname, name of host
        where Drillbit is up and running
                    final String URL_STRING =
        "jdbc:drill:schema=dfs.tmp;drillbit=test1302-145";
                    Class.forName("org.apache.drill.jdbc.Driver").newInstance();

                    // Please replace username and password with your username and
        password
                    conn = DriverManager.getConnection(URL_STRING,"mapr","mapr");
                    prdstmnt = conn.prepareStatement("SELECT * FROM
        cp.`employee.json`");
                    prdstmnt.executeQuery();
                    prdstmnt.close();
            } catch (Exception e) {
               System.out.println(e.getMessage());
               e.printStackTrace();
            } finally {
                if(conn != null)
                    try { conn.close(); } catch(SQLException sqlexcpn){
        sqlexcpn.printStackTrace(); }
                if(prdstmnt != null)
                    try { prdstmnt.close(); } catch(SQLException sqlexcpn){
        sqlexcpn.printStackTrace(); }
                }
            }
        }

        Regards,
        Khurram

        On Tue, Jan 8, 2019 at 11:10 PM Tushar Pathare <tp...@sidra.org> wrote:

        > Hello Team,
        >
        >                     We have installed drill 1.12.0 and trying to connect
        > using a client to the drill cluster
        >
        > Our config for connection is
        >
        >
        >
        > Drill class is : org.apache.drill.jdbc.Driver
        >
        > Driver location is
        > /Users/tpathare/Downloads/apache-drill-1.12.0/jars/jdbc-driver/drill-jdbc-all-1.12.0.jar
        >
        > Jdbc url is : jdbc:drill:zk=172.32.63.64:2181,172.32.63.65:2181,
        > 172.32.63.67:2181
        >
        >
        >
        > When I hit connect I see the following error.Though the cluster is up and
        > running and ZK is also good.
        >
        >
        >
        > *ERROR: An error occurred while trying to make a connection to *
        >
        > *the database:  *
        >
        >
        >
        > *JDBC URL: *
        >
        > *jdbc:drill:zk=172.32.63.64:2181
        > <http://172.32.63.64:2181>,172.32.63.65:2181
        > <http://172.32.63.65:2181>,172.32.63.67:2181/sidra-drillbit
        > <http://172.32.63.67:2181/sidra-drillbit> *
        >
        >
        >
        > *Failure in connecting to Drill: *
        >
        > *oadd.org.apache.drill.exec.rpc.RpcException: Failure setting up *
        >
        > *ZK for client.*
        >
        >
        >
        >
        >
        >
        >
        > [image: cid:image001.png@01D3B9E9.23323D90]
        >
        > *Tushar Bhalchandra Pathare*
        >
        > Bigdata,GPFS,CSXF – Research Department
        >
        > *t. *+974 4003 7443
        >
        > *m.* +974 74793547
        >
        > PO BOX 26999 Doha, Qatar
        >
        > sidra.org
        > <https://urldefense.proofpoint.com/v2/url?u=http-3A__www.sidra.org_&d=DwMGaQ&c=cskdkSMqhcnjZxdQVpwTXg&r=H5JEl9vb-mBIjic10QAbDD2vkUUKAxjO6wZO322RtdI&m=xCohfm7_vub0ExT6cMTEbB4WbjdIEPLdaXqXAOANq4A&s=kqudpk5v3cRasIbaMG8kwLBXafZ87VEhutJj7vxwhS4&e=>
        >
        >
        > Disclaimer: This email and its attachments may be confidential and are
        > intended solely for the use of the individual to whom it is addressed. If
        > you are not the intended recipient, any reading, printing, storage,
        > disclosure, copying or any other action taken in respect of this e-mail is
        > prohibited and may be unlawful. If you are not the intended recipient,
        > please notify the sender immediately by using the reply function and then
        > permanently delete what you have received. Any views or opinions expressed
        > are solely those of the author and do not necessarily represent those of
        > Sidra Medical and Research Center.
        >


    Disclaimer: This email and its attachments may be confidential and are intended solely for the use of the individual to whom it is addressed. If you are not the intended recipient, any reading, printing, storage, disclosure, copying or any other action taken in respect of this e-mail is prohibited and may be unlawful. If you are not the intended recipient, please notify the sender immediately by using the reply function and then permanently delete what you have received. Any views or opinions expressed are solely those of the author and do not necessarily represent those of Sidra Medical and Research Center.


Disclaimer: This email and its attachments may be confidential and are intended solely for the use of the individual to whom it is addressed. If you are not the intended recipient, any reading, printing, storage, disclosure, copying or any other action taken in respect of this e-mail is prohibited and may be unlawful. If you are not the intended recipient, please notify the sender immediately by using the reply function and then permanently delete what you have received. Any views or opinions expressed are solely those of the author and do not necessarily represent those of Sidra Medical and Research Center.

Re: Drill connection using jdbc

Posted by Tushar Pathare <tp...@sidra.org>.
Hello Robert,
                      Thanks for the help issue resolved after adding the zk.root and /drill/sidra-drillbit in the connection string.


Thanks


Tushar Bhalchandra Pathare
Bigdata,GPFS,CSXF – Research Department
t. +974 4003 7443
m. +974 74793547
PO BOX 26999 Doha, Qatar
sidra.org <http://www.sidra.org/>


On 1/9/19, 12:21 PM, "Robert Hou" <rh...@mapr.com> wrote:

    I had to restart drill after I changed drill-override.conf.

    --Robert

    On Wed, Jan 9, 2019 at 1:19 AM Robert Hou <rh...@mapr.com> wrote:

    > I added zk.root to my drill-override.conf and it showed up in zookeeper,
    > and I can connect to the new zk.root.  Since you don't have zk.root, then
    > you should use "drill" in your connection URL.
    >
    > Thanks.
    >
    > --Robert
    >
    > On Wed, Jan 9, 2019 at 1:08 AM Robert Hou <rh...@mapr.com> wrote:
    >
    >> When you run "ls /" in zookeeper, you should see something like this:
    >>
    >>    [zookeeper, resourcemanager_locks, services, drill, servers, nodes]
    >>
    >> I believe this is where your zk.root is defined.  So in my case, it is
    >> "drill" which is the default.
    >>
    >> Thanks.
    >>
    >> --Robert
    >>
    >> On Wed, Jan 9, 2019 at 1:03 AM Robert Hou <rh...@mapr.com> wrote:
    >>
    >>> Can you try "drill" as your zk.root?
    >>>
    >>> What do you see when you log into zookeeper and run "ls /"?
    >>>
    >>> Thanks.
    >>>
    >>> --Robert
    >>>
    >>> On Wed, Jan 9, 2019 at 12:45 AM Tushar Pathare <tp...@sidra.org>
    >>> wrote:
    >>>
    >>>> Hello Robert,
    >>>>                        Thanks for the info.
    >>>>                        Drillbit connection worked but zk connection not
    >>>> working.
    >>>>                        Zk.root for me is /opt/drill and clusterid is
    >>>> sidra-drillbit.
    >>>>
    >>>> My drill-override.conf looks as follows.
    >>>>
    >>>> drill.exec: {
    >>>>   cluster-id: "sidra-drillbit",
    >>>>   zk.connect: "hpcsrcn01:2181,hpcsrcn02:2181,hpcsrcn04:2181"
    >>>> }
    >>>>
    >>>>
    >>>>
    >>>> Tushar Bhalchandra Pathare
    >>>> Bigdata,GPFS,CSXF – Research Department
    >>>> t. +974 4003 7443
    >>>> m. +974 74793547
    >>>> PO BOX 26999 Doha, Qatar
    >>>> sidra.org <
    >>>> https://urldefense.proofpoint.com/v2/url?u=http-3A__www.sidra.org_&d=DwIGaQ&c=cskdkSMqhcnjZxdQVpwTXg&r=GXRJhB4g1YFDJsrcglHwUA&m=GzXrG3NEgyu3DwC61SjSD5gw0TYMT4GGi_jOLjSGttY&s=3IKZg-nDhsGJG70FdwBMabw_o0GCo_vADXVODbny7T8&e=
    >>>> >
    >>>>
    >>>>
    >>>> On 1/9/19, 11:34 AM, "Robert Hou" <rh...@mapr.com> wrote:
    >>>>
    >>>>     I would suggest connecting with drillbit first, and if that works,
    >>>> I would
    >>>>     use zookeeper.
    >>>>
    >>>>        sqlline -u "jdbc:drill:drillbit=<IP address>"
    >>>>
    >>>>     Please note the quotation marks.
    >>>>
    >>>>     If that works, then try:
    >>>>
    >>>>        sqlline -u "jdbc:drill:zk=<IPaddress>:port/<zk.root for
    >>>>     drill>/<clusterID>"
    >>>>
    >>>>     zk.root is "drill" by default.  If you have specified zk.root in
    >>>>     drill-override.conf, then use that.
    >>>>
    >>>>     Thanks.
    >>>>
    >>>>     --Robert
    >>>>
    >>>>
    >>>>     On Wed, Jan 9, 2019 at 12:13 AM Tushar Pathare <tp...@sidra.org>
    >>>> wrote:
    >>>>
    >>>>     > Hello Team,
    >>>>     > Same issue.
    >>>>     >
    >>>>     >
    >>>>     > ERROR: An error occurred while trying to make a connection to
    >>>>     > the database:
    >>>>     >
    >>>>     > JDBC URL:
    >>>>     > jdbc:drill:zk=172.32.63.64:2181/opt/apache-drill/sidra-drillbit
    >>>>     >
    >>>>     > Failure in creating DrillConnectionImpl:
    >>>>     > java.lang.IllegalStateException: No active Drillbit endpoint
    >>>>     > found from ZooKeeper. Check connection parameters?
    >>>>     >
    >>>>     >
    >>>>     > Tushar Bhalchandra Pathare
    >>>>     > Bigdata,GPFS,CSXF – Research Department
    >>>>     > t. +974 4003 7443
    >>>>     > m. +974 74793547
    >>>>     > PO BOX 26999 Doha, Qatar
    >>>>     > sidra.org <
    >>>>     >
    >>>> https://urldefense.proofpoint.com/v2/url?u=http-3A__www.sidra.org_&d=DwIGaQ&c=cskdkSMqhcnjZxdQVpwTXg&r=GXRJhB4g1YFDJsrcglHwUA&m=BJqk_hazvoApEDyas3DwYGI3NAEtSjzIEex2DF5uhHk&s=9M5Aak1SIn-KuFJWfpDiUyALzAKZWCwQUnD_m-SQvtA&e=
    >>>>     > >
    >>>>     >
    >>>>     >
    >>>>     > On 1/9/19, 11:02 AM, "Arjun kr" <ar...@outlook.com> wrote:
    >>>>     >
    >>>>     >     Yes. I believe its a necessary parameter if non default
    >>>> cluster I'd is
    >>>>     > used and given in the connection url. You can check if it works
    >>>> with
    >>>>     > directory specified.
    >>>>     >
    >>>>     >     Get Outlook for Android<
    >>>>     >
    >>>> https://urldefense.proofpoint.com/v2/url?u=https-3A__aka.ms_ghei36&d=DwIGaQ&c=cskdkSMqhcnjZxdQVpwTXg&r=GXRJhB4g1YFDJsrcglHwUA&m=BJqk_hazvoApEDyas3DwYGI3NAEtSjzIEex2DF5uhHk&s=Pq7kuN1t4H6e-BdtFBP7VVnFqhNMVVXBHX8qIQMq9B0&e=
    >>>>     > >
    >>>>     >
    >>>>     >     ________________________________
    >>>>     >     From: Tushar Pathare <tp...@sidra.org>
    >>>>     >     Sent: Tuesday, January 8, 2019 11:40:22 PM
    >>>>     >     To: user@drill.apache.org
    >>>>     >     Subject: Re: Drill connection using jdbc
    >>>>     >
    >>>>     >     Is it necessary because I thought it is optional including
    >>>> the cluster
    >>>>     > ID
    >>>>     >
    >>>>     >
    >>>>     >     Tushar Bhalchandra Pathare
    >>>>     >     Bigdata,GPFS,CSXF – Research Department
    >>>>     >     t. +974 4003 7443
    >>>>     >     m. +974 74793547
    >>>>     >     PO BOX 26999 Doha, Qatar
    >>>>     >     sidra.org <
    >>>>     >
    >>>> https://urldefense.proofpoint.com/v2/url?u=http-3A__www.sidra.org_&d=DwIGaQ&c=cskdkSMqhcnjZxdQVpwTXg&r=GXRJhB4g1YFDJsrcglHwUA&m=BJqk_hazvoApEDyas3DwYGI3NAEtSjzIEex2DF5uhHk&s=9M5Aak1SIn-KuFJWfpDiUyALzAKZWCwQUnD_m-SQvtA&e=
    >>>>     > >
    >>>>     >
    >>>>     >
    >>>>     >     On 1/9/19, 10:39 AM, "Arjun kr" <ar...@outlook.com> wrote:
    >>>>     >
    >>>>     >         Are you missing drill zk directory in connection url?
    >>>>     >         By default, it's value is drill.
    >>>>     >
    >>>>     >         jdbc:drill:zk=<zk name>[:<port>][,<zk name2>[:<port>]...
    >>>>     >         <directory>/<cluster ID>;[schema=<storage plugin>]
    >>>>     >
    >>>>     >
    >>>>     >
    >>>>     >
    >>>> https://urldefense.proofpoint.com/v2/url?u=https-3A__drill.apache.org_docs_using-2Dthe-2D&d=DwIGaQ&c=cskdkSMqhcnjZxdQVpwTXg&r=GXRJhB4g1YFDJsrcglHwUA&m=BJqk_hazvoApEDyas3DwYGI3NAEtSjzIEex2DF5uhHk&s=OkoCdG1xe3BPsJ45-qJ9Z7ewXUUgGpz3w54SuZXNr9U&e=
    >>>>     > <
    >>>>     >
    >>>> https://urldefense.proofpoint.com/v2/url?u=https-3A__drill.apache.org_docs_using-2Dthe-2Djdbc-2Ddriver_&d=DwIGaQ&c=cskdkSMqhcnjZxdQVpwTXg&r=GXRJhB4g1YFDJsrcglHwUA&m=BJqk_hazvoApEDyas3DwYGI3NAEtSjzIEex2DF5uhHk&s=YuYqrYaD7-X633jjZFcolbBVC82m74rKASSB0u87LTo&e=
    >>>>     > >jdbc<
    >>>>     >
    >>>> https://urldefense.proofpoint.com/v2/url?u=https-3A__drill.apache.org_docs_using-2Dthe-2Djdbc-2Ddriver_&d=DwIGaQ&c=cskdkSMqhcnjZxdQVpwTXg&r=GXRJhB4g1YFDJsrcglHwUA&m=BJqk_hazvoApEDyas3DwYGI3NAEtSjzIEex2DF5uhHk&s=YuYqrYaD7-X633jjZFcolbBVC82m74rKASSB0u87LTo&e=
    >>>>     > >-driver/<
    >>>>     >
    >>>> https://urldefense.proofpoint.com/v2/url?u=https-3A__drill.apache.org_docs_using-2Dthe-2Djdbc-2Ddriver_&d=DwIGaQ&c=cskdkSMqhcnjZxdQVpwTXg&r=GXRJhB4g1YFDJsrcglHwUA&m=BJqk_hazvoApEDyas3DwYGI3NAEtSjzIEex2DF5uhHk&s=YuYqrYaD7-X633jjZFcolbBVC82m74rKASSB0u87LTo&e=
    >>>>     > >
    >>>>     >
    >>>>     >         Thanks,
    >>>>     >
    >>>>     >         Arjun
    >>>>     >
    >>>>     >         Get Outlook for Android<
    >>>>     >
    >>>> https://urldefense.proofpoint.com/v2/url?u=https-3A__aka.ms_ghei36&d=DwIGaQ&c=cskdkSMqhcnjZxdQVpwTXg&r=GXRJhB4g1YFDJsrcglHwUA&m=BJqk_hazvoApEDyas3DwYGI3NAEtSjzIEex2DF5uhHk&s=Pq7kuN1t4H6e-BdtFBP7VVnFqhNMVVXBHX8qIQMq9B0&e=
    >>>>     > >
    >>>>     >
    >>>>     >         ________________________________
    >>>>     >         From: Khurram Faraaz <kf...@mapr.com>
    >>>>     >         Sent: Tuesday, January 8, 2019 11:17:58 PM
    >>>>     >         To: user@drill.apache.org
    >>>>     >         Subject: Re: Drill connection using jdbc
    >>>>     >
    >>>>     >         Hi Tushar,
    >>>>     >
    >>>>     >         This example works just fine for me, you may want to use
    >>>> the
    >>>>     > template
    >>>>     >
    >>>>     >         import org.apache.log4j.Logger;
    >>>>     >
    >>>>     >         import java.sql.Connection;
    >>>>     >         import java.sql.ResultSet;
    >>>>     >         import java.sql.SQLException;
    >>>>     >         import java.sql.Statement;
    >>>>     >         import java.sql.Types;
    >>>>     >         import java.sql.*;
    >>>>     >         import java.io.*;
    >>>>     >         import java.lang.*;
    >>>>     >         import java.util.*;
    >>>>     >         import java.util.Scanner;
    >>>>     >
    >>>>     >         public class TestQuery {
    >>>>     >
    >>>>     >         public static void main(String s[]) throws Exception {
    >>>>     >
    >>>>     >             Connection conn = null;
    >>>>     >             PreparedStatement prdstmnt = null;
    >>>>     >             try {
    >>>>     >                     // Please replace test1302-145 with your
    >>>> hostname,
    >>>>     > name of host
    >>>>     >         where Drillbit is up and running
    >>>>     >                     final String URL_STRING =
    >>>>     >         "jdbc:drill:schema=dfs.tmp;drillbit=test1302-145";
    >>>>     >
    >>>>     > Class.forName("org.apache.drill.jdbc.Driver").newInstance();
    >>>>     >
    >>>>     >                     // Please replace username and password with
    >>>> your
    >>>>     > username and
    >>>>     >         password
    >>>>     >                     conn =
    >>>>     > DriverManager.getConnection(URL_STRING,"mapr","mapr");
    >>>>     >                     prdstmnt = conn.prepareStatement("SELECT *
    >>>> FROM
    >>>>     >         cp.`employee.json`");
    >>>>     >                     prdstmnt.executeQuery();
    >>>>     >                     prdstmnt.close();
    >>>>     >             } catch (Exception e) {
    >>>>     >                System.out.println(e.getMessage());
    >>>>     >                e.printStackTrace();
    >>>>     >             } finally {
    >>>>     >                 if(conn != null)
    >>>>     >                     try { conn.close(); } catch(SQLException
    >>>> sqlexcpn){
    >>>>     >         sqlexcpn.printStackTrace(); }
    >>>>     >                 if(prdstmnt != null)
    >>>>     >                     try { prdstmnt.close(); } catch(SQLException
    >>>> sqlexcpn){
    >>>>     >         sqlexcpn.printStackTrace(); }
    >>>>     >                 }
    >>>>     >             }
    >>>>     >         }
    >>>>     >
    >>>>     >         Regards,
    >>>>     >         Khurram
    >>>>     >
    >>>>     >         On Tue, Jan 8, 2019 at 11:10 PM Tushar Pathare <
    >>>> tpathare@sidra.org>
    >>>>     > wrote:
    >>>>     >
    >>>>     >         > Hello Team,
    >>>>     >         >
    >>>>     >         >                     We have installed drill 1.12.0 and
    >>>> trying to
    >>>>     > connect
    >>>>     >         > using a client to the drill cluster
    >>>>     >         >
    >>>>     >         > Our config for connection is
    >>>>     >         >
    >>>>     >         >
    >>>>     >         >
    >>>>     >         > Drill class is : org.apache.drill.jdbc.Driver
    >>>>     >         >
    >>>>     >         > Driver location is
    >>>>     >         >
    >>>>     >
    >>>> /Users/tpathare/Downloads/apache-drill-1.12.0/jars/jdbc-driver/drill-jdbc-all-1.12.0.jar
    >>>>     >         >
    >>>>     >         > Jdbc url is : jdbc:drill:zk=172.32.63.64:2181,
    >>>> 172.32.63.65:2181,
    >>>>     >         > 172.32.63.67:2181
    >>>>     >         >
    >>>>     >         >
    >>>>     >         >
    >>>>     >         > When I hit connect I see the following error.Though the
    >>>> cluster
    >>>>     > is up and
    >>>>     >         > running and ZK is also good.
    >>>>     >         >
    >>>>     >         >
    >>>>     >         >
    >>>>     >         > *ERROR: An error occurred while trying to make a
    >>>> connection to *
    >>>>     >         >
    >>>>     >         > *the database:  *
    >>>>     >         >
    >>>>     >         >
    >>>>     >         >
    >>>>     >         > *JDBC URL: *
    >>>>     >         >
    >>>>     >         > *jdbc:drill:zk=172.32.63.64:2181
    >>>>     >         > <
    >>>>     >
    >>>> https://urldefense.proofpoint.com/v2/url?u=http-3A__172.32.63.64-3A2181&d=DwIGaQ&c=cskdkSMqhcnjZxdQVpwTXg&r=GXRJhB4g1YFDJsrcglHwUA&m=BJqk_hazvoApEDyas3DwYGI3NAEtSjzIEex2DF5uhHk&s=-X33aklNalfpJDS18b6-wH5bkmY2QWJ4iba8p6pmxn4&e=
    >>>>     > >,172.32.63.65:2181
    >>>>     >         > <
    >>>>     >
    >>>> https://urldefense.proofpoint.com/v2/url?u=http-3A__172.32.63.65-3A2181&d=DwIGaQ&c=cskdkSMqhcnjZxdQVpwTXg&r=GXRJhB4g1YFDJsrcglHwUA&m=BJqk_hazvoApEDyas3DwYGI3NAEtSjzIEex2DF5uhHk&s=fHrzLbqH4CpgspWDHoMyOMneXh2YP2HD7frqI4ITiUM&e=
    >>>>     > >,172.32.63.67:2181/sidra-drillbit
    >>>>     >         > <
    >>>>     >
    >>>> https://urldefense.proofpoint.com/v2/url?u=http-3A__172.32.63.67-3A2181_sidra-2Ddrillbit&d=DwIGaQ&c=cskdkSMqhcnjZxdQVpwTXg&r=GXRJhB4g1YFDJsrcglHwUA&m=BJqk_hazvoApEDyas3DwYGI3NAEtSjzIEex2DF5uhHk&s=o9EFkEIaCa6F7My4l3JXFfeeZtFJFqytiFAxLxybbg4&e=
    >>>> >
    >>>>     > *
    >>>>     >         >
    >>>>     >         >
    >>>>     >         >
    >>>>     >         > *Failure in connecting to Drill: *
    >>>>     >         >
    >>>>     >         > *oadd.org.apache.drill.exec.rpc.RpcException: Failure
    >>>> setting up
    >>>>     > *
    >>>>     >         >
    >>>>     >         > *ZK for client.*
    >>>>     >         >
    >>>>     >         >
    >>>>     >         >
    >>>>     >         >
    >>>>     >         >
    >>>>     >         >
    >>>>     >         >
    >>>>     >         > [image: cid:image001.png@01D3B9E9.23323D90]
    >>>>     >         >
    >>>>     >         > *Tushar Bhalchandra Pathare*
    >>>>     >         >
    >>>>     >         > Bigdata,GPFS,CSXF – Research Department
    >>>>     >         >
    >>>>     >         > *t. *+974 4003 7443
    >>>>     >         >
    >>>>     >         > *m.* +974 74793547
    >>>>     >         >
    >>>>     >         > PO BOX 26999 Doha, Qatar
    >>>>     >         >
    >>>>     >         > sidra.org
    >>>>     >         > <
    >>>>     >
    >>>> https://urldefense.proofpoint.com/v2/url?u=http-3A__www.sidra.org_&d=DwMGaQ&c=cskdkSMqhcnjZxdQVpwTXg&r=H5JEl9vb-mBIjic10QAbDD2vkUUKAxjO6wZO322RtdI&m=xCohfm7_vub0ExT6cMTEbB4WbjdIEPLdaXqXAOANq4A&s=kqudpk5v3cRasIbaMG8kwLBXafZ87VEhutJj7vxwhS4&e=
    >>>>     > >
    >>>>     >         >
    >>>>     >         >
    >>>>     >         > Disclaimer: This email and its attachments may be
    >>>> confidential
    >>>>     > and are
    >>>>     >         > intended solely for the use of the individual to whom
    >>>> it is
    >>>>     > addressed. If
    >>>>     >         > you are not the intended recipient, any reading,
    >>>> printing,
    >>>>     > storage,
    >>>>     >         > disclosure, copying or any other action taken in
    >>>> respect of this
    >>>>     > e-mail is
    >>>>     >         > prohibited and may be unlawful. If you are not the
    >>>> intended
    >>>>     > recipient,
    >>>>     >         > please notify the sender immediately by using the reply
    >>>> function
    >>>>     > and then
    >>>>     >         > permanently delete what you have received. Any views or
    >>>> opinions
    >>>>     > expressed
    >>>>     >         > are solely those of the author and do not necessarily
    >>>> represent
    >>>>     > those of
    >>>>     >         > Sidra Medical and Research Center.
    >>>>     >         >
    >>>>     >
    >>>>     >
    >>>>     >     Disclaimer: This email and its attachments may be
    >>>> confidential and are
    >>>>     > intended solely for the use of the individual to whom it is
    >>>> addressed. If
    >>>>     > you are not the intended recipient, any reading, printing,
    >>>> storage,
    >>>>     > disclosure, copying or any other action taken in respect of this
    >>>> e-mail is
    >>>>     > prohibited and may be unlawful. If you are not the intended
    >>>> recipient,
    >>>>     > please notify the sender immediately by using the reply function
    >>>> and then
    >>>>     > permanently delete what you have received. Any views or opinions
    >>>> expressed
    >>>>     > are solely those of the author and do not necessarily represent
    >>>> those of
    >>>>     > Sidra Medical and Research Center.
    >>>>     >
    >>>>     >
    >>>>     > Disclaimer: This email and its attachments may be confidential
    >>>> and are
    >>>>     > intended solely for the use of the individual to whom it is
    >>>> addressed. If
    >>>>     > you are not the intended recipient, any reading, printing,
    >>>> storage,
    >>>>     > disclosure, copying or any other action taken in respect of this
    >>>> e-mail is
    >>>>     > prohibited and may be unlawful. If you are not the intended
    >>>> recipient,
    >>>>     > please notify the sender immediately by using the reply function
    >>>> and then
    >>>>     > permanently delete what you have received. Any views or opinions
    >>>> expressed
    >>>>     > are solely those of the author and do not necessarily represent
    >>>> those of
    >>>>     > Sidra Medical and Research Center.
    >>>>     >
    >>>>
    >>>>
    >>>> Disclaimer: This email and its attachments may be confidential and are
    >>>> intended solely for the use of the individual to whom it is addressed. If
    >>>> you are not the intended recipient, any reading, printing, storage,
    >>>> disclosure, copying or any other action taken in respect of this e-mail is
    >>>> prohibited and may be unlawful. If you are not the intended recipient,
    >>>> please notify the sender immediately by using the reply function and then
    >>>> permanently delete what you have received. Any views or opinions expressed
    >>>> are solely those of the author and do not necessarily represent those of
    >>>> Sidra Medical and Research Center.
    >>>>
    >>>


Disclaimer: This email and its attachments may be confidential and are intended solely for the use of the individual to whom it is addressed. If you are not the intended recipient, any reading, printing, storage, disclosure, copying or any other action taken in respect of this e-mail is prohibited and may be unlawful. If you are not the intended recipient, please notify the sender immediately by using the reply function and then permanently delete what you have received. Any views or opinions expressed are solely those of the author and do not necessarily represent those of Sidra Medical and Research Center.

Re: Drill connection using jdbc

Posted by Robert Hou <rh...@mapr.com>.
I had to restart drill after I changed drill-override.conf.

--Robert

On Wed, Jan 9, 2019 at 1:19 AM Robert Hou <rh...@mapr.com> wrote:

> I added zk.root to my drill-override.conf and it showed up in zookeeper,
> and I can connect to the new zk.root.  Since you don't have zk.root, then
> you should use "drill" in your connection URL.
>
> Thanks.
>
> --Robert
>
> On Wed, Jan 9, 2019 at 1:08 AM Robert Hou <rh...@mapr.com> wrote:
>
>> When you run "ls /" in zookeeper, you should see something like this:
>>
>>    [zookeeper, resourcemanager_locks, services, drill, servers, nodes]
>>
>> I believe this is where your zk.root is defined.  So in my case, it is
>> "drill" which is the default.
>>
>> Thanks.
>>
>> --Robert
>>
>> On Wed, Jan 9, 2019 at 1:03 AM Robert Hou <rh...@mapr.com> wrote:
>>
>>> Can you try "drill" as your zk.root?
>>>
>>> What do you see when you log into zookeeper and run "ls /"?
>>>
>>> Thanks.
>>>
>>> --Robert
>>>
>>> On Wed, Jan 9, 2019 at 12:45 AM Tushar Pathare <tp...@sidra.org>
>>> wrote:
>>>
>>>> Hello Robert,
>>>>                        Thanks for the info.
>>>>                        Drillbit connection worked but zk connection not
>>>> working.
>>>>                        Zk.root for me is /opt/drill and clusterid is
>>>> sidra-drillbit.
>>>>
>>>> My drill-override.conf looks as follows.
>>>>
>>>> drill.exec: {
>>>>   cluster-id: "sidra-drillbit",
>>>>   zk.connect: "hpcsrcn01:2181,hpcsrcn02:2181,hpcsrcn04:2181"
>>>> }
>>>>
>>>>
>>>>
>>>> Tushar Bhalchandra Pathare
>>>> Bigdata,GPFS,CSXF – Research Department
>>>> t. +974 4003 7443
>>>> m. +974 74793547
>>>> PO BOX 26999 Doha, Qatar
>>>> sidra.org <
>>>> https://urldefense.proofpoint.com/v2/url?u=http-3A__www.sidra.org_&d=DwIGaQ&c=cskdkSMqhcnjZxdQVpwTXg&r=GXRJhB4g1YFDJsrcglHwUA&m=GzXrG3NEgyu3DwC61SjSD5gw0TYMT4GGi_jOLjSGttY&s=3IKZg-nDhsGJG70FdwBMabw_o0GCo_vADXVODbny7T8&e=
>>>> >
>>>>
>>>>
>>>> On 1/9/19, 11:34 AM, "Robert Hou" <rh...@mapr.com> wrote:
>>>>
>>>>     I would suggest connecting with drillbit first, and if that works,
>>>> I would
>>>>     use zookeeper.
>>>>
>>>>        sqlline -u "jdbc:drill:drillbit=<IP address>"
>>>>
>>>>     Please note the quotation marks.
>>>>
>>>>     If that works, then try:
>>>>
>>>>        sqlline -u "jdbc:drill:zk=<IPaddress>:port/<zk.root for
>>>>     drill>/<clusterID>"
>>>>
>>>>     zk.root is "drill" by default.  If you have specified zk.root in
>>>>     drill-override.conf, then use that.
>>>>
>>>>     Thanks.
>>>>
>>>>     --Robert
>>>>
>>>>
>>>>     On Wed, Jan 9, 2019 at 12:13 AM Tushar Pathare <tp...@sidra.org>
>>>> wrote:
>>>>
>>>>     > Hello Team,
>>>>     > Same issue.
>>>>     >
>>>>     >
>>>>     > ERROR: An error occurred while trying to make a connection to
>>>>     > the database:
>>>>     >
>>>>     > JDBC URL:
>>>>     > jdbc:drill:zk=172.32.63.64:2181/opt/apache-drill/sidra-drillbit
>>>>     >
>>>>     > Failure in creating DrillConnectionImpl:
>>>>     > java.lang.IllegalStateException: No active Drillbit endpoint
>>>>     > found from ZooKeeper. Check connection parameters?
>>>>     >
>>>>     >
>>>>     > Tushar Bhalchandra Pathare
>>>>     > Bigdata,GPFS,CSXF – Research Department
>>>>     > t. +974 4003 7443
>>>>     > m. +974 74793547
>>>>     > PO BOX 26999 Doha, Qatar
>>>>     > sidra.org <
>>>>     >
>>>> https://urldefense.proofpoint.com/v2/url?u=http-3A__www.sidra.org_&d=DwIGaQ&c=cskdkSMqhcnjZxdQVpwTXg&r=GXRJhB4g1YFDJsrcglHwUA&m=BJqk_hazvoApEDyas3DwYGI3NAEtSjzIEex2DF5uhHk&s=9M5Aak1SIn-KuFJWfpDiUyALzAKZWCwQUnD_m-SQvtA&e=
>>>>     > >
>>>>     >
>>>>     >
>>>>     > On 1/9/19, 11:02 AM, "Arjun kr" <ar...@outlook.com> wrote:
>>>>     >
>>>>     >     Yes. I believe its a necessary parameter if non default
>>>> cluster I'd is
>>>>     > used and given in the connection url. You can check if it works
>>>> with
>>>>     > directory specified.
>>>>     >
>>>>     >     Get Outlook for Android<
>>>>     >
>>>> https://urldefense.proofpoint.com/v2/url?u=https-3A__aka.ms_ghei36&d=DwIGaQ&c=cskdkSMqhcnjZxdQVpwTXg&r=GXRJhB4g1YFDJsrcglHwUA&m=BJqk_hazvoApEDyas3DwYGI3NAEtSjzIEex2DF5uhHk&s=Pq7kuN1t4H6e-BdtFBP7VVnFqhNMVVXBHX8qIQMq9B0&e=
>>>>     > >
>>>>     >
>>>>     >     ________________________________
>>>>     >     From: Tushar Pathare <tp...@sidra.org>
>>>>     >     Sent: Tuesday, January 8, 2019 11:40:22 PM
>>>>     >     To: user@drill.apache.org
>>>>     >     Subject: Re: Drill connection using jdbc
>>>>     >
>>>>     >     Is it necessary because I thought it is optional including
>>>> the cluster
>>>>     > ID
>>>>     >
>>>>     >
>>>>     >     Tushar Bhalchandra Pathare
>>>>     >     Bigdata,GPFS,CSXF – Research Department
>>>>     >     t. +974 4003 7443
>>>>     >     m. +974 74793547
>>>>     >     PO BOX 26999 Doha, Qatar
>>>>     >     sidra.org <
>>>>     >
>>>> https://urldefense.proofpoint.com/v2/url?u=http-3A__www.sidra.org_&d=DwIGaQ&c=cskdkSMqhcnjZxdQVpwTXg&r=GXRJhB4g1YFDJsrcglHwUA&m=BJqk_hazvoApEDyas3DwYGI3NAEtSjzIEex2DF5uhHk&s=9M5Aak1SIn-KuFJWfpDiUyALzAKZWCwQUnD_m-SQvtA&e=
>>>>     > >
>>>>     >
>>>>     >
>>>>     >     On 1/9/19, 10:39 AM, "Arjun kr" <ar...@outlook.com> wrote:
>>>>     >
>>>>     >         Are you missing drill zk directory in connection url?
>>>>     >         By default, it's value is drill.
>>>>     >
>>>>     >         jdbc:drill:zk=<zk name>[:<port>][,<zk name2>[:<port>]...
>>>>     >         <directory>/<cluster ID>;[schema=<storage plugin>]
>>>>     >
>>>>     >
>>>>     >
>>>>     >
>>>> https://urldefense.proofpoint.com/v2/url?u=https-3A__drill.apache.org_docs_using-2Dthe-2D&d=DwIGaQ&c=cskdkSMqhcnjZxdQVpwTXg&r=GXRJhB4g1YFDJsrcglHwUA&m=BJqk_hazvoApEDyas3DwYGI3NAEtSjzIEex2DF5uhHk&s=OkoCdG1xe3BPsJ45-qJ9Z7ewXUUgGpz3w54SuZXNr9U&e=
>>>>     > <
>>>>     >
>>>> https://urldefense.proofpoint.com/v2/url?u=https-3A__drill.apache.org_docs_using-2Dthe-2Djdbc-2Ddriver_&d=DwIGaQ&c=cskdkSMqhcnjZxdQVpwTXg&r=GXRJhB4g1YFDJsrcglHwUA&m=BJqk_hazvoApEDyas3DwYGI3NAEtSjzIEex2DF5uhHk&s=YuYqrYaD7-X633jjZFcolbBVC82m74rKASSB0u87LTo&e=
>>>>     > >jdbc<
>>>>     >
>>>> https://urldefense.proofpoint.com/v2/url?u=https-3A__drill.apache.org_docs_using-2Dthe-2Djdbc-2Ddriver_&d=DwIGaQ&c=cskdkSMqhcnjZxdQVpwTXg&r=GXRJhB4g1YFDJsrcglHwUA&m=BJqk_hazvoApEDyas3DwYGI3NAEtSjzIEex2DF5uhHk&s=YuYqrYaD7-X633jjZFcolbBVC82m74rKASSB0u87LTo&e=
>>>>     > >-driver/<
>>>>     >
>>>> https://urldefense.proofpoint.com/v2/url?u=https-3A__drill.apache.org_docs_using-2Dthe-2Djdbc-2Ddriver_&d=DwIGaQ&c=cskdkSMqhcnjZxdQVpwTXg&r=GXRJhB4g1YFDJsrcglHwUA&m=BJqk_hazvoApEDyas3DwYGI3NAEtSjzIEex2DF5uhHk&s=YuYqrYaD7-X633jjZFcolbBVC82m74rKASSB0u87LTo&e=
>>>>     > >
>>>>     >
>>>>     >         Thanks,
>>>>     >
>>>>     >         Arjun
>>>>     >
>>>>     >         Get Outlook for Android<
>>>>     >
>>>> https://urldefense.proofpoint.com/v2/url?u=https-3A__aka.ms_ghei36&d=DwIGaQ&c=cskdkSMqhcnjZxdQVpwTXg&r=GXRJhB4g1YFDJsrcglHwUA&m=BJqk_hazvoApEDyas3DwYGI3NAEtSjzIEex2DF5uhHk&s=Pq7kuN1t4H6e-BdtFBP7VVnFqhNMVVXBHX8qIQMq9B0&e=
>>>>     > >
>>>>     >
>>>>     >         ________________________________
>>>>     >         From: Khurram Faraaz <kf...@mapr.com>
>>>>     >         Sent: Tuesday, January 8, 2019 11:17:58 PM
>>>>     >         To: user@drill.apache.org
>>>>     >         Subject: Re: Drill connection using jdbc
>>>>     >
>>>>     >         Hi Tushar,
>>>>     >
>>>>     >         This example works just fine for me, you may want to use
>>>> the
>>>>     > template
>>>>     >
>>>>     >         import org.apache.log4j.Logger;
>>>>     >
>>>>     >         import java.sql.Connection;
>>>>     >         import java.sql.ResultSet;
>>>>     >         import java.sql.SQLException;
>>>>     >         import java.sql.Statement;
>>>>     >         import java.sql.Types;
>>>>     >         import java.sql.*;
>>>>     >         import java.io.*;
>>>>     >         import java.lang.*;
>>>>     >         import java.util.*;
>>>>     >         import java.util.Scanner;
>>>>     >
>>>>     >         public class TestQuery {
>>>>     >
>>>>     >         public static void main(String s[]) throws Exception {
>>>>     >
>>>>     >             Connection conn = null;
>>>>     >             PreparedStatement prdstmnt = null;
>>>>     >             try {
>>>>     >                     // Please replace test1302-145 with your
>>>> hostname,
>>>>     > name of host
>>>>     >         where Drillbit is up and running
>>>>     >                     final String URL_STRING =
>>>>     >         "jdbc:drill:schema=dfs.tmp;drillbit=test1302-145";
>>>>     >
>>>>     > Class.forName("org.apache.drill.jdbc.Driver").newInstance();
>>>>     >
>>>>     >                     // Please replace username and password with
>>>> your
>>>>     > username and
>>>>     >         password
>>>>     >                     conn =
>>>>     > DriverManager.getConnection(URL_STRING,"mapr","mapr");
>>>>     >                     prdstmnt = conn.prepareStatement("SELECT *
>>>> FROM
>>>>     >         cp.`employee.json`");
>>>>     >                     prdstmnt.executeQuery();
>>>>     >                     prdstmnt.close();
>>>>     >             } catch (Exception e) {
>>>>     >                System.out.println(e.getMessage());
>>>>     >                e.printStackTrace();
>>>>     >             } finally {
>>>>     >                 if(conn != null)
>>>>     >                     try { conn.close(); } catch(SQLException
>>>> sqlexcpn){
>>>>     >         sqlexcpn.printStackTrace(); }
>>>>     >                 if(prdstmnt != null)
>>>>     >                     try { prdstmnt.close(); } catch(SQLException
>>>> sqlexcpn){
>>>>     >         sqlexcpn.printStackTrace(); }
>>>>     >                 }
>>>>     >             }
>>>>     >         }
>>>>     >
>>>>     >         Regards,
>>>>     >         Khurram
>>>>     >
>>>>     >         On Tue, Jan 8, 2019 at 11:10 PM Tushar Pathare <
>>>> tpathare@sidra.org>
>>>>     > wrote:
>>>>     >
>>>>     >         > Hello Team,
>>>>     >         >
>>>>     >         >                     We have installed drill 1.12.0 and
>>>> trying to
>>>>     > connect
>>>>     >         > using a client to the drill cluster
>>>>     >         >
>>>>     >         > Our config for connection is
>>>>     >         >
>>>>     >         >
>>>>     >         >
>>>>     >         > Drill class is : org.apache.drill.jdbc.Driver
>>>>     >         >
>>>>     >         > Driver location is
>>>>     >         >
>>>>     >
>>>> /Users/tpathare/Downloads/apache-drill-1.12.0/jars/jdbc-driver/drill-jdbc-all-1.12.0.jar
>>>>     >         >
>>>>     >         > Jdbc url is : jdbc:drill:zk=172.32.63.64:2181,
>>>> 172.32.63.65:2181,
>>>>     >         > 172.32.63.67:2181
>>>>     >         >
>>>>     >         >
>>>>     >         >
>>>>     >         > When I hit connect I see the following error.Though the
>>>> cluster
>>>>     > is up and
>>>>     >         > running and ZK is also good.
>>>>     >         >
>>>>     >         >
>>>>     >         >
>>>>     >         > *ERROR: An error occurred while trying to make a
>>>> connection to *
>>>>     >         >
>>>>     >         > *the database:  *
>>>>     >         >
>>>>     >         >
>>>>     >         >
>>>>     >         > *JDBC URL: *
>>>>     >         >
>>>>     >         > *jdbc:drill:zk=172.32.63.64:2181
>>>>     >         > <
>>>>     >
>>>> https://urldefense.proofpoint.com/v2/url?u=http-3A__172.32.63.64-3A2181&d=DwIGaQ&c=cskdkSMqhcnjZxdQVpwTXg&r=GXRJhB4g1YFDJsrcglHwUA&m=BJqk_hazvoApEDyas3DwYGI3NAEtSjzIEex2DF5uhHk&s=-X33aklNalfpJDS18b6-wH5bkmY2QWJ4iba8p6pmxn4&e=
>>>>     > >,172.32.63.65:2181
>>>>     >         > <
>>>>     >
>>>> https://urldefense.proofpoint.com/v2/url?u=http-3A__172.32.63.65-3A2181&d=DwIGaQ&c=cskdkSMqhcnjZxdQVpwTXg&r=GXRJhB4g1YFDJsrcglHwUA&m=BJqk_hazvoApEDyas3DwYGI3NAEtSjzIEex2DF5uhHk&s=fHrzLbqH4CpgspWDHoMyOMneXh2YP2HD7frqI4ITiUM&e=
>>>>     > >,172.32.63.67:2181/sidra-drillbit
>>>>     >         > <
>>>>     >
>>>> https://urldefense.proofpoint.com/v2/url?u=http-3A__172.32.63.67-3A2181_sidra-2Ddrillbit&d=DwIGaQ&c=cskdkSMqhcnjZxdQVpwTXg&r=GXRJhB4g1YFDJsrcglHwUA&m=BJqk_hazvoApEDyas3DwYGI3NAEtSjzIEex2DF5uhHk&s=o9EFkEIaCa6F7My4l3JXFfeeZtFJFqytiFAxLxybbg4&e=
>>>> >
>>>>     > *
>>>>     >         >
>>>>     >         >
>>>>     >         >
>>>>     >         > *Failure in connecting to Drill: *
>>>>     >         >
>>>>     >         > *oadd.org.apache.drill.exec.rpc.RpcException: Failure
>>>> setting up
>>>>     > *
>>>>     >         >
>>>>     >         > *ZK for client.*
>>>>     >         >
>>>>     >         >
>>>>     >         >
>>>>     >         >
>>>>     >         >
>>>>     >         >
>>>>     >         >
>>>>     >         > [image: cid:image001.png@01D3B9E9.23323D90]
>>>>     >         >
>>>>     >         > *Tushar Bhalchandra Pathare*
>>>>     >         >
>>>>     >         > Bigdata,GPFS,CSXF – Research Department
>>>>     >         >
>>>>     >         > *t. *+974 4003 7443
>>>>     >         >
>>>>     >         > *m.* +974 74793547
>>>>     >         >
>>>>     >         > PO BOX 26999 Doha, Qatar
>>>>     >         >
>>>>     >         > sidra.org
>>>>     >         > <
>>>>     >
>>>> https://urldefense.proofpoint.com/v2/url?u=http-3A__www.sidra.org_&d=DwMGaQ&c=cskdkSMqhcnjZxdQVpwTXg&r=H5JEl9vb-mBIjic10QAbDD2vkUUKAxjO6wZO322RtdI&m=xCohfm7_vub0ExT6cMTEbB4WbjdIEPLdaXqXAOANq4A&s=kqudpk5v3cRasIbaMG8kwLBXafZ87VEhutJj7vxwhS4&e=
>>>>     > >
>>>>     >         >
>>>>     >         >
>>>>     >         > Disclaimer: This email and its attachments may be
>>>> confidential
>>>>     > and are
>>>>     >         > intended solely for the use of the individual to whom
>>>> it is
>>>>     > addressed. If
>>>>     >         > you are not the intended recipient, any reading,
>>>> printing,
>>>>     > storage,
>>>>     >         > disclosure, copying or any other action taken in
>>>> respect of this
>>>>     > e-mail is
>>>>     >         > prohibited and may be unlawful. If you are not the
>>>> intended
>>>>     > recipient,
>>>>     >         > please notify the sender immediately by using the reply
>>>> function
>>>>     > and then
>>>>     >         > permanently delete what you have received. Any views or
>>>> opinions
>>>>     > expressed
>>>>     >         > are solely those of the author and do not necessarily
>>>> represent
>>>>     > those of
>>>>     >         > Sidra Medical and Research Center.
>>>>     >         >
>>>>     >
>>>>     >
>>>>     >     Disclaimer: This email and its attachments may be
>>>> confidential and are
>>>>     > intended solely for the use of the individual to whom it is
>>>> addressed. If
>>>>     > you are not the intended recipient, any reading, printing,
>>>> storage,
>>>>     > disclosure, copying or any other action taken in respect of this
>>>> e-mail is
>>>>     > prohibited and may be unlawful. If you are not the intended
>>>> recipient,
>>>>     > please notify the sender immediately by using the reply function
>>>> and then
>>>>     > permanently delete what you have received. Any views or opinions
>>>> expressed
>>>>     > are solely those of the author and do not necessarily represent
>>>> those of
>>>>     > Sidra Medical and Research Center.
>>>>     >
>>>>     >
>>>>     > Disclaimer: This email and its attachments may be confidential
>>>> and are
>>>>     > intended solely for the use of the individual to whom it is
>>>> addressed. If
>>>>     > you are not the intended recipient, any reading, printing,
>>>> storage,
>>>>     > disclosure, copying or any other action taken in respect of this
>>>> e-mail is
>>>>     > prohibited and may be unlawful. If you are not the intended
>>>> recipient,
>>>>     > please notify the sender immediately by using the reply function
>>>> and then
>>>>     > permanently delete what you have received. Any views or opinions
>>>> expressed
>>>>     > are solely those of the author and do not necessarily represent
>>>> those of
>>>>     > Sidra Medical and Research Center.
>>>>     >
>>>>
>>>>
>>>> Disclaimer: This email and its attachments may be confidential and are
>>>> intended solely for the use of the individual to whom it is addressed. If
>>>> you are not the intended recipient, any reading, printing, storage,
>>>> disclosure, copying or any other action taken in respect of this e-mail is
>>>> prohibited and may be unlawful. If you are not the intended recipient,
>>>> please notify the sender immediately by using the reply function and then
>>>> permanently delete what you have received. Any views or opinions expressed
>>>> are solely those of the author and do not necessarily represent those of
>>>> Sidra Medical and Research Center.
>>>>
>>>

Re: Drill connection using jdbc

Posted by Robert Hou <rh...@mapr.com>.
I added zk.root to my drill-override.conf and it showed up in zookeeper,
and I can connect to the new zk.root.  Since you don't have zk.root, then
you should use "drill" in your connection URL.

Thanks.

--Robert

On Wed, Jan 9, 2019 at 1:08 AM Robert Hou <rh...@mapr.com> wrote:

> When you run "ls /" in zookeeper, you should see something like this:
>
>    [zookeeper, resourcemanager_locks, services, drill, servers, nodes]
>
> I believe this is where your zk.root is defined.  So in my case, it is
> "drill" which is the default.
>
> Thanks.
>
> --Robert
>
> On Wed, Jan 9, 2019 at 1:03 AM Robert Hou <rh...@mapr.com> wrote:
>
>> Can you try "drill" as your zk.root?
>>
>> What do you see when you log into zookeeper and run "ls /"?
>>
>> Thanks.
>>
>> --Robert
>>
>> On Wed, Jan 9, 2019 at 12:45 AM Tushar Pathare <tp...@sidra.org>
>> wrote:
>>
>>> Hello Robert,
>>>                        Thanks for the info.
>>>                        Drillbit connection worked but zk connection not
>>> working.
>>>                        Zk.root for me is /opt/drill and clusterid is
>>> sidra-drillbit.
>>>
>>> My drill-override.conf looks as follows.
>>>
>>> drill.exec: {
>>>   cluster-id: "sidra-drillbit",
>>>   zk.connect: "hpcsrcn01:2181,hpcsrcn02:2181,hpcsrcn04:2181"
>>> }
>>>
>>>
>>>
>>> Tushar Bhalchandra Pathare
>>> Bigdata,GPFS,CSXF – Research Department
>>> t. +974 4003 7443
>>> m. +974 74793547
>>> PO BOX 26999 Doha, Qatar
>>> sidra.org <
>>> https://urldefense.proofpoint.com/v2/url?u=http-3A__www.sidra.org_&d=DwIGaQ&c=cskdkSMqhcnjZxdQVpwTXg&r=GXRJhB4g1YFDJsrcglHwUA&m=GzXrG3NEgyu3DwC61SjSD5gw0TYMT4GGi_jOLjSGttY&s=3IKZg-nDhsGJG70FdwBMabw_o0GCo_vADXVODbny7T8&e=
>>> >
>>>
>>>
>>> On 1/9/19, 11:34 AM, "Robert Hou" <rh...@mapr.com> wrote:
>>>
>>>     I would suggest connecting with drillbit first, and if that works, I
>>> would
>>>     use zookeeper.
>>>
>>>        sqlline -u "jdbc:drill:drillbit=<IP address>"
>>>
>>>     Please note the quotation marks.
>>>
>>>     If that works, then try:
>>>
>>>        sqlline -u "jdbc:drill:zk=<IPaddress>:port/<zk.root for
>>>     drill>/<clusterID>"
>>>
>>>     zk.root is "drill" by default.  If you have specified zk.root in
>>>     drill-override.conf, then use that.
>>>
>>>     Thanks.
>>>
>>>     --Robert
>>>
>>>
>>>     On Wed, Jan 9, 2019 at 12:13 AM Tushar Pathare <tp...@sidra.org>
>>> wrote:
>>>
>>>     > Hello Team,
>>>     > Same issue.
>>>     >
>>>     >
>>>     > ERROR: An error occurred while trying to make a connection to
>>>     > the database:
>>>     >
>>>     > JDBC URL:
>>>     > jdbc:drill:zk=172.32.63.64:2181/opt/apache-drill/sidra-drillbit
>>>     >
>>>     > Failure in creating DrillConnectionImpl:
>>>     > java.lang.IllegalStateException: No active Drillbit endpoint
>>>     > found from ZooKeeper. Check connection parameters?
>>>     >
>>>     >
>>>     > Tushar Bhalchandra Pathare
>>>     > Bigdata,GPFS,CSXF – Research Department
>>>     > t. +974 4003 7443
>>>     > m. +974 74793547
>>>     > PO BOX 26999 Doha, Qatar
>>>     > sidra.org <
>>>     >
>>> https://urldefense.proofpoint.com/v2/url?u=http-3A__www.sidra.org_&d=DwIGaQ&c=cskdkSMqhcnjZxdQVpwTXg&r=GXRJhB4g1YFDJsrcglHwUA&m=BJqk_hazvoApEDyas3DwYGI3NAEtSjzIEex2DF5uhHk&s=9M5Aak1SIn-KuFJWfpDiUyALzAKZWCwQUnD_m-SQvtA&e=
>>>     > >
>>>     >
>>>     >
>>>     > On 1/9/19, 11:02 AM, "Arjun kr" <ar...@outlook.com> wrote:
>>>     >
>>>     >     Yes. I believe its a necessary parameter if non default
>>> cluster I'd is
>>>     > used and given in the connection url. You can check if it works
>>> with
>>>     > directory specified.
>>>     >
>>>     >     Get Outlook for Android<
>>>     >
>>> https://urldefense.proofpoint.com/v2/url?u=https-3A__aka.ms_ghei36&d=DwIGaQ&c=cskdkSMqhcnjZxdQVpwTXg&r=GXRJhB4g1YFDJsrcglHwUA&m=BJqk_hazvoApEDyas3DwYGI3NAEtSjzIEex2DF5uhHk&s=Pq7kuN1t4H6e-BdtFBP7VVnFqhNMVVXBHX8qIQMq9B0&e=
>>>     > >
>>>     >
>>>     >     ________________________________
>>>     >     From: Tushar Pathare <tp...@sidra.org>
>>>     >     Sent: Tuesday, January 8, 2019 11:40:22 PM
>>>     >     To: user@drill.apache.org
>>>     >     Subject: Re: Drill connection using jdbc
>>>     >
>>>     >     Is it necessary because I thought it is optional including the
>>> cluster
>>>     > ID
>>>     >
>>>     >
>>>     >     Tushar Bhalchandra Pathare
>>>     >     Bigdata,GPFS,CSXF – Research Department
>>>     >     t. +974 4003 7443
>>>     >     m. +974 74793547
>>>     >     PO BOX 26999 Doha, Qatar
>>>     >     sidra.org <
>>>     >
>>> https://urldefense.proofpoint.com/v2/url?u=http-3A__www.sidra.org_&d=DwIGaQ&c=cskdkSMqhcnjZxdQVpwTXg&r=GXRJhB4g1YFDJsrcglHwUA&m=BJqk_hazvoApEDyas3DwYGI3NAEtSjzIEex2DF5uhHk&s=9M5Aak1SIn-KuFJWfpDiUyALzAKZWCwQUnD_m-SQvtA&e=
>>>     > >
>>>     >
>>>     >
>>>     >     On 1/9/19, 10:39 AM, "Arjun kr" <ar...@outlook.com> wrote:
>>>     >
>>>     >         Are you missing drill zk directory in connection url?
>>>     >         By default, it's value is drill.
>>>     >
>>>     >         jdbc:drill:zk=<zk name>[:<port>][,<zk name2>[:<port>]...
>>>     >         <directory>/<cluster ID>;[schema=<storage plugin>]
>>>     >
>>>     >
>>>     >
>>>     >
>>> https://urldefense.proofpoint.com/v2/url?u=https-3A__drill.apache.org_docs_using-2Dthe-2D&d=DwIGaQ&c=cskdkSMqhcnjZxdQVpwTXg&r=GXRJhB4g1YFDJsrcglHwUA&m=BJqk_hazvoApEDyas3DwYGI3NAEtSjzIEex2DF5uhHk&s=OkoCdG1xe3BPsJ45-qJ9Z7ewXUUgGpz3w54SuZXNr9U&e=
>>>     > <
>>>     >
>>> https://urldefense.proofpoint.com/v2/url?u=https-3A__drill.apache.org_docs_using-2Dthe-2Djdbc-2Ddriver_&d=DwIGaQ&c=cskdkSMqhcnjZxdQVpwTXg&r=GXRJhB4g1YFDJsrcglHwUA&m=BJqk_hazvoApEDyas3DwYGI3NAEtSjzIEex2DF5uhHk&s=YuYqrYaD7-X633jjZFcolbBVC82m74rKASSB0u87LTo&e=
>>>     > >jdbc<
>>>     >
>>> https://urldefense.proofpoint.com/v2/url?u=https-3A__drill.apache.org_docs_using-2Dthe-2Djdbc-2Ddriver_&d=DwIGaQ&c=cskdkSMqhcnjZxdQVpwTXg&r=GXRJhB4g1YFDJsrcglHwUA&m=BJqk_hazvoApEDyas3DwYGI3NAEtSjzIEex2DF5uhHk&s=YuYqrYaD7-X633jjZFcolbBVC82m74rKASSB0u87LTo&e=
>>>     > >-driver/<
>>>     >
>>> https://urldefense.proofpoint.com/v2/url?u=https-3A__drill.apache.org_docs_using-2Dthe-2Djdbc-2Ddriver_&d=DwIGaQ&c=cskdkSMqhcnjZxdQVpwTXg&r=GXRJhB4g1YFDJsrcglHwUA&m=BJqk_hazvoApEDyas3DwYGI3NAEtSjzIEex2DF5uhHk&s=YuYqrYaD7-X633jjZFcolbBVC82m74rKASSB0u87LTo&e=
>>>     > >
>>>     >
>>>     >         Thanks,
>>>     >
>>>     >         Arjun
>>>     >
>>>     >         Get Outlook for Android<
>>>     >
>>> https://urldefense.proofpoint.com/v2/url?u=https-3A__aka.ms_ghei36&d=DwIGaQ&c=cskdkSMqhcnjZxdQVpwTXg&r=GXRJhB4g1YFDJsrcglHwUA&m=BJqk_hazvoApEDyas3DwYGI3NAEtSjzIEex2DF5uhHk&s=Pq7kuN1t4H6e-BdtFBP7VVnFqhNMVVXBHX8qIQMq9B0&e=
>>>     > >
>>>     >
>>>     >         ________________________________
>>>     >         From: Khurram Faraaz <kf...@mapr.com>
>>>     >         Sent: Tuesday, January 8, 2019 11:17:58 PM
>>>     >         To: user@drill.apache.org
>>>     >         Subject: Re: Drill connection using jdbc
>>>     >
>>>     >         Hi Tushar,
>>>     >
>>>     >         This example works just fine for me, you may want to use
>>> the
>>>     > template
>>>     >
>>>     >         import org.apache.log4j.Logger;
>>>     >
>>>     >         import java.sql.Connection;
>>>     >         import java.sql.ResultSet;
>>>     >         import java.sql.SQLException;
>>>     >         import java.sql.Statement;
>>>     >         import java.sql.Types;
>>>     >         import java.sql.*;
>>>     >         import java.io.*;
>>>     >         import java.lang.*;
>>>     >         import java.util.*;
>>>     >         import java.util.Scanner;
>>>     >
>>>     >         public class TestQuery {
>>>     >
>>>     >         public static void main(String s[]) throws Exception {
>>>     >
>>>     >             Connection conn = null;
>>>     >             PreparedStatement prdstmnt = null;
>>>     >             try {
>>>     >                     // Please replace test1302-145 with your
>>> hostname,
>>>     > name of host
>>>     >         where Drillbit is up and running
>>>     >                     final String URL_STRING =
>>>     >         "jdbc:drill:schema=dfs.tmp;drillbit=test1302-145";
>>>     >
>>>     > Class.forName("org.apache.drill.jdbc.Driver").newInstance();
>>>     >
>>>     >                     // Please replace username and password with
>>> your
>>>     > username and
>>>     >         password
>>>     >                     conn =
>>>     > DriverManager.getConnection(URL_STRING,"mapr","mapr");
>>>     >                     prdstmnt = conn.prepareStatement("SELECT * FROM
>>>     >         cp.`employee.json`");
>>>     >                     prdstmnt.executeQuery();
>>>     >                     prdstmnt.close();
>>>     >             } catch (Exception e) {
>>>     >                System.out.println(e.getMessage());
>>>     >                e.printStackTrace();
>>>     >             } finally {
>>>     >                 if(conn != null)
>>>     >                     try { conn.close(); } catch(SQLException
>>> sqlexcpn){
>>>     >         sqlexcpn.printStackTrace(); }
>>>     >                 if(prdstmnt != null)
>>>     >                     try { prdstmnt.close(); } catch(SQLException
>>> sqlexcpn){
>>>     >         sqlexcpn.printStackTrace(); }
>>>     >                 }
>>>     >             }
>>>     >         }
>>>     >
>>>     >         Regards,
>>>     >         Khurram
>>>     >
>>>     >         On Tue, Jan 8, 2019 at 11:10 PM Tushar Pathare <
>>> tpathare@sidra.org>
>>>     > wrote:
>>>     >
>>>     >         > Hello Team,
>>>     >         >
>>>     >         >                     We have installed drill 1.12.0 and
>>> trying to
>>>     > connect
>>>     >         > using a client to the drill cluster
>>>     >         >
>>>     >         > Our config for connection is
>>>     >         >
>>>     >         >
>>>     >         >
>>>     >         > Drill class is : org.apache.drill.jdbc.Driver
>>>     >         >
>>>     >         > Driver location is
>>>     >         >
>>>     >
>>> /Users/tpathare/Downloads/apache-drill-1.12.0/jars/jdbc-driver/drill-jdbc-all-1.12.0.jar
>>>     >         >
>>>     >         > Jdbc url is : jdbc:drill:zk=172.32.63.64:2181,
>>> 172.32.63.65:2181,
>>>     >         > 172.32.63.67:2181
>>>     >         >
>>>     >         >
>>>     >         >
>>>     >         > When I hit connect I see the following error.Though the
>>> cluster
>>>     > is up and
>>>     >         > running and ZK is also good.
>>>     >         >
>>>     >         >
>>>     >         >
>>>     >         > *ERROR: An error occurred while trying to make a
>>> connection to *
>>>     >         >
>>>     >         > *the database:  *
>>>     >         >
>>>     >         >
>>>     >         >
>>>     >         > *JDBC URL: *
>>>     >         >
>>>     >         > *jdbc:drill:zk=172.32.63.64:2181
>>>     >         > <
>>>     >
>>> https://urldefense.proofpoint.com/v2/url?u=http-3A__172.32.63.64-3A2181&d=DwIGaQ&c=cskdkSMqhcnjZxdQVpwTXg&r=GXRJhB4g1YFDJsrcglHwUA&m=BJqk_hazvoApEDyas3DwYGI3NAEtSjzIEex2DF5uhHk&s=-X33aklNalfpJDS18b6-wH5bkmY2QWJ4iba8p6pmxn4&e=
>>>     > >,172.32.63.65:2181
>>>     >         > <
>>>     >
>>> https://urldefense.proofpoint.com/v2/url?u=http-3A__172.32.63.65-3A2181&d=DwIGaQ&c=cskdkSMqhcnjZxdQVpwTXg&r=GXRJhB4g1YFDJsrcglHwUA&m=BJqk_hazvoApEDyas3DwYGI3NAEtSjzIEex2DF5uhHk&s=fHrzLbqH4CpgspWDHoMyOMneXh2YP2HD7frqI4ITiUM&e=
>>>     > >,172.32.63.67:2181/sidra-drillbit
>>>     >         > <
>>>     >
>>> https://urldefense.proofpoint.com/v2/url?u=http-3A__172.32.63.67-3A2181_sidra-2Ddrillbit&d=DwIGaQ&c=cskdkSMqhcnjZxdQVpwTXg&r=GXRJhB4g1YFDJsrcglHwUA&m=BJqk_hazvoApEDyas3DwYGI3NAEtSjzIEex2DF5uhHk&s=o9EFkEIaCa6F7My4l3JXFfeeZtFJFqytiFAxLxybbg4&e=
>>> >
>>>     > *
>>>     >         >
>>>     >         >
>>>     >         >
>>>     >         > *Failure in connecting to Drill: *
>>>     >         >
>>>     >         > *oadd.org.apache.drill.exec.rpc.RpcException: Failure
>>> setting up
>>>     > *
>>>     >         >
>>>     >         > *ZK for client.*
>>>     >         >
>>>     >         >
>>>     >         >
>>>     >         >
>>>     >         >
>>>     >         >
>>>     >         >
>>>     >         > [image: cid:image001.png@01D3B9E9.23323D90]
>>>     >         >
>>>     >         > *Tushar Bhalchandra Pathare*
>>>     >         >
>>>     >         > Bigdata,GPFS,CSXF – Research Department
>>>     >         >
>>>     >         > *t. *+974 4003 7443
>>>     >         >
>>>     >         > *m.* +974 74793547
>>>     >         >
>>>     >         > PO BOX 26999 Doha, Qatar
>>>     >         >
>>>     >         > sidra.org
>>>     >         > <
>>>     >
>>> https://urldefense.proofpoint.com/v2/url?u=http-3A__www.sidra.org_&d=DwMGaQ&c=cskdkSMqhcnjZxdQVpwTXg&r=H5JEl9vb-mBIjic10QAbDD2vkUUKAxjO6wZO322RtdI&m=xCohfm7_vub0ExT6cMTEbB4WbjdIEPLdaXqXAOANq4A&s=kqudpk5v3cRasIbaMG8kwLBXafZ87VEhutJj7vxwhS4&e=
>>>     > >
>>>     >         >
>>>     >         >
>>>     >         > Disclaimer: This email and its attachments may be
>>> confidential
>>>     > and are
>>>     >         > intended solely for the use of the individual to whom it
>>> is
>>>     > addressed. If
>>>     >         > you are not the intended recipient, any reading,
>>> printing,
>>>     > storage,
>>>     >         > disclosure, copying or any other action taken in respect
>>> of this
>>>     > e-mail is
>>>     >         > prohibited and may be unlawful. If you are not the
>>> intended
>>>     > recipient,
>>>     >         > please notify the sender immediately by using the reply
>>> function
>>>     > and then
>>>     >         > permanently delete what you have received. Any views or
>>> opinions
>>>     > expressed
>>>     >         > are solely those of the author and do not necessarily
>>> represent
>>>     > those of
>>>     >         > Sidra Medical and Research Center.
>>>     >         >
>>>     >
>>>     >
>>>     >     Disclaimer: This email and its attachments may be confidential
>>> and are
>>>     > intended solely for the use of the individual to whom it is
>>> addressed. If
>>>     > you are not the intended recipient, any reading, printing, storage,
>>>     > disclosure, copying or any other action taken in respect of this
>>> e-mail is
>>>     > prohibited and may be unlawful. If you are not the intended
>>> recipient,
>>>     > please notify the sender immediately by using the reply function
>>> and then
>>>     > permanently delete what you have received. Any views or opinions
>>> expressed
>>>     > are solely those of the author and do not necessarily represent
>>> those of
>>>     > Sidra Medical and Research Center.
>>>     >
>>>     >
>>>     > Disclaimer: This email and its attachments may be confidential and
>>> are
>>>     > intended solely for the use of the individual to whom it is
>>> addressed. If
>>>     > you are not the intended recipient, any reading, printing, storage,
>>>     > disclosure, copying or any other action taken in respect of this
>>> e-mail is
>>>     > prohibited and may be unlawful. If you are not the intended
>>> recipient,
>>>     > please notify the sender immediately by using the reply function
>>> and then
>>>     > permanently delete what you have received. Any views or opinions
>>> expressed
>>>     > are solely those of the author and do not necessarily represent
>>> those of
>>>     > Sidra Medical and Research Center.
>>>     >
>>>
>>>
>>> Disclaimer: This email and its attachments may be confidential and are
>>> intended solely for the use of the individual to whom it is addressed. If
>>> you are not the intended recipient, any reading, printing, storage,
>>> disclosure, copying or any other action taken in respect of this e-mail is
>>> prohibited and may be unlawful. If you are not the intended recipient,
>>> please notify the sender immediately by using the reply function and then
>>> permanently delete what you have received. Any views or opinions expressed
>>> are solely those of the author and do not necessarily represent those of
>>> Sidra Medical and Research Center.
>>>
>>

Re: Drill connection using jdbc

Posted by Robert Hou <rh...@mapr.com>.
When you run "ls /" in zookeeper, you should see something like this:

   [zookeeper, resourcemanager_locks, services, drill, servers, nodes]

I believe this is where your zk.root is defined.  So in my case, it is
"drill" which is the default.

Thanks.

--Robert

On Wed, Jan 9, 2019 at 1:03 AM Robert Hou <rh...@mapr.com> wrote:

> Can you try "drill" as your zk.root?
>
> What do you see when you log into zookeeper and run "ls /"?
>
> Thanks.
>
> --Robert
>
> On Wed, Jan 9, 2019 at 12:45 AM Tushar Pathare <tp...@sidra.org> wrote:
>
>> Hello Robert,
>>                        Thanks for the info.
>>                        Drillbit connection worked but zk connection not
>> working.
>>                        Zk.root for me is /opt/drill and clusterid is
>> sidra-drillbit.
>>
>> My drill-override.conf looks as follows.
>>
>> drill.exec: {
>>   cluster-id: "sidra-drillbit",
>>   zk.connect: "hpcsrcn01:2181,hpcsrcn02:2181,hpcsrcn04:2181"
>> }
>>
>>
>>
>> Tushar Bhalchandra Pathare
>> Bigdata,GPFS,CSXF – Research Department
>> t. +974 4003 7443
>> m. +974 74793547
>> PO BOX 26999 Doha, Qatar
>> sidra.org <
>> https://urldefense.proofpoint.com/v2/url?u=http-3A__www.sidra.org_&d=DwIGaQ&c=cskdkSMqhcnjZxdQVpwTXg&r=GXRJhB4g1YFDJsrcglHwUA&m=GzXrG3NEgyu3DwC61SjSD5gw0TYMT4GGi_jOLjSGttY&s=3IKZg-nDhsGJG70FdwBMabw_o0GCo_vADXVODbny7T8&e=
>> >
>>
>>
>> On 1/9/19, 11:34 AM, "Robert Hou" <rh...@mapr.com> wrote:
>>
>>     I would suggest connecting with drillbit first, and if that works, I
>> would
>>     use zookeeper.
>>
>>        sqlline -u "jdbc:drill:drillbit=<IP address>"
>>
>>     Please note the quotation marks.
>>
>>     If that works, then try:
>>
>>        sqlline -u "jdbc:drill:zk=<IPaddress>:port/<zk.root for
>>     drill>/<clusterID>"
>>
>>     zk.root is "drill" by default.  If you have specified zk.root in
>>     drill-override.conf, then use that.
>>
>>     Thanks.
>>
>>     --Robert
>>
>>
>>     On Wed, Jan 9, 2019 at 12:13 AM Tushar Pathare <tp...@sidra.org>
>> wrote:
>>
>>     > Hello Team,
>>     > Same issue.
>>     >
>>     >
>>     > ERROR: An error occurred while trying to make a connection to
>>     > the database:
>>     >
>>     > JDBC URL:
>>     > jdbc:drill:zk=172.32.63.64:2181/opt/apache-drill/sidra-drillbit
>>     >
>>     > Failure in creating DrillConnectionImpl:
>>     > java.lang.IllegalStateException: No active Drillbit endpoint
>>     > found from ZooKeeper. Check connection parameters?
>>     >
>>     >
>>     > Tushar Bhalchandra Pathare
>>     > Bigdata,GPFS,CSXF – Research Department
>>     > t. +974 4003 7443
>>     > m. +974 74793547
>>     > PO BOX 26999 Doha, Qatar
>>     > sidra.org <
>>     >
>> https://urldefense.proofpoint.com/v2/url?u=http-3A__www.sidra.org_&d=DwIGaQ&c=cskdkSMqhcnjZxdQVpwTXg&r=GXRJhB4g1YFDJsrcglHwUA&m=BJqk_hazvoApEDyas3DwYGI3NAEtSjzIEex2DF5uhHk&s=9M5Aak1SIn-KuFJWfpDiUyALzAKZWCwQUnD_m-SQvtA&e=
>>     > >
>>     >
>>     >
>>     > On 1/9/19, 11:02 AM, "Arjun kr" <ar...@outlook.com> wrote:
>>     >
>>     >     Yes. I believe its a necessary parameter if non default cluster
>> I'd is
>>     > used and given in the connection url. You can check if it works with
>>     > directory specified.
>>     >
>>     >     Get Outlook for Android<
>>     >
>> https://urldefense.proofpoint.com/v2/url?u=https-3A__aka.ms_ghei36&d=DwIGaQ&c=cskdkSMqhcnjZxdQVpwTXg&r=GXRJhB4g1YFDJsrcglHwUA&m=BJqk_hazvoApEDyas3DwYGI3NAEtSjzIEex2DF5uhHk&s=Pq7kuN1t4H6e-BdtFBP7VVnFqhNMVVXBHX8qIQMq9B0&e=
>>     > >
>>     >
>>     >     ________________________________
>>     >     From: Tushar Pathare <tp...@sidra.org>
>>     >     Sent: Tuesday, January 8, 2019 11:40:22 PM
>>     >     To: user@drill.apache.org
>>     >     Subject: Re: Drill connection using jdbc
>>     >
>>     >     Is it necessary because I thought it is optional including the
>> cluster
>>     > ID
>>     >
>>     >
>>     >     Tushar Bhalchandra Pathare
>>     >     Bigdata,GPFS,CSXF – Research Department
>>     >     t. +974 4003 7443
>>     >     m. +974 74793547
>>     >     PO BOX 26999 Doha, Qatar
>>     >     sidra.org <
>>     >
>> https://urldefense.proofpoint.com/v2/url?u=http-3A__www.sidra.org_&d=DwIGaQ&c=cskdkSMqhcnjZxdQVpwTXg&r=GXRJhB4g1YFDJsrcglHwUA&m=BJqk_hazvoApEDyas3DwYGI3NAEtSjzIEex2DF5uhHk&s=9M5Aak1SIn-KuFJWfpDiUyALzAKZWCwQUnD_m-SQvtA&e=
>>     > >
>>     >
>>     >
>>     >     On 1/9/19, 10:39 AM, "Arjun kr" <ar...@outlook.com> wrote:
>>     >
>>     >         Are you missing drill zk directory in connection url?
>>     >         By default, it's value is drill.
>>     >
>>     >         jdbc:drill:zk=<zk name>[:<port>][,<zk name2>[:<port>]...
>>     >         <directory>/<cluster ID>;[schema=<storage plugin>]
>>     >
>>     >
>>     >
>>     >
>> https://urldefense.proofpoint.com/v2/url?u=https-3A__drill.apache.org_docs_using-2Dthe-2D&d=DwIGaQ&c=cskdkSMqhcnjZxdQVpwTXg&r=GXRJhB4g1YFDJsrcglHwUA&m=BJqk_hazvoApEDyas3DwYGI3NAEtSjzIEex2DF5uhHk&s=OkoCdG1xe3BPsJ45-qJ9Z7ewXUUgGpz3w54SuZXNr9U&e=
>>     > <
>>     >
>> https://urldefense.proofpoint.com/v2/url?u=https-3A__drill.apache.org_docs_using-2Dthe-2Djdbc-2Ddriver_&d=DwIGaQ&c=cskdkSMqhcnjZxdQVpwTXg&r=GXRJhB4g1YFDJsrcglHwUA&m=BJqk_hazvoApEDyas3DwYGI3NAEtSjzIEex2DF5uhHk&s=YuYqrYaD7-X633jjZFcolbBVC82m74rKASSB0u87LTo&e=
>>     > >jdbc<
>>     >
>> https://urldefense.proofpoint.com/v2/url?u=https-3A__drill.apache.org_docs_using-2Dthe-2Djdbc-2Ddriver_&d=DwIGaQ&c=cskdkSMqhcnjZxdQVpwTXg&r=GXRJhB4g1YFDJsrcglHwUA&m=BJqk_hazvoApEDyas3DwYGI3NAEtSjzIEex2DF5uhHk&s=YuYqrYaD7-X633jjZFcolbBVC82m74rKASSB0u87LTo&e=
>>     > >-driver/<
>>     >
>> https://urldefense.proofpoint.com/v2/url?u=https-3A__drill.apache.org_docs_using-2Dthe-2Djdbc-2Ddriver_&d=DwIGaQ&c=cskdkSMqhcnjZxdQVpwTXg&r=GXRJhB4g1YFDJsrcglHwUA&m=BJqk_hazvoApEDyas3DwYGI3NAEtSjzIEex2DF5uhHk&s=YuYqrYaD7-X633jjZFcolbBVC82m74rKASSB0u87LTo&e=
>>     > >
>>     >
>>     >         Thanks,
>>     >
>>     >         Arjun
>>     >
>>     >         Get Outlook for Android<
>>     >
>> https://urldefense.proofpoint.com/v2/url?u=https-3A__aka.ms_ghei36&d=DwIGaQ&c=cskdkSMqhcnjZxdQVpwTXg&r=GXRJhB4g1YFDJsrcglHwUA&m=BJqk_hazvoApEDyas3DwYGI3NAEtSjzIEex2DF5uhHk&s=Pq7kuN1t4H6e-BdtFBP7VVnFqhNMVVXBHX8qIQMq9B0&e=
>>     > >
>>     >
>>     >         ________________________________
>>     >         From: Khurram Faraaz <kf...@mapr.com>
>>     >         Sent: Tuesday, January 8, 2019 11:17:58 PM
>>     >         To: user@drill.apache.org
>>     >         Subject: Re: Drill connection using jdbc
>>     >
>>     >         Hi Tushar,
>>     >
>>     >         This example works just fine for me, you may want to use the
>>     > template
>>     >
>>     >         import org.apache.log4j.Logger;
>>     >
>>     >         import java.sql.Connection;
>>     >         import java.sql.ResultSet;
>>     >         import java.sql.SQLException;
>>     >         import java.sql.Statement;
>>     >         import java.sql.Types;
>>     >         import java.sql.*;
>>     >         import java.io.*;
>>     >         import java.lang.*;
>>     >         import java.util.*;
>>     >         import java.util.Scanner;
>>     >
>>     >         public class TestQuery {
>>     >
>>     >         public static void main(String s[]) throws Exception {
>>     >
>>     >             Connection conn = null;
>>     >             PreparedStatement prdstmnt = null;
>>     >             try {
>>     >                     // Please replace test1302-145 with your
>> hostname,
>>     > name of host
>>     >         where Drillbit is up and running
>>     >                     final String URL_STRING =
>>     >         "jdbc:drill:schema=dfs.tmp;drillbit=test1302-145";
>>     >
>>     > Class.forName("org.apache.drill.jdbc.Driver").newInstance();
>>     >
>>     >                     // Please replace username and password with
>> your
>>     > username and
>>     >         password
>>     >                     conn =
>>     > DriverManager.getConnection(URL_STRING,"mapr","mapr");
>>     >                     prdstmnt = conn.prepareStatement("SELECT * FROM
>>     >         cp.`employee.json`");
>>     >                     prdstmnt.executeQuery();
>>     >                     prdstmnt.close();
>>     >             } catch (Exception e) {
>>     >                System.out.println(e.getMessage());
>>     >                e.printStackTrace();
>>     >             } finally {
>>     >                 if(conn != null)
>>     >                     try { conn.close(); } catch(SQLException
>> sqlexcpn){
>>     >         sqlexcpn.printStackTrace(); }
>>     >                 if(prdstmnt != null)
>>     >                     try { prdstmnt.close(); } catch(SQLException
>> sqlexcpn){
>>     >         sqlexcpn.printStackTrace(); }
>>     >                 }
>>     >             }
>>     >         }
>>     >
>>     >         Regards,
>>     >         Khurram
>>     >
>>     >         On Tue, Jan 8, 2019 at 11:10 PM Tushar Pathare <
>> tpathare@sidra.org>
>>     > wrote:
>>     >
>>     >         > Hello Team,
>>     >         >
>>     >         >                     We have installed drill 1.12.0 and
>> trying to
>>     > connect
>>     >         > using a client to the drill cluster
>>     >         >
>>     >         > Our config for connection is
>>     >         >
>>     >         >
>>     >         >
>>     >         > Drill class is : org.apache.drill.jdbc.Driver
>>     >         >
>>     >         > Driver location is
>>     >         >
>>     >
>> /Users/tpathare/Downloads/apache-drill-1.12.0/jars/jdbc-driver/drill-jdbc-all-1.12.0.jar
>>     >         >
>>     >         > Jdbc url is : jdbc:drill:zk=172.32.63.64:2181,
>> 172.32.63.65:2181,
>>     >         > 172.32.63.67:2181
>>     >         >
>>     >         >
>>     >         >
>>     >         > When I hit connect I see the following error.Though the
>> cluster
>>     > is up and
>>     >         > running and ZK is also good.
>>     >         >
>>     >         >
>>     >         >
>>     >         > *ERROR: An error occurred while trying to make a
>> connection to *
>>     >         >
>>     >         > *the database:  *
>>     >         >
>>     >         >
>>     >         >
>>     >         > *JDBC URL: *
>>     >         >
>>     >         > *jdbc:drill:zk=172.32.63.64:2181
>>     >         > <
>>     >
>> https://urldefense.proofpoint.com/v2/url?u=http-3A__172.32.63.64-3A2181&d=DwIGaQ&c=cskdkSMqhcnjZxdQVpwTXg&r=GXRJhB4g1YFDJsrcglHwUA&m=BJqk_hazvoApEDyas3DwYGI3NAEtSjzIEex2DF5uhHk&s=-X33aklNalfpJDS18b6-wH5bkmY2QWJ4iba8p6pmxn4&e=
>>     > >,172.32.63.65:2181
>>     >         > <
>>     >
>> https://urldefense.proofpoint.com/v2/url?u=http-3A__172.32.63.65-3A2181&d=DwIGaQ&c=cskdkSMqhcnjZxdQVpwTXg&r=GXRJhB4g1YFDJsrcglHwUA&m=BJqk_hazvoApEDyas3DwYGI3NAEtSjzIEex2DF5uhHk&s=fHrzLbqH4CpgspWDHoMyOMneXh2YP2HD7frqI4ITiUM&e=
>>     > >,172.32.63.67:2181/sidra-drillbit
>>     >         > <
>>     >
>> https://urldefense.proofpoint.com/v2/url?u=http-3A__172.32.63.67-3A2181_sidra-2Ddrillbit&d=DwIGaQ&c=cskdkSMqhcnjZxdQVpwTXg&r=GXRJhB4g1YFDJsrcglHwUA&m=BJqk_hazvoApEDyas3DwYGI3NAEtSjzIEex2DF5uhHk&s=o9EFkEIaCa6F7My4l3JXFfeeZtFJFqytiFAxLxybbg4&e=
>> >
>>     > *
>>     >         >
>>     >         >
>>     >         >
>>     >         > *Failure in connecting to Drill: *
>>     >         >
>>     >         > *oadd.org.apache.drill.exec.rpc.RpcException: Failure
>> setting up
>>     > *
>>     >         >
>>     >         > *ZK for client.*
>>     >         >
>>     >         >
>>     >         >
>>     >         >
>>     >         >
>>     >         >
>>     >         >
>>     >         > [image: cid:image001.png@01D3B9E9.23323D90]
>>     >         >
>>     >         > *Tushar Bhalchandra Pathare*
>>     >         >
>>     >         > Bigdata,GPFS,CSXF – Research Department
>>     >         >
>>     >         > *t. *+974 4003 7443
>>     >         >
>>     >         > *m.* +974 74793547
>>     >         >
>>     >         > PO BOX 26999 Doha, Qatar
>>     >         >
>>     >         > sidra.org
>>     >         > <
>>     >
>> https://urldefense.proofpoint.com/v2/url?u=http-3A__www.sidra.org_&d=DwMGaQ&c=cskdkSMqhcnjZxdQVpwTXg&r=H5JEl9vb-mBIjic10QAbDD2vkUUKAxjO6wZO322RtdI&m=xCohfm7_vub0ExT6cMTEbB4WbjdIEPLdaXqXAOANq4A&s=kqudpk5v3cRasIbaMG8kwLBXafZ87VEhutJj7vxwhS4&e=
>>     > >
>>     >         >
>>     >         >
>>     >         > Disclaimer: This email and its attachments may be
>> confidential
>>     > and are
>>     >         > intended solely for the use of the individual to whom it
>> is
>>     > addressed. If
>>     >         > you are not the intended recipient, any reading, printing,
>>     > storage,
>>     >         > disclosure, copying or any other action taken in respect
>> of this
>>     > e-mail is
>>     >         > prohibited and may be unlawful. If you are not the
>> intended
>>     > recipient,
>>     >         > please notify the sender immediately by using the reply
>> function
>>     > and then
>>     >         > permanently delete what you have received. Any views or
>> opinions
>>     > expressed
>>     >         > are solely those of the author and do not necessarily
>> represent
>>     > those of
>>     >         > Sidra Medical and Research Center.
>>     >         >
>>     >
>>     >
>>     >     Disclaimer: This email and its attachments may be confidential
>> and are
>>     > intended solely for the use of the individual to whom it is
>> addressed. If
>>     > you are not the intended recipient, any reading, printing, storage,
>>     > disclosure, copying or any other action taken in respect of this
>> e-mail is
>>     > prohibited and may be unlawful. If you are not the intended
>> recipient,
>>     > please notify the sender immediately by using the reply function
>> and then
>>     > permanently delete what you have received. Any views or opinions
>> expressed
>>     > are solely those of the author and do not necessarily represent
>> those of
>>     > Sidra Medical and Research Center.
>>     >
>>     >
>>     > Disclaimer: This email and its attachments may be confidential and
>> are
>>     > intended solely for the use of the individual to whom it is
>> addressed. If
>>     > you are not the intended recipient, any reading, printing, storage,
>>     > disclosure, copying or any other action taken in respect of this
>> e-mail is
>>     > prohibited and may be unlawful. If you are not the intended
>> recipient,
>>     > please notify the sender immediately by using the reply function
>> and then
>>     > permanently delete what you have received. Any views or opinions
>> expressed
>>     > are solely those of the author and do not necessarily represent
>> those of
>>     > Sidra Medical and Research Center.
>>     >
>>
>>
>> Disclaimer: This email and its attachments may be confidential and are
>> intended solely for the use of the individual to whom it is addressed. If
>> you are not the intended recipient, any reading, printing, storage,
>> disclosure, copying or any other action taken in respect of this e-mail is
>> prohibited and may be unlawful. If you are not the intended recipient,
>> please notify the sender immediately by using the reply function and then
>> permanently delete what you have received. Any views or opinions expressed
>> are solely those of the author and do not necessarily represent those of
>> Sidra Medical and Research Center.
>>
>

Re: Drill connection using jdbc

Posted by Robert Hou <rh...@mapr.com>.
Can you try "drill" as your zk.root?

What do you see when you log into zookeeper and run "ls /"?

Thanks.

--Robert

On Wed, Jan 9, 2019 at 12:45 AM Tushar Pathare <tp...@sidra.org> wrote:

> Hello Robert,
>                        Thanks for the info.
>                        Drillbit connection worked but zk connection not
> working.
>                        Zk.root for me is /opt/drill and clusterid is
> sidra-drillbit.
>
> My drill-override.conf looks as follows.
>
> drill.exec: {
>   cluster-id: "sidra-drillbit",
>   zk.connect: "hpcsrcn01:2181,hpcsrcn02:2181,hpcsrcn04:2181"
> }
>
>
>
> Tushar Bhalchandra Pathare
> Bigdata,GPFS,CSXF – Research Department
> t. +974 4003 7443
> m. +974 74793547
> PO BOX 26999 Doha, Qatar
> sidra.org <
> https://urldefense.proofpoint.com/v2/url?u=http-3A__www.sidra.org_&d=DwIGaQ&c=cskdkSMqhcnjZxdQVpwTXg&r=GXRJhB4g1YFDJsrcglHwUA&m=GzXrG3NEgyu3DwC61SjSD5gw0TYMT4GGi_jOLjSGttY&s=3IKZg-nDhsGJG70FdwBMabw_o0GCo_vADXVODbny7T8&e=
> >
>
>
> On 1/9/19, 11:34 AM, "Robert Hou" <rh...@mapr.com> wrote:
>
>     I would suggest connecting with drillbit first, and if that works, I
> would
>     use zookeeper.
>
>        sqlline -u "jdbc:drill:drillbit=<IP address>"
>
>     Please note the quotation marks.
>
>     If that works, then try:
>
>        sqlline -u "jdbc:drill:zk=<IPaddress>:port/<zk.root for
>     drill>/<clusterID>"
>
>     zk.root is "drill" by default.  If you have specified zk.root in
>     drill-override.conf, then use that.
>
>     Thanks.
>
>     --Robert
>
>
>     On Wed, Jan 9, 2019 at 12:13 AM Tushar Pathare <tp...@sidra.org>
> wrote:
>
>     > Hello Team,
>     > Same issue.
>     >
>     >
>     > ERROR: An error occurred while trying to make a connection to
>     > the database:
>     >
>     > JDBC URL:
>     > jdbc:drill:zk=172.32.63.64:2181/opt/apache-drill/sidra-drillbit
>     >
>     > Failure in creating DrillConnectionImpl:
>     > java.lang.IllegalStateException: No active Drillbit endpoint
>     > found from ZooKeeper. Check connection parameters?
>     >
>     >
>     > Tushar Bhalchandra Pathare
>     > Bigdata,GPFS,CSXF – Research Department
>     > t. +974 4003 7443
>     > m. +974 74793547
>     > PO BOX 26999 Doha, Qatar
>     > sidra.org <
>     >
> https://urldefense.proofpoint.com/v2/url?u=http-3A__www.sidra.org_&d=DwIGaQ&c=cskdkSMqhcnjZxdQVpwTXg&r=GXRJhB4g1YFDJsrcglHwUA&m=BJqk_hazvoApEDyas3DwYGI3NAEtSjzIEex2DF5uhHk&s=9M5Aak1SIn-KuFJWfpDiUyALzAKZWCwQUnD_m-SQvtA&e=
>     > >
>     >
>     >
>     > On 1/9/19, 11:02 AM, "Arjun kr" <ar...@outlook.com> wrote:
>     >
>     >     Yes. I believe its a necessary parameter if non default cluster
> I'd is
>     > used and given in the connection url. You can check if it works with
>     > directory specified.
>     >
>     >     Get Outlook for Android<
>     >
> https://urldefense.proofpoint.com/v2/url?u=https-3A__aka.ms_ghei36&d=DwIGaQ&c=cskdkSMqhcnjZxdQVpwTXg&r=GXRJhB4g1YFDJsrcglHwUA&m=BJqk_hazvoApEDyas3DwYGI3NAEtSjzIEex2DF5uhHk&s=Pq7kuN1t4H6e-BdtFBP7VVnFqhNMVVXBHX8qIQMq9B0&e=
>     > >
>     >
>     >     ________________________________
>     >     From: Tushar Pathare <tp...@sidra.org>
>     >     Sent: Tuesday, January 8, 2019 11:40:22 PM
>     >     To: user@drill.apache.org
>     >     Subject: Re: Drill connection using jdbc
>     >
>     >     Is it necessary because I thought it is optional including the
> cluster
>     > ID
>     >
>     >
>     >     Tushar Bhalchandra Pathare
>     >     Bigdata,GPFS,CSXF – Research Department
>     >     t. +974 4003 7443
>     >     m. +974 74793547
>     >     PO BOX 26999 Doha, Qatar
>     >     sidra.org <
>     >
> https://urldefense.proofpoint.com/v2/url?u=http-3A__www.sidra.org_&d=DwIGaQ&c=cskdkSMqhcnjZxdQVpwTXg&r=GXRJhB4g1YFDJsrcglHwUA&m=BJqk_hazvoApEDyas3DwYGI3NAEtSjzIEex2DF5uhHk&s=9M5Aak1SIn-KuFJWfpDiUyALzAKZWCwQUnD_m-SQvtA&e=
>     > >
>     >
>     >
>     >     On 1/9/19, 10:39 AM, "Arjun kr" <ar...@outlook.com> wrote:
>     >
>     >         Are you missing drill zk directory in connection url?
>     >         By default, it's value is drill.
>     >
>     >         jdbc:drill:zk=<zk name>[:<port>][,<zk name2>[:<port>]...
>     >         <directory>/<cluster ID>;[schema=<storage plugin>]
>     >
>     >
>     >
>     >
> https://urldefense.proofpoint.com/v2/url?u=https-3A__drill.apache.org_docs_using-2Dthe-2D&d=DwIGaQ&c=cskdkSMqhcnjZxdQVpwTXg&r=GXRJhB4g1YFDJsrcglHwUA&m=BJqk_hazvoApEDyas3DwYGI3NAEtSjzIEex2DF5uhHk&s=OkoCdG1xe3BPsJ45-qJ9Z7ewXUUgGpz3w54SuZXNr9U&e=
>     > <
>     >
> https://urldefense.proofpoint.com/v2/url?u=https-3A__drill.apache.org_docs_using-2Dthe-2Djdbc-2Ddriver_&d=DwIGaQ&c=cskdkSMqhcnjZxdQVpwTXg&r=GXRJhB4g1YFDJsrcglHwUA&m=BJqk_hazvoApEDyas3DwYGI3NAEtSjzIEex2DF5uhHk&s=YuYqrYaD7-X633jjZFcolbBVC82m74rKASSB0u87LTo&e=
>     > >jdbc<
>     >
> https://urldefense.proofpoint.com/v2/url?u=https-3A__drill.apache.org_docs_using-2Dthe-2Djdbc-2Ddriver_&d=DwIGaQ&c=cskdkSMqhcnjZxdQVpwTXg&r=GXRJhB4g1YFDJsrcglHwUA&m=BJqk_hazvoApEDyas3DwYGI3NAEtSjzIEex2DF5uhHk&s=YuYqrYaD7-X633jjZFcolbBVC82m74rKASSB0u87LTo&e=
>     > >-driver/<
>     >
> https://urldefense.proofpoint.com/v2/url?u=https-3A__drill.apache.org_docs_using-2Dthe-2Djdbc-2Ddriver_&d=DwIGaQ&c=cskdkSMqhcnjZxdQVpwTXg&r=GXRJhB4g1YFDJsrcglHwUA&m=BJqk_hazvoApEDyas3DwYGI3NAEtSjzIEex2DF5uhHk&s=YuYqrYaD7-X633jjZFcolbBVC82m74rKASSB0u87LTo&e=
>     > >
>     >
>     >         Thanks,
>     >
>     >         Arjun
>     >
>     >         Get Outlook for Android<
>     >
> https://urldefense.proofpoint.com/v2/url?u=https-3A__aka.ms_ghei36&d=DwIGaQ&c=cskdkSMqhcnjZxdQVpwTXg&r=GXRJhB4g1YFDJsrcglHwUA&m=BJqk_hazvoApEDyas3DwYGI3NAEtSjzIEex2DF5uhHk&s=Pq7kuN1t4H6e-BdtFBP7VVnFqhNMVVXBHX8qIQMq9B0&e=
>     > >
>     >
>     >         ________________________________
>     >         From: Khurram Faraaz <kf...@mapr.com>
>     >         Sent: Tuesday, January 8, 2019 11:17:58 PM
>     >         To: user@drill.apache.org
>     >         Subject: Re: Drill connection using jdbc
>     >
>     >         Hi Tushar,
>     >
>     >         This example works just fine for me, you may want to use the
>     > template
>     >
>     >         import org.apache.log4j.Logger;
>     >
>     >         import java.sql.Connection;
>     >         import java.sql.ResultSet;
>     >         import java.sql.SQLException;
>     >         import java.sql.Statement;
>     >         import java.sql.Types;
>     >         import java.sql.*;
>     >         import java.io.*;
>     >         import java.lang.*;
>     >         import java.util.*;
>     >         import java.util.Scanner;
>     >
>     >         public class TestQuery {
>     >
>     >         public static void main(String s[]) throws Exception {
>     >
>     >             Connection conn = null;
>     >             PreparedStatement prdstmnt = null;
>     >             try {
>     >                     // Please replace test1302-145 with your
> hostname,
>     > name of host
>     >         where Drillbit is up and running
>     >                     final String URL_STRING =
>     >         "jdbc:drill:schema=dfs.tmp;drillbit=test1302-145";
>     >
>     > Class.forName("org.apache.drill.jdbc.Driver").newInstance();
>     >
>     >                     // Please replace username and password with your
>     > username and
>     >         password
>     >                     conn =
>     > DriverManager.getConnection(URL_STRING,"mapr","mapr");
>     >                     prdstmnt = conn.prepareStatement("SELECT * FROM
>     >         cp.`employee.json`");
>     >                     prdstmnt.executeQuery();
>     >                     prdstmnt.close();
>     >             } catch (Exception e) {
>     >                System.out.println(e.getMessage());
>     >                e.printStackTrace();
>     >             } finally {
>     >                 if(conn != null)
>     >                     try { conn.close(); } catch(SQLException
> sqlexcpn){
>     >         sqlexcpn.printStackTrace(); }
>     >                 if(prdstmnt != null)
>     >                     try { prdstmnt.close(); } catch(SQLException
> sqlexcpn){
>     >         sqlexcpn.printStackTrace(); }
>     >                 }
>     >             }
>     >         }
>     >
>     >         Regards,
>     >         Khurram
>     >
>     >         On Tue, Jan 8, 2019 at 11:10 PM Tushar Pathare <
> tpathare@sidra.org>
>     > wrote:
>     >
>     >         > Hello Team,
>     >         >
>     >         >                     We have installed drill 1.12.0 and
> trying to
>     > connect
>     >         > using a client to the drill cluster
>     >         >
>     >         > Our config for connection is
>     >         >
>     >         >
>     >         >
>     >         > Drill class is : org.apache.drill.jdbc.Driver
>     >         >
>     >         > Driver location is
>     >         >
>     >
> /Users/tpathare/Downloads/apache-drill-1.12.0/jars/jdbc-driver/drill-jdbc-all-1.12.0.jar
>     >         >
>     >         > Jdbc url is : jdbc:drill:zk=172.32.63.64:2181,
> 172.32.63.65:2181,
>     >         > 172.32.63.67:2181
>     >         >
>     >         >
>     >         >
>     >         > When I hit connect I see the following error.Though the
> cluster
>     > is up and
>     >         > running and ZK is also good.
>     >         >
>     >         >
>     >         >
>     >         > *ERROR: An error occurred while trying to make a
> connection to *
>     >         >
>     >         > *the database:  *
>     >         >
>     >         >
>     >         >
>     >         > *JDBC URL: *
>     >         >
>     >         > *jdbc:drill:zk=172.32.63.64:2181
>     >         > <
>     >
> https://urldefense.proofpoint.com/v2/url?u=http-3A__172.32.63.64-3A2181&d=DwIGaQ&c=cskdkSMqhcnjZxdQVpwTXg&r=GXRJhB4g1YFDJsrcglHwUA&m=BJqk_hazvoApEDyas3DwYGI3NAEtSjzIEex2DF5uhHk&s=-X33aklNalfpJDS18b6-wH5bkmY2QWJ4iba8p6pmxn4&e=
>     > >,172.32.63.65:2181
>     >         > <
>     >
> https://urldefense.proofpoint.com/v2/url?u=http-3A__172.32.63.65-3A2181&d=DwIGaQ&c=cskdkSMqhcnjZxdQVpwTXg&r=GXRJhB4g1YFDJsrcglHwUA&m=BJqk_hazvoApEDyas3DwYGI3NAEtSjzIEex2DF5uhHk&s=fHrzLbqH4CpgspWDHoMyOMneXh2YP2HD7frqI4ITiUM&e=
>     > >,172.32.63.67:2181/sidra-drillbit
>     >         > <
>     >
> https://urldefense.proofpoint.com/v2/url?u=http-3A__172.32.63.67-3A2181_sidra-2Ddrillbit&d=DwIGaQ&c=cskdkSMqhcnjZxdQVpwTXg&r=GXRJhB4g1YFDJsrcglHwUA&m=BJqk_hazvoApEDyas3DwYGI3NAEtSjzIEex2DF5uhHk&s=o9EFkEIaCa6F7My4l3JXFfeeZtFJFqytiFAxLxybbg4&e=
> >
>     > *
>     >         >
>     >         >
>     >         >
>     >         > *Failure in connecting to Drill: *
>     >         >
>     >         > *oadd.org.apache.drill.exec.rpc.RpcException: Failure
> setting up
>     > *
>     >         >
>     >         > *ZK for client.*
>     >         >
>     >         >
>     >         >
>     >         >
>     >         >
>     >         >
>     >         >
>     >         > [image: cid:image001.png@01D3B9E9.23323D90]
>     >         >
>     >         > *Tushar Bhalchandra Pathare*
>     >         >
>     >         > Bigdata,GPFS,CSXF – Research Department
>     >         >
>     >         > *t. *+974 4003 7443
>     >         >
>     >         > *m.* +974 74793547
>     >         >
>     >         > PO BOX 26999 Doha, Qatar
>     >         >
>     >         > sidra.org
>     >         > <
>     >
> https://urldefense.proofpoint.com/v2/url?u=http-3A__www.sidra.org_&d=DwMGaQ&c=cskdkSMqhcnjZxdQVpwTXg&r=H5JEl9vb-mBIjic10QAbDD2vkUUKAxjO6wZO322RtdI&m=xCohfm7_vub0ExT6cMTEbB4WbjdIEPLdaXqXAOANq4A&s=kqudpk5v3cRasIbaMG8kwLBXafZ87VEhutJj7vxwhS4&e=
>     > >
>     >         >
>     >         >
>     >         > Disclaimer: This email and its attachments may be
> confidential
>     > and are
>     >         > intended solely for the use of the individual to whom it is
>     > addressed. If
>     >         > you are not the intended recipient, any reading, printing,
>     > storage,
>     >         > disclosure, copying or any other action taken in respect
> of this
>     > e-mail is
>     >         > prohibited and may be unlawful. If you are not the intended
>     > recipient,
>     >         > please notify the sender immediately by using the reply
> function
>     > and then
>     >         > permanently delete what you have received. Any views or
> opinions
>     > expressed
>     >         > are solely those of the author and do not necessarily
> represent
>     > those of
>     >         > Sidra Medical and Research Center.
>     >         >
>     >
>     >
>     >     Disclaimer: This email and its attachments may be confidential
> and are
>     > intended solely for the use of the individual to whom it is
> addressed. If
>     > you are not the intended recipient, any reading, printing, storage,
>     > disclosure, copying or any other action taken in respect of this
> e-mail is
>     > prohibited and may be unlawful. If you are not the intended
> recipient,
>     > please notify the sender immediately by using the reply function and
> then
>     > permanently delete what you have received. Any views or opinions
> expressed
>     > are solely those of the author and do not necessarily represent
> those of
>     > Sidra Medical and Research Center.
>     >
>     >
>     > Disclaimer: This email and its attachments may be confidential and
> are
>     > intended solely for the use of the individual to whom it is
> addressed. If
>     > you are not the intended recipient, any reading, printing, storage,
>     > disclosure, copying or any other action taken in respect of this
> e-mail is
>     > prohibited and may be unlawful. If you are not the intended
> recipient,
>     > please notify the sender immediately by using the reply function and
> then
>     > permanently delete what you have received. Any views or opinions
> expressed
>     > are solely those of the author and do not necessarily represent
> those of
>     > Sidra Medical and Research Center.
>     >
>
>
> Disclaimer: This email and its attachments may be confidential and are
> intended solely for the use of the individual to whom it is addressed. If
> you are not the intended recipient, any reading, printing, storage,
> disclosure, copying or any other action taken in respect of this e-mail is
> prohibited and may be unlawful. If you are not the intended recipient,
> please notify the sender immediately by using the reply function and then
> permanently delete what you have received. Any views or opinions expressed
> are solely those of the author and do not necessarily represent those of
> Sidra Medical and Research Center.
>

Re: Drill connection using jdbc

Posted by Tushar Pathare <tp...@sidra.org>.
Hello Robert,
                       Thanks for the info.
                       Drillbit connection worked but zk connection not working.
                       Zk.root for me is /opt/drill and clusterid is sidra-drillbit.

My drill-override.conf looks as follows.

drill.exec: {
  cluster-id: "sidra-drillbit",
  zk.connect: "hpcsrcn01:2181,hpcsrcn02:2181,hpcsrcn04:2181"
}



Tushar Bhalchandra Pathare
Bigdata,GPFS,CSXF – Research Department
t. +974 4003 7443
m. +974 74793547
PO BOX 26999 Doha, Qatar
sidra.org <http://www.sidra.org/>


On 1/9/19, 11:34 AM, "Robert Hou" <rh...@mapr.com> wrote:

    I would suggest connecting with drillbit first, and if that works, I would
    use zookeeper.

       sqlline -u "jdbc:drill:drillbit=<IP address>"

    Please note the quotation marks.

    If that works, then try:

       sqlline -u "jdbc:drill:zk=<IPaddress>:port/<zk.root for
    drill>/<clusterID>"

    zk.root is "drill" by default.  If you have specified zk.root in
    drill-override.conf, then use that.

    Thanks.

    --Robert


    On Wed, Jan 9, 2019 at 12:13 AM Tushar Pathare <tp...@sidra.org> wrote:

    > Hello Team,
    > Same issue.
    >
    >
    > ERROR: An error occurred while trying to make a connection to
    > the database:
    >
    > JDBC URL:
    > jdbc:drill:zk=172.32.63.64:2181/opt/apache-drill/sidra-drillbit
    >
    > Failure in creating DrillConnectionImpl:
    > java.lang.IllegalStateException: No active Drillbit endpoint
    > found from ZooKeeper. Check connection parameters?
    >
    >
    > Tushar Bhalchandra Pathare
    > Bigdata,GPFS,CSXF – Research Department
    > t. +974 4003 7443
    > m. +974 74793547
    > PO BOX 26999 Doha, Qatar
    > sidra.org <
    > https://urldefense.proofpoint.com/v2/url?u=http-3A__www.sidra.org_&d=DwIGaQ&c=cskdkSMqhcnjZxdQVpwTXg&r=GXRJhB4g1YFDJsrcglHwUA&m=BJqk_hazvoApEDyas3DwYGI3NAEtSjzIEex2DF5uhHk&s=9M5Aak1SIn-KuFJWfpDiUyALzAKZWCwQUnD_m-SQvtA&e=
    > >
    >
    >
    > On 1/9/19, 11:02 AM, "Arjun kr" <ar...@outlook.com> wrote:
    >
    >     Yes. I believe its a necessary parameter if non default cluster I'd is
    > used and given in the connection url. You can check if it works with
    > directory specified.
    >
    >     Get Outlook for Android<
    > https://urldefense.proofpoint.com/v2/url?u=https-3A__aka.ms_ghei36&d=DwIGaQ&c=cskdkSMqhcnjZxdQVpwTXg&r=GXRJhB4g1YFDJsrcglHwUA&m=BJqk_hazvoApEDyas3DwYGI3NAEtSjzIEex2DF5uhHk&s=Pq7kuN1t4H6e-BdtFBP7VVnFqhNMVVXBHX8qIQMq9B0&e=
    > >
    >
    >     ________________________________
    >     From: Tushar Pathare <tp...@sidra.org>
    >     Sent: Tuesday, January 8, 2019 11:40:22 PM
    >     To: user@drill.apache.org
    >     Subject: Re: Drill connection using jdbc
    >
    >     Is it necessary because I thought it is optional including the cluster
    > ID
    >
    >
    >     Tushar Bhalchandra Pathare
    >     Bigdata,GPFS,CSXF – Research Department
    >     t. +974 4003 7443
    >     m. +974 74793547
    >     PO BOX 26999 Doha, Qatar
    >     sidra.org <
    > https://urldefense.proofpoint.com/v2/url?u=http-3A__www.sidra.org_&d=DwIGaQ&c=cskdkSMqhcnjZxdQVpwTXg&r=GXRJhB4g1YFDJsrcglHwUA&m=BJqk_hazvoApEDyas3DwYGI3NAEtSjzIEex2DF5uhHk&s=9M5Aak1SIn-KuFJWfpDiUyALzAKZWCwQUnD_m-SQvtA&e=
    > >
    >
    >
    >     On 1/9/19, 10:39 AM, "Arjun kr" <ar...@outlook.com> wrote:
    >
    >         Are you missing drill zk directory in connection url?
    >         By default, it's value is drill.
    >
    >         jdbc:drill:zk=<zk name>[:<port>][,<zk name2>[:<port>]...
    >         <directory>/<cluster ID>;[schema=<storage plugin>]
    >
    >
    >
    > https://urldefense.proofpoint.com/v2/url?u=https-3A__drill.apache.org_docs_using-2Dthe-2D&d=DwIGaQ&c=cskdkSMqhcnjZxdQVpwTXg&r=GXRJhB4g1YFDJsrcglHwUA&m=BJqk_hazvoApEDyas3DwYGI3NAEtSjzIEex2DF5uhHk&s=OkoCdG1xe3BPsJ45-qJ9Z7ewXUUgGpz3w54SuZXNr9U&e=
    > <
    > https://urldefense.proofpoint.com/v2/url?u=https-3A__drill.apache.org_docs_using-2Dthe-2Djdbc-2Ddriver_&d=DwIGaQ&c=cskdkSMqhcnjZxdQVpwTXg&r=GXRJhB4g1YFDJsrcglHwUA&m=BJqk_hazvoApEDyas3DwYGI3NAEtSjzIEex2DF5uhHk&s=YuYqrYaD7-X633jjZFcolbBVC82m74rKASSB0u87LTo&e=
    > >jdbc<
    > https://urldefense.proofpoint.com/v2/url?u=https-3A__drill.apache.org_docs_using-2Dthe-2Djdbc-2Ddriver_&d=DwIGaQ&c=cskdkSMqhcnjZxdQVpwTXg&r=GXRJhB4g1YFDJsrcglHwUA&m=BJqk_hazvoApEDyas3DwYGI3NAEtSjzIEex2DF5uhHk&s=YuYqrYaD7-X633jjZFcolbBVC82m74rKASSB0u87LTo&e=
    > >-driver/<
    > https://urldefense.proofpoint.com/v2/url?u=https-3A__drill.apache.org_docs_using-2Dthe-2Djdbc-2Ddriver_&d=DwIGaQ&c=cskdkSMqhcnjZxdQVpwTXg&r=GXRJhB4g1YFDJsrcglHwUA&m=BJqk_hazvoApEDyas3DwYGI3NAEtSjzIEex2DF5uhHk&s=YuYqrYaD7-X633jjZFcolbBVC82m74rKASSB0u87LTo&e=
    > >
    >
    >         Thanks,
    >
    >         Arjun
    >
    >         Get Outlook for Android<
    > https://urldefense.proofpoint.com/v2/url?u=https-3A__aka.ms_ghei36&d=DwIGaQ&c=cskdkSMqhcnjZxdQVpwTXg&r=GXRJhB4g1YFDJsrcglHwUA&m=BJqk_hazvoApEDyas3DwYGI3NAEtSjzIEex2DF5uhHk&s=Pq7kuN1t4H6e-BdtFBP7VVnFqhNMVVXBHX8qIQMq9B0&e=
    > >
    >
    >         ________________________________
    >         From: Khurram Faraaz <kf...@mapr.com>
    >         Sent: Tuesday, January 8, 2019 11:17:58 PM
    >         To: user@drill.apache.org
    >         Subject: Re: Drill connection using jdbc
    >
    >         Hi Tushar,
    >
    >         This example works just fine for me, you may want to use the
    > template
    >
    >         import org.apache.log4j.Logger;
    >
    >         import java.sql.Connection;
    >         import java.sql.ResultSet;
    >         import java.sql.SQLException;
    >         import java.sql.Statement;
    >         import java.sql.Types;
    >         import java.sql.*;
    >         import java.io.*;
    >         import java.lang.*;
    >         import java.util.*;
    >         import java.util.Scanner;
    >
    >         public class TestQuery {
    >
    >         public static void main(String s[]) throws Exception {
    >
    >             Connection conn = null;
    >             PreparedStatement prdstmnt = null;
    >             try {
    >                     // Please replace test1302-145 with your hostname,
    > name of host
    >         where Drillbit is up and running
    >                     final String URL_STRING =
    >         "jdbc:drill:schema=dfs.tmp;drillbit=test1302-145";
    >
    > Class.forName("org.apache.drill.jdbc.Driver").newInstance();
    >
    >                     // Please replace username and password with your
    > username and
    >         password
    >                     conn =
    > DriverManager.getConnection(URL_STRING,"mapr","mapr");
    >                     prdstmnt = conn.prepareStatement("SELECT * FROM
    >         cp.`employee.json`");
    >                     prdstmnt.executeQuery();
    >                     prdstmnt.close();
    >             } catch (Exception e) {
    >                System.out.println(e.getMessage());
    >                e.printStackTrace();
    >             } finally {
    >                 if(conn != null)
    >                     try { conn.close(); } catch(SQLException sqlexcpn){
    >         sqlexcpn.printStackTrace(); }
    >                 if(prdstmnt != null)
    >                     try { prdstmnt.close(); } catch(SQLException sqlexcpn){
    >         sqlexcpn.printStackTrace(); }
    >                 }
    >             }
    >         }
    >
    >         Regards,
    >         Khurram
    >
    >         On Tue, Jan 8, 2019 at 11:10 PM Tushar Pathare <tp...@sidra.org>
    > wrote:
    >
    >         > Hello Team,
    >         >
    >         >                     We have installed drill 1.12.0 and trying to
    > connect
    >         > using a client to the drill cluster
    >         >
    >         > Our config for connection is
    >         >
    >         >
    >         >
    >         > Drill class is : org.apache.drill.jdbc.Driver
    >         >
    >         > Driver location is
    >         >
    > /Users/tpathare/Downloads/apache-drill-1.12.0/jars/jdbc-driver/drill-jdbc-all-1.12.0.jar
    >         >
    >         > Jdbc url is : jdbc:drill:zk=172.32.63.64:2181,172.32.63.65:2181,
    >         > 172.32.63.67:2181
    >         >
    >         >
    >         >
    >         > When I hit connect I see the following error.Though the cluster
    > is up and
    >         > running and ZK is also good.
    >         >
    >         >
    >         >
    >         > *ERROR: An error occurred while trying to make a connection to *
    >         >
    >         > *the database:  *
    >         >
    >         >
    >         >
    >         > *JDBC URL: *
    >         >
    >         > *jdbc:drill:zk=172.32.63.64:2181
    >         > <
    > https://urldefense.proofpoint.com/v2/url?u=http-3A__172.32.63.64-3A2181&d=DwIGaQ&c=cskdkSMqhcnjZxdQVpwTXg&r=GXRJhB4g1YFDJsrcglHwUA&m=BJqk_hazvoApEDyas3DwYGI3NAEtSjzIEex2DF5uhHk&s=-X33aklNalfpJDS18b6-wH5bkmY2QWJ4iba8p6pmxn4&e=
    > >,172.32.63.65:2181
    >         > <
    > https://urldefense.proofpoint.com/v2/url?u=http-3A__172.32.63.65-3A2181&d=DwIGaQ&c=cskdkSMqhcnjZxdQVpwTXg&r=GXRJhB4g1YFDJsrcglHwUA&m=BJqk_hazvoApEDyas3DwYGI3NAEtSjzIEex2DF5uhHk&s=fHrzLbqH4CpgspWDHoMyOMneXh2YP2HD7frqI4ITiUM&e=
    > >,172.32.63.67:2181/sidra-drillbit
    >         > <
    > https://urldefense.proofpoint.com/v2/url?u=http-3A__172.32.63.67-3A2181_sidra-2Ddrillbit&d=DwIGaQ&c=cskdkSMqhcnjZxdQVpwTXg&r=GXRJhB4g1YFDJsrcglHwUA&m=BJqk_hazvoApEDyas3DwYGI3NAEtSjzIEex2DF5uhHk&s=o9EFkEIaCa6F7My4l3JXFfeeZtFJFqytiFAxLxybbg4&e=>
    > *
    >         >
    >         >
    >         >
    >         > *Failure in connecting to Drill: *
    >         >
    >         > *oadd.org.apache.drill.exec.rpc.RpcException: Failure setting up
    > *
    >         >
    >         > *ZK for client.*
    >         >
    >         >
    >         >
    >         >
    >         >
    >         >
    >         >
    >         > [image: cid:image001.png@01D3B9E9.23323D90]
    >         >
    >         > *Tushar Bhalchandra Pathare*
    >         >
    >         > Bigdata,GPFS,CSXF – Research Department
    >         >
    >         > *t. *+974 4003 7443
    >         >
    >         > *m.* +974 74793547
    >         >
    >         > PO BOX 26999 Doha, Qatar
    >         >
    >         > sidra.org
    >         > <
    > https://urldefense.proofpoint.com/v2/url?u=http-3A__www.sidra.org_&d=DwMGaQ&c=cskdkSMqhcnjZxdQVpwTXg&r=H5JEl9vb-mBIjic10QAbDD2vkUUKAxjO6wZO322RtdI&m=xCohfm7_vub0ExT6cMTEbB4WbjdIEPLdaXqXAOANq4A&s=kqudpk5v3cRasIbaMG8kwLBXafZ87VEhutJj7vxwhS4&e=
    > >
    >         >
    >         >
    >         > Disclaimer: This email and its attachments may be confidential
    > and are
    >         > intended solely for the use of the individual to whom it is
    > addressed. If
    >         > you are not the intended recipient, any reading, printing,
    > storage,
    >         > disclosure, copying or any other action taken in respect of this
    > e-mail is
    >         > prohibited and may be unlawful. If you are not the intended
    > recipient,
    >         > please notify the sender immediately by using the reply function
    > and then
    >         > permanently delete what you have received. Any views or opinions
    > expressed
    >         > are solely those of the author and do not necessarily represent
    > those of
    >         > Sidra Medical and Research Center.
    >         >
    >
    >
    >     Disclaimer: This email and its attachments may be confidential and are
    > intended solely for the use of the individual to whom it is addressed. If
    > you are not the intended recipient, any reading, printing, storage,
    > disclosure, copying or any other action taken in respect of this e-mail is
    > prohibited and may be unlawful. If you are not the intended recipient,
    > please notify the sender immediately by using the reply function and then
    > permanently delete what you have received. Any views or opinions expressed
    > are solely those of the author and do not necessarily represent those of
    > Sidra Medical and Research Center.
    >
    >
    > Disclaimer: This email and its attachments may be confidential and are
    > intended solely for the use of the individual to whom it is addressed. If
    > you are not the intended recipient, any reading, printing, storage,
    > disclosure, copying or any other action taken in respect of this e-mail is
    > prohibited and may be unlawful. If you are not the intended recipient,
    > please notify the sender immediately by using the reply function and then
    > permanently delete what you have received. Any views or opinions expressed
    > are solely those of the author and do not necessarily represent those of
    > Sidra Medical and Research Center.
    >


Disclaimer: This email and its attachments may be confidential and are intended solely for the use of the individual to whom it is addressed. If you are not the intended recipient, any reading, printing, storage, disclosure, copying or any other action taken in respect of this e-mail is prohibited and may be unlawful. If you are not the intended recipient, please notify the sender immediately by using the reply function and then permanently delete what you have received. Any views or opinions expressed are solely those of the author and do not necessarily represent those of Sidra Medical and Research Center.

Re: Drill connection using jdbc

Posted by Robert Hou <rh...@mapr.com>.
I would suggest connecting with drillbit first, and if that works, I would
use zookeeper.

   sqlline -u "jdbc:drill:drillbit=<IP address>"

Please note the quotation marks.

If that works, then try:

   sqlline -u "jdbc:drill:zk=<IPaddress>:port/<zk.root for
drill>/<clusterID>"

zk.root is "drill" by default.  If you have specified zk.root in
drill-override.conf, then use that.

Thanks.

--Robert


On Wed, Jan 9, 2019 at 12:13 AM Tushar Pathare <tp...@sidra.org> wrote:

> Hello Team,
> Same issue.
>
>
> ERROR: An error occurred while trying to make a connection to
> the database:
>
> JDBC URL:
> jdbc:drill:zk=172.32.63.64:2181/opt/apache-drill/sidra-drillbit
>
> Failure in creating DrillConnectionImpl:
> java.lang.IllegalStateException: No active Drillbit endpoint
> found from ZooKeeper. Check connection parameters?
>
>
> Tushar Bhalchandra Pathare
> Bigdata,GPFS,CSXF – Research Department
> t. +974 4003 7443
> m. +974 74793547
> PO BOX 26999 Doha, Qatar
> sidra.org <
> https://urldefense.proofpoint.com/v2/url?u=http-3A__www.sidra.org_&d=DwIGaQ&c=cskdkSMqhcnjZxdQVpwTXg&r=GXRJhB4g1YFDJsrcglHwUA&m=BJqk_hazvoApEDyas3DwYGI3NAEtSjzIEex2DF5uhHk&s=9M5Aak1SIn-KuFJWfpDiUyALzAKZWCwQUnD_m-SQvtA&e=
> >
>
>
> On 1/9/19, 11:02 AM, "Arjun kr" <ar...@outlook.com> wrote:
>
>     Yes. I believe its a necessary parameter if non default cluster I'd is
> used and given in the connection url. You can check if it works with
> directory specified.
>
>     Get Outlook for Android<
> https://urldefense.proofpoint.com/v2/url?u=https-3A__aka.ms_ghei36&d=DwIGaQ&c=cskdkSMqhcnjZxdQVpwTXg&r=GXRJhB4g1YFDJsrcglHwUA&m=BJqk_hazvoApEDyas3DwYGI3NAEtSjzIEex2DF5uhHk&s=Pq7kuN1t4H6e-BdtFBP7VVnFqhNMVVXBHX8qIQMq9B0&e=
> >
>
>     ________________________________
>     From: Tushar Pathare <tp...@sidra.org>
>     Sent: Tuesday, January 8, 2019 11:40:22 PM
>     To: user@drill.apache.org
>     Subject: Re: Drill connection using jdbc
>
>     Is it necessary because I thought it is optional including the cluster
> ID
>
>
>     Tushar Bhalchandra Pathare
>     Bigdata,GPFS,CSXF – Research Department
>     t. +974 4003 7443
>     m. +974 74793547
>     PO BOX 26999 Doha, Qatar
>     sidra.org <
> https://urldefense.proofpoint.com/v2/url?u=http-3A__www.sidra.org_&d=DwIGaQ&c=cskdkSMqhcnjZxdQVpwTXg&r=GXRJhB4g1YFDJsrcglHwUA&m=BJqk_hazvoApEDyas3DwYGI3NAEtSjzIEex2DF5uhHk&s=9M5Aak1SIn-KuFJWfpDiUyALzAKZWCwQUnD_m-SQvtA&e=
> >
>
>
>     On 1/9/19, 10:39 AM, "Arjun kr" <ar...@outlook.com> wrote:
>
>         Are you missing drill zk directory in connection url?
>         By default, it's value is drill.
>
>         jdbc:drill:zk=<zk name>[:<port>][,<zk name2>[:<port>]...
>         <directory>/<cluster ID>;[schema=<storage plugin>]
>
>
>
> https://urldefense.proofpoint.com/v2/url?u=https-3A__drill.apache.org_docs_using-2Dthe-2D&d=DwIGaQ&c=cskdkSMqhcnjZxdQVpwTXg&r=GXRJhB4g1YFDJsrcglHwUA&m=BJqk_hazvoApEDyas3DwYGI3NAEtSjzIEex2DF5uhHk&s=OkoCdG1xe3BPsJ45-qJ9Z7ewXUUgGpz3w54SuZXNr9U&e=
> <
> https://urldefense.proofpoint.com/v2/url?u=https-3A__drill.apache.org_docs_using-2Dthe-2Djdbc-2Ddriver_&d=DwIGaQ&c=cskdkSMqhcnjZxdQVpwTXg&r=GXRJhB4g1YFDJsrcglHwUA&m=BJqk_hazvoApEDyas3DwYGI3NAEtSjzIEex2DF5uhHk&s=YuYqrYaD7-X633jjZFcolbBVC82m74rKASSB0u87LTo&e=
> >jdbc<
> https://urldefense.proofpoint.com/v2/url?u=https-3A__drill.apache.org_docs_using-2Dthe-2Djdbc-2Ddriver_&d=DwIGaQ&c=cskdkSMqhcnjZxdQVpwTXg&r=GXRJhB4g1YFDJsrcglHwUA&m=BJqk_hazvoApEDyas3DwYGI3NAEtSjzIEex2DF5uhHk&s=YuYqrYaD7-X633jjZFcolbBVC82m74rKASSB0u87LTo&e=
> >-driver/<
> https://urldefense.proofpoint.com/v2/url?u=https-3A__drill.apache.org_docs_using-2Dthe-2Djdbc-2Ddriver_&d=DwIGaQ&c=cskdkSMqhcnjZxdQVpwTXg&r=GXRJhB4g1YFDJsrcglHwUA&m=BJqk_hazvoApEDyas3DwYGI3NAEtSjzIEex2DF5uhHk&s=YuYqrYaD7-X633jjZFcolbBVC82m74rKASSB0u87LTo&e=
> >
>
>         Thanks,
>
>         Arjun
>
>         Get Outlook for Android<
> https://urldefense.proofpoint.com/v2/url?u=https-3A__aka.ms_ghei36&d=DwIGaQ&c=cskdkSMqhcnjZxdQVpwTXg&r=GXRJhB4g1YFDJsrcglHwUA&m=BJqk_hazvoApEDyas3DwYGI3NAEtSjzIEex2DF5uhHk&s=Pq7kuN1t4H6e-BdtFBP7VVnFqhNMVVXBHX8qIQMq9B0&e=
> >
>
>         ________________________________
>         From: Khurram Faraaz <kf...@mapr.com>
>         Sent: Tuesday, January 8, 2019 11:17:58 PM
>         To: user@drill.apache.org
>         Subject: Re: Drill connection using jdbc
>
>         Hi Tushar,
>
>         This example works just fine for me, you may want to use the
> template
>
>         import org.apache.log4j.Logger;
>
>         import java.sql.Connection;
>         import java.sql.ResultSet;
>         import java.sql.SQLException;
>         import java.sql.Statement;
>         import java.sql.Types;
>         import java.sql.*;
>         import java.io.*;
>         import java.lang.*;
>         import java.util.*;
>         import java.util.Scanner;
>
>         public class TestQuery {
>
>         public static void main(String s[]) throws Exception {
>
>             Connection conn = null;
>             PreparedStatement prdstmnt = null;
>             try {
>                     // Please replace test1302-145 with your hostname,
> name of host
>         where Drillbit is up and running
>                     final String URL_STRING =
>         "jdbc:drill:schema=dfs.tmp;drillbit=test1302-145";
>
> Class.forName("org.apache.drill.jdbc.Driver").newInstance();
>
>                     // Please replace username and password with your
> username and
>         password
>                     conn =
> DriverManager.getConnection(URL_STRING,"mapr","mapr");
>                     prdstmnt = conn.prepareStatement("SELECT * FROM
>         cp.`employee.json`");
>                     prdstmnt.executeQuery();
>                     prdstmnt.close();
>             } catch (Exception e) {
>                System.out.println(e.getMessage());
>                e.printStackTrace();
>             } finally {
>                 if(conn != null)
>                     try { conn.close(); } catch(SQLException sqlexcpn){
>         sqlexcpn.printStackTrace(); }
>                 if(prdstmnt != null)
>                     try { prdstmnt.close(); } catch(SQLException sqlexcpn){
>         sqlexcpn.printStackTrace(); }
>                 }
>             }
>         }
>
>         Regards,
>         Khurram
>
>         On Tue, Jan 8, 2019 at 11:10 PM Tushar Pathare <tp...@sidra.org>
> wrote:
>
>         > Hello Team,
>         >
>         >                     We have installed drill 1.12.0 and trying to
> connect
>         > using a client to the drill cluster
>         >
>         > Our config for connection is
>         >
>         >
>         >
>         > Drill class is : org.apache.drill.jdbc.Driver
>         >
>         > Driver location is
>         >
> /Users/tpathare/Downloads/apache-drill-1.12.0/jars/jdbc-driver/drill-jdbc-all-1.12.0.jar
>         >
>         > Jdbc url is : jdbc:drill:zk=172.32.63.64:2181,172.32.63.65:2181,
>         > 172.32.63.67:2181
>         >
>         >
>         >
>         > When I hit connect I see the following error.Though the cluster
> is up and
>         > running and ZK is also good.
>         >
>         >
>         >
>         > *ERROR: An error occurred while trying to make a connection to *
>         >
>         > *the database:  *
>         >
>         >
>         >
>         > *JDBC URL: *
>         >
>         > *jdbc:drill:zk=172.32.63.64:2181
>         > <
> https://urldefense.proofpoint.com/v2/url?u=http-3A__172.32.63.64-3A2181&d=DwIGaQ&c=cskdkSMqhcnjZxdQVpwTXg&r=GXRJhB4g1YFDJsrcglHwUA&m=BJqk_hazvoApEDyas3DwYGI3NAEtSjzIEex2DF5uhHk&s=-X33aklNalfpJDS18b6-wH5bkmY2QWJ4iba8p6pmxn4&e=
> >,172.32.63.65:2181
>         > <
> https://urldefense.proofpoint.com/v2/url?u=http-3A__172.32.63.65-3A2181&d=DwIGaQ&c=cskdkSMqhcnjZxdQVpwTXg&r=GXRJhB4g1YFDJsrcglHwUA&m=BJqk_hazvoApEDyas3DwYGI3NAEtSjzIEex2DF5uhHk&s=fHrzLbqH4CpgspWDHoMyOMneXh2YP2HD7frqI4ITiUM&e=
> >,172.32.63.67:2181/sidra-drillbit
>         > <
> https://urldefense.proofpoint.com/v2/url?u=http-3A__172.32.63.67-3A2181_sidra-2Ddrillbit&d=DwIGaQ&c=cskdkSMqhcnjZxdQVpwTXg&r=GXRJhB4g1YFDJsrcglHwUA&m=BJqk_hazvoApEDyas3DwYGI3NAEtSjzIEex2DF5uhHk&s=o9EFkEIaCa6F7My4l3JXFfeeZtFJFqytiFAxLxybbg4&e=>
> *
>         >
>         >
>         >
>         > *Failure in connecting to Drill: *
>         >
>         > *oadd.org.apache.drill.exec.rpc.RpcException: Failure setting up
> *
>         >
>         > *ZK for client.*
>         >
>         >
>         >
>         >
>         >
>         >
>         >
>         > [image: cid:image001.png@01D3B9E9.23323D90]
>         >
>         > *Tushar Bhalchandra Pathare*
>         >
>         > Bigdata,GPFS,CSXF – Research Department
>         >
>         > *t. *+974 4003 7443
>         >
>         > *m.* +974 74793547
>         >
>         > PO BOX 26999 Doha, Qatar
>         >
>         > sidra.org
>         > <
> https://urldefense.proofpoint.com/v2/url?u=http-3A__www.sidra.org_&d=DwMGaQ&c=cskdkSMqhcnjZxdQVpwTXg&r=H5JEl9vb-mBIjic10QAbDD2vkUUKAxjO6wZO322RtdI&m=xCohfm7_vub0ExT6cMTEbB4WbjdIEPLdaXqXAOANq4A&s=kqudpk5v3cRasIbaMG8kwLBXafZ87VEhutJj7vxwhS4&e=
> >
>         >
>         >
>         > Disclaimer: This email and its attachments may be confidential
> and are
>         > intended solely for the use of the individual to whom it is
> addressed. If
>         > you are not the intended recipient, any reading, printing,
> storage,
>         > disclosure, copying or any other action taken in respect of this
> e-mail is
>         > prohibited and may be unlawful. If you are not the intended
> recipient,
>         > please notify the sender immediately by using the reply function
> and then
>         > permanently delete what you have received. Any views or opinions
> expressed
>         > are solely those of the author and do not necessarily represent
> those of
>         > Sidra Medical and Research Center.
>         >
>
>
>     Disclaimer: This email and its attachments may be confidential and are
> intended solely for the use of the individual to whom it is addressed. If
> you are not the intended recipient, any reading, printing, storage,
> disclosure, copying or any other action taken in respect of this e-mail is
> prohibited and may be unlawful. If you are not the intended recipient,
> please notify the sender immediately by using the reply function and then
> permanently delete what you have received. Any views or opinions expressed
> are solely those of the author and do not necessarily represent those of
> Sidra Medical and Research Center.
>
>
> Disclaimer: This email and its attachments may be confidential and are
> intended solely for the use of the individual to whom it is addressed. If
> you are not the intended recipient, any reading, printing, storage,
> disclosure, copying or any other action taken in respect of this e-mail is
> prohibited and may be unlawful. If you are not the intended recipient,
> please notify the sender immediately by using the reply function and then
> permanently delete what you have received. Any views or opinions expressed
> are solely those of the author and do not necessarily represent those of
> Sidra Medical and Research Center.
>

Re: Drill connection using jdbc

Posted by Arjun Rajan <ar...@mapr.com>.
Try this URL jdbc:drill:zk=172.32.63.64:2181/drill/sidra-drillbit
<http://172.32.63.64:2181/opt/apache-drill/sidra-drillbit>

It is expecting znode path in zookeeper used by Drill.

Thanks,

Arjun

On Wed, Jan 9, 2019, 12:13 AM Tushar Pathare <tpathare@sidra.org wrote:

> Hello Team,
> Same issue.
>
>
> ERROR: An error occurred while trying to make a connection to
> the database:
>
> JDBC URL:
> jdbc:drill:zk=172.32.63.64:2181/opt/apache-drill/sidra-drillbit
>
> Failure in creating DrillConnectionImpl:
> java.lang.IllegalStateException: No active Drillbit endpoint
> found from ZooKeeper. Check connection parameters?
>
>
> Tushar Bhalchandra Pathare
> Bigdata,GPFS,CSXF – Research Department
> t. +974 4003 7443
> m. +974 74793547
> PO BOX 26999 Doha, Qatar
> sidra.org <
> https://urldefense.proofpoint.com/v2/url?u=http-3A__www.sidra.org_&d=DwIGaQ&c=cskdkSMqhcnjZxdQVpwTXg&r=G5PLuEcQc-XMZcqmyuPQrA&m=oxHW4S7DFVwVvsZaHH0XgZnhhmGkh8Gaj5N91x0ZNNU&s=ahdl771nVvakDoiIMxP3CwNThb1gfs0C1FnbsHe5MoI&e=
> >
>
>
> On 1/9/19, 11:02 AM, "Arjun kr" <ar...@outlook.com> wrote:
>
>     Yes. I believe its a necessary parameter if non default cluster I'd is
> used and given in the connection url. You can check if it works with
> directory specified.
>
>     Get Outlook for Android<
> https://urldefense.proofpoint.com/v2/url?u=https-3A__aka.ms_ghei36&d=DwIGaQ&c=cskdkSMqhcnjZxdQVpwTXg&r=G5PLuEcQc-XMZcqmyuPQrA&m=oxHW4S7DFVwVvsZaHH0XgZnhhmGkh8Gaj5N91x0ZNNU&s=sAuQzJT3xlBvr0R3la2Lx8ou1y9ua1oECbvGmEn1IGc&e=
> >
>
>     ________________________________
>     From: Tushar Pathare <tp...@sidra.org>
>     Sent: Tuesday, January 8, 2019 11:40:22 PM
>     To: user@drill.apache.org
>     Subject: Re: Drill connection using jdbc
>
>     Is it necessary because I thought it is optional including the cluster
> ID
>
>
>     Tushar Bhalchandra Pathare
>     Bigdata,GPFS,CSXF – Research Department
>     t. +974 4003 7443
>     m. +974 74793547
>     PO BOX 26999 Doha, Qatar
>     sidra.org <
> https://urldefense.proofpoint.com/v2/url?u=http-3A__www.sidra.org_&d=DwIGaQ&c=cskdkSMqhcnjZxdQVpwTXg&r=G5PLuEcQc-XMZcqmyuPQrA&m=oxHW4S7DFVwVvsZaHH0XgZnhhmGkh8Gaj5N91x0ZNNU&s=ahdl771nVvakDoiIMxP3CwNThb1gfs0C1FnbsHe5MoI&e=
> >
>
>
>     On 1/9/19, 10:39 AM, "Arjun kr" <ar...@outlook.com> wrote:
>
>         Are you missing drill zk directory in connection url?
>         By default, it's value is drill.
>
>         jdbc:drill:zk=<zk name>[:<port>][,<zk name2>[:<port>]...
>         <directory>/<cluster ID>;[schema=<storage plugin>]
>
>
>
> https://urldefense.proofpoint.com/v2/url?u=https-3A__drill.apache.org_docs_using-2Dthe-2D&d=DwIGaQ&c=cskdkSMqhcnjZxdQVpwTXg&r=G5PLuEcQc-XMZcqmyuPQrA&m=oxHW4S7DFVwVvsZaHH0XgZnhhmGkh8Gaj5N91x0ZNNU&s=Gl1RnwVHObkF6idCyKaf7qJgDWUvOWUbaMmKK_G6r_s&e=
> <
> https://urldefense.proofpoint.com/v2/url?u=https-3A__drill.apache.org_docs_using-2Dthe-2Djdbc-2Ddriver_&d=DwIGaQ&c=cskdkSMqhcnjZxdQVpwTXg&r=G5PLuEcQc-XMZcqmyuPQrA&m=oxHW4S7DFVwVvsZaHH0XgZnhhmGkh8Gaj5N91x0ZNNU&s=g41X-zx9wRcnMql53jhfYV9kI47XWBhqNWD5BWazeBc&e=
> >jdbc<
> https://urldefense.proofpoint.com/v2/url?u=https-3A__drill.apache.org_docs_using-2Dthe-2Djdbc-2Ddriver_&d=DwIGaQ&c=cskdkSMqhcnjZxdQVpwTXg&r=G5PLuEcQc-XMZcqmyuPQrA&m=oxHW4S7DFVwVvsZaHH0XgZnhhmGkh8Gaj5N91x0ZNNU&s=g41X-zx9wRcnMql53jhfYV9kI47XWBhqNWD5BWazeBc&e=
> >-driver/<
> https://urldefense.proofpoint.com/v2/url?u=https-3A__drill.apache.org_docs_using-2Dthe-2Djdbc-2Ddriver_&d=DwIGaQ&c=cskdkSMqhcnjZxdQVpwTXg&r=G5PLuEcQc-XMZcqmyuPQrA&m=oxHW4S7DFVwVvsZaHH0XgZnhhmGkh8Gaj5N91x0ZNNU&s=g41X-zx9wRcnMql53jhfYV9kI47XWBhqNWD5BWazeBc&e=
> >
>
>         Thanks,
>
>         Arjun
>
>         Get Outlook for Android<
> https://urldefense.proofpoint.com/v2/url?u=https-3A__aka.ms_ghei36&d=DwIGaQ&c=cskdkSMqhcnjZxdQVpwTXg&r=G5PLuEcQc-XMZcqmyuPQrA&m=oxHW4S7DFVwVvsZaHH0XgZnhhmGkh8Gaj5N91x0ZNNU&s=sAuQzJT3xlBvr0R3la2Lx8ou1y9ua1oECbvGmEn1IGc&e=
> >
>
>         ________________________________
>         From: Khurram Faraaz <kf...@mapr.com>
>         Sent: Tuesday, January 8, 2019 11:17:58 PM
>         To: user@drill.apache.org
>         Subject: Re: Drill connection using jdbc
>
>         Hi Tushar,
>
>         This example works just fine for me, you may want to use the
> template
>
>         import org.apache.log4j.Logger;
>
>         import java.sql.Connection;
>         import java.sql.ResultSet;
>         import java.sql.SQLException;
>         import java.sql.Statement;
>         import java.sql.Types;
>         import java.sql.*;
>         import java.io.*;
>         import java.lang.*;
>         import java.util.*;
>         import java.util.Scanner;
>
>         public class TestQuery {
>
>         public static void main(String s[]) throws Exception {
>
>             Connection conn = null;
>             PreparedStatement prdstmnt = null;
>             try {
>                     // Please replace test1302-145 with your hostname,
> name of host
>         where Drillbit is up and running
>                     final String URL_STRING =
>         "jdbc:drill:schema=dfs.tmp;drillbit=test1302-145";
>
> Class.forName("org.apache.drill.jdbc.Driver").newInstance();
>
>                     // Please replace username and password with your
> username and
>         password
>                     conn =
> DriverManager.getConnection(URL_STRING,"mapr","mapr");
>                     prdstmnt = conn.prepareStatement("SELECT * FROM
>         cp.`employee.json`");
>                     prdstmnt.executeQuery();
>                     prdstmnt.close();
>             } catch (Exception e) {
>                System.out.println(e.getMessage());
>                e.printStackTrace();
>             } finally {
>                 if(conn != null)
>                     try { conn.close(); } catch(SQLException sqlexcpn){
>         sqlexcpn.printStackTrace(); }
>                 if(prdstmnt != null)
>                     try { prdstmnt.close(); } catch(SQLException sqlexcpn){
>         sqlexcpn.printStackTrace(); }
>                 }
>             }
>         }
>
>         Regards,
>         Khurram
>
>         On Tue, Jan 8, 2019 at 11:10 PM Tushar Pathare <tp...@sidra.org>
> wrote:
>
>         > Hello Team,
>         >
>         >                     We have installed drill 1.12.0 and trying to
> connect
>         > using a client to the drill cluster
>         >
>         > Our config for connection is
>         >
>         >
>         >
>         > Drill class is : org.apache.drill.jdbc.Driver
>         >
>         > Driver location is
>         >
> /Users/tpathare/Downloads/apache-drill-1.12.0/jars/jdbc-driver/drill-jdbc-all-1.12.0.jar
>         >
>         > Jdbc url is : jdbc:drill:zk=172.32.63.64:2181,172.32.63.65:2181,
>         > 172.32.63.67:2181
>         >
>         >
>         >
>         > When I hit connect I see the following error.Though the cluster
> is up and
>         > running and ZK is also good.
>         >
>         >
>         >
>         > *ERROR: An error occurred while trying to make a connection to *
>         >
>         > *the database:  *
>         >
>         >
>         >
>         > *JDBC URL: *
>         >
>         > *jdbc:drill:zk=172.32.63.64:2181
>         > <
> https://urldefense.proofpoint.com/v2/url?u=http-3A__172.32.63.64-3A2181&d=DwIGaQ&c=cskdkSMqhcnjZxdQVpwTXg&r=G5PLuEcQc-XMZcqmyuPQrA&m=oxHW4S7DFVwVvsZaHH0XgZnhhmGkh8Gaj5N91x0ZNNU&s=84dG2j74hfJ7kXZnSmKvXHwRvLXJGwNiPr7m2SZNzo0&e=
> >,172.32.63.65:2181
>         > <
> https://urldefense.proofpoint.com/v2/url?u=http-3A__172.32.63.65-3A2181&d=DwIGaQ&c=cskdkSMqhcnjZxdQVpwTXg&r=G5PLuEcQc-XMZcqmyuPQrA&m=oxHW4S7DFVwVvsZaHH0XgZnhhmGkh8Gaj5N91x0ZNNU&s=i7mXBx8Y16mFww13E6aPiRvjzdtI4U9BLysco9CykxI&e=
> >,172.32.63.67:2181/sidra-drillbit
>         > <
> https://urldefense.proofpoint.com/v2/url?u=http-3A__172.32.63.67-3A2181_sidra-2Ddrillbit&d=DwIGaQ&c=cskdkSMqhcnjZxdQVpwTXg&r=G5PLuEcQc-XMZcqmyuPQrA&m=oxHW4S7DFVwVvsZaHH0XgZnhhmGkh8Gaj5N91x0ZNNU&s=qA6mpFoPByc8Viz9MXjjcA9-_CH5xxQw-DS36WTcq1E&e=>
> *
>         >
>         >
>         >
>         > *Failure in connecting to Drill: *
>         >
>         > *oadd.org.apache.drill.exec.rpc.RpcException: Failure setting up
> *
>         >
>         > *ZK for client.*
>         >
>         >
>         >
>         >
>         >
>         >
>         >
>         > [image: cid:image001.png@01D3B9E9.23323D90]
>         >
>         > *Tushar Bhalchandra Pathare*
>         >
>         > Bigdata,GPFS,CSXF – Research Department
>         >
>         > *t. *+974 4003 7443
>         >
>         > *m.* +974 74793547
>         >
>         > PO BOX 26999 Doha, Qatar
>         >
>         > sidra.org
>         > <
> https://urldefense.proofpoint.com/v2/url?u=http-3A__www.sidra.org_&d=DwMGaQ&c=cskdkSMqhcnjZxdQVpwTXg&r=H5JEl9vb-mBIjic10QAbDD2vkUUKAxjO6wZO322RtdI&m=xCohfm7_vub0ExT6cMTEbB4WbjdIEPLdaXqXAOANq4A&s=kqudpk5v3cRasIbaMG8kwLBXafZ87VEhutJj7vxwhS4&e=
> >
>         >
>         >
>         > Disclaimer: This email and its attachments may be confidential
> and are
>         > intended solely for the use of the individual to whom it is
> addressed. If
>         > you are not the intended recipient, any reading, printing,
> storage,
>         > disclosure, copying or any other action taken in respect of this
> e-mail is
>         > prohibited and may be unlawful. If you are not the intended
> recipient,
>         > please notify the sender immediately by using the reply function
> and then
>         > permanently delete what you have received. Any views or opinions
> expressed
>         > are solely those of the author and do not necessarily represent
> those of
>         > Sidra Medical and Research Center.
>         >
>
>
>     Disclaimer: This email and its attachments may be confidential and are
> intended solely for the use of the individual to whom it is addressed. If
> you are not the intended recipient, any reading, printing, storage,
> disclosure, copying or any other action taken in respect of this e-mail is
> prohibited and may be unlawful. If you are not the intended recipient,
> please notify the sender immediately by using the reply function and then
> permanently delete what you have received. Any views or opinions expressed
> are solely those of the author and do not necessarily represent those of
> Sidra Medical and Research Center.
>
>
> Disclaimer: This email and its attachments may be confidential and are
> intended solely for the use of the individual to whom it is addressed. If
> you are not the intended recipient, any reading, printing, storage,
> disclosure, copying or any other action taken in respect of this e-mail is
> prohibited and may be unlawful. If you are not the intended recipient,
> please notify the sender immediately by using the reply function and then
> permanently delete what you have received. Any views or opinions expressed
> are solely those of the author and do not necessarily represent those of
> Sidra Medical and Research Center.
>

Re: Drill connection using jdbc

Posted by Tushar Pathare <tp...@sidra.org>.
Hello Team,
Same issue.


ERROR: An error occurred while trying to make a connection to
the database:

JDBC URL:
jdbc:drill:zk=172.32.63.64:2181/opt/apache-drill/sidra-drillbit

Failure in creating DrillConnectionImpl:
java.lang.IllegalStateException: No active Drillbit endpoint
found from ZooKeeper. Check connection parameters?


Tushar Bhalchandra Pathare
Bigdata,GPFS,CSXF – Research Department
t. +974 4003 7443
m. +974 74793547
PO BOX 26999 Doha, Qatar
sidra.org <http://www.sidra.org/>


On 1/9/19, 11:02 AM, "Arjun kr" <ar...@outlook.com> wrote:

    Yes. I believe its a necessary parameter if non default cluster I'd is used and given in the connection url. You can check if it works with directory specified.

    Get Outlook for Android<https://aka.ms/ghei36>

    ________________________________
    From: Tushar Pathare <tp...@sidra.org>
    Sent: Tuesday, January 8, 2019 11:40:22 PM
    To: user@drill.apache.org
    Subject: Re: Drill connection using jdbc

    Is it necessary because I thought it is optional including the cluster ID


    Tushar Bhalchandra Pathare
    Bigdata,GPFS,CSXF – Research Department
    t. +974 4003 7443
    m. +974 74793547
    PO BOX 26999 Doha, Qatar
    sidra.org <http://www.sidra.org/>


    On 1/9/19, 10:39 AM, "Arjun kr" <ar...@outlook.com> wrote:

        Are you missing drill zk directory in connection url?
        By default, it's value is drill.

        jdbc:drill:zk=<zk name>[:<port>][,<zk name2>[:<port>]...
        <directory>/<cluster ID>;[schema=<storage plugin>]


        https://drill.apache.org/docs/using-the-<https://drill.apache.org/docs/using-the-jdbc-driver/>jdbc<https://drill.apache.org/docs/using-the-jdbc-driver/>-driver/<https://drill.apache.org/docs/using-the-jdbc-driver/>

        Thanks,

        Arjun

        Get Outlook for Android<https://aka.ms/ghei36>

        ________________________________
        From: Khurram Faraaz <kf...@mapr.com>
        Sent: Tuesday, January 8, 2019 11:17:58 PM
        To: user@drill.apache.org
        Subject: Re: Drill connection using jdbc

        Hi Tushar,

        This example works just fine for me, you may want to use the template

        import org.apache.log4j.Logger;

        import java.sql.Connection;
        import java.sql.ResultSet;
        import java.sql.SQLException;
        import java.sql.Statement;
        import java.sql.Types;
        import java.sql.*;
        import java.io.*;
        import java.lang.*;
        import java.util.*;
        import java.util.Scanner;

        public class TestQuery {

        public static void main(String s[]) throws Exception {

            Connection conn = null;
            PreparedStatement prdstmnt = null;
            try {
                    // Please replace test1302-145 with your hostname, name of host
        where Drillbit is up and running
                    final String URL_STRING =
        "jdbc:drill:schema=dfs.tmp;drillbit=test1302-145";
                    Class.forName("org.apache.drill.jdbc.Driver").newInstance();

                    // Please replace username and password with your username and
        password
                    conn = DriverManager.getConnection(URL_STRING,"mapr","mapr");
                    prdstmnt = conn.prepareStatement("SELECT * FROM
        cp.`employee.json`");
                    prdstmnt.executeQuery();
                    prdstmnt.close();
            } catch (Exception e) {
               System.out.println(e.getMessage());
               e.printStackTrace();
            } finally {
                if(conn != null)
                    try { conn.close(); } catch(SQLException sqlexcpn){
        sqlexcpn.printStackTrace(); }
                if(prdstmnt != null)
                    try { prdstmnt.close(); } catch(SQLException sqlexcpn){
        sqlexcpn.printStackTrace(); }
                }
            }
        }

        Regards,
        Khurram

        On Tue, Jan 8, 2019 at 11:10 PM Tushar Pathare <tp...@sidra.org> wrote:

        > Hello Team,
        >
        >                     We have installed drill 1.12.0 and trying to connect
        > using a client to the drill cluster
        >
        > Our config for connection is
        >
        >
        >
        > Drill class is : org.apache.drill.jdbc.Driver
        >
        > Driver location is
        > /Users/tpathare/Downloads/apache-drill-1.12.0/jars/jdbc-driver/drill-jdbc-all-1.12.0.jar
        >
        > Jdbc url is : jdbc:drill:zk=172.32.63.64:2181,172.32.63.65:2181,
        > 172.32.63.67:2181
        >
        >
        >
        > When I hit connect I see the following error.Though the cluster is up and
        > running and ZK is also good.
        >
        >
        >
        > *ERROR: An error occurred while trying to make a connection to *
        >
        > *the database:  *
        >
        >
        >
        > *JDBC URL: *
        >
        > *jdbc:drill:zk=172.32.63.64:2181
        > <http://172.32.63.64:2181>,172.32.63.65:2181
        > <http://172.32.63.65:2181>,172.32.63.67:2181/sidra-drillbit
        > <http://172.32.63.67:2181/sidra-drillbit> *
        >
        >
        >
        > *Failure in connecting to Drill: *
        >
        > *oadd.org.apache.drill.exec.rpc.RpcException: Failure setting up *
        >
        > *ZK for client.*
        >
        >
        >
        >
        >
        >
        >
        > [image: cid:image001.png@01D3B9E9.23323D90]
        >
        > *Tushar Bhalchandra Pathare*
        >
        > Bigdata,GPFS,CSXF – Research Department
        >
        > *t. *+974 4003 7443
        >
        > *m.* +974 74793547
        >
        > PO BOX 26999 Doha, Qatar
        >
        > sidra.org
        > <https://urldefense.proofpoint.com/v2/url?u=http-3A__www.sidra.org_&d=DwMGaQ&c=cskdkSMqhcnjZxdQVpwTXg&r=H5JEl9vb-mBIjic10QAbDD2vkUUKAxjO6wZO322RtdI&m=xCohfm7_vub0ExT6cMTEbB4WbjdIEPLdaXqXAOANq4A&s=kqudpk5v3cRasIbaMG8kwLBXafZ87VEhutJj7vxwhS4&e=>
        >
        >
        > Disclaimer: This email and its attachments may be confidential and are
        > intended solely for the use of the individual to whom it is addressed. If
        > you are not the intended recipient, any reading, printing, storage,
        > disclosure, copying or any other action taken in respect of this e-mail is
        > prohibited and may be unlawful. If you are not the intended recipient,
        > please notify the sender immediately by using the reply function and then
        > permanently delete what you have received. Any views or opinions expressed
        > are solely those of the author and do not necessarily represent those of
        > Sidra Medical and Research Center.
        >


    Disclaimer: This email and its attachments may be confidential and are intended solely for the use of the individual to whom it is addressed. If you are not the intended recipient, any reading, printing, storage, disclosure, copying or any other action taken in respect of this e-mail is prohibited and may be unlawful. If you are not the intended recipient, please notify the sender immediately by using the reply function and then permanently delete what you have received. Any views or opinions expressed are solely those of the author and do not necessarily represent those of Sidra Medical and Research Center.


Disclaimer: This email and its attachments may be confidential and are intended solely for the use of the individual to whom it is addressed. If you are not the intended recipient, any reading, printing, storage, disclosure, copying or any other action taken in respect of this e-mail is prohibited and may be unlawful. If you are not the intended recipient, please notify the sender immediately by using the reply function and then permanently delete what you have received. Any views or opinions expressed are solely those of the author and do not necessarily represent those of Sidra Medical and Research Center.

Re: Drill connection using jdbc

Posted by Arjun kr <ar...@outlook.com>.
Yes. I believe its a necessary parameter if non default cluster I'd is used and given in the connection url. You can check if it works with directory specified.

Get Outlook for Android<https://aka.ms/ghei36>

________________________________
From: Tushar Pathare <tp...@sidra.org>
Sent: Tuesday, January 8, 2019 11:40:22 PM
To: user@drill.apache.org
Subject: Re: Drill connection using jdbc

Is it necessary because I thought it is optional including the cluster ID


Tushar Bhalchandra Pathare
Bigdata,GPFS,CSXF – Research Department
t. +974 4003 7443
m. +974 74793547
PO BOX 26999 Doha, Qatar
sidra.org <http://www.sidra.org/>


On 1/9/19, 10:39 AM, "Arjun kr" <ar...@outlook.com> wrote:

    Are you missing drill zk directory in connection url?
    By default, it's value is drill.

    jdbc:drill:zk=<zk name>[:<port>][,<zk name2>[:<port>]...
    <directory>/<cluster ID>;[schema=<storage plugin>]


    https://drill.apache.org/docs/using-the-<https://drill.apache.org/docs/using-the-jdbc-driver/>jdbc<https://drill.apache.org/docs/using-the-jdbc-driver/>-driver/<https://drill.apache.org/docs/using-the-jdbc-driver/>

    Thanks,

    Arjun

    Get Outlook for Android<https://aka.ms/ghei36>

    ________________________________
    From: Khurram Faraaz <kf...@mapr.com>
    Sent: Tuesday, January 8, 2019 11:17:58 PM
    To: user@drill.apache.org
    Subject: Re: Drill connection using jdbc

    Hi Tushar,

    This example works just fine for me, you may want to use the template

    import org.apache.log4j.Logger;

    import java.sql.Connection;
    import java.sql.ResultSet;
    import java.sql.SQLException;
    import java.sql.Statement;
    import java.sql.Types;
    import java.sql.*;
    import java.io.*;
    import java.lang.*;
    import java.util.*;
    import java.util.Scanner;

    public class TestQuery {

    public static void main(String s[]) throws Exception {

        Connection conn = null;
        PreparedStatement prdstmnt = null;
        try {
                // Please replace test1302-145 with your hostname, name of host
    where Drillbit is up and running
                final String URL_STRING =
    "jdbc:drill:schema=dfs.tmp;drillbit=test1302-145";
                Class.forName("org.apache.drill.jdbc.Driver").newInstance();

                // Please replace username and password with your username and
    password
                conn = DriverManager.getConnection(URL_STRING,"mapr","mapr");
                prdstmnt = conn.prepareStatement("SELECT * FROM
    cp.`employee.json`");
                prdstmnt.executeQuery();
                prdstmnt.close();
        } catch (Exception e) {
           System.out.println(e.getMessage());
           e.printStackTrace();
        } finally {
            if(conn != null)
                try { conn.close(); } catch(SQLException sqlexcpn){
    sqlexcpn.printStackTrace(); }
            if(prdstmnt != null)
                try { prdstmnt.close(); } catch(SQLException sqlexcpn){
    sqlexcpn.printStackTrace(); }
            }
        }
    }

    Regards,
    Khurram

    On Tue, Jan 8, 2019 at 11:10 PM Tushar Pathare <tp...@sidra.org> wrote:

    > Hello Team,
    >
    >                     We have installed drill 1.12.0 and trying to connect
    > using a client to the drill cluster
    >
    > Our config for connection is
    >
    >
    >
    > Drill class is : org.apache.drill.jdbc.Driver
    >
    > Driver location is
    > /Users/tpathare/Downloads/apache-drill-1.12.0/jars/jdbc-driver/drill-jdbc-all-1.12.0.jar
    >
    > Jdbc url is : jdbc:drill:zk=172.32.63.64:2181,172.32.63.65:2181,
    > 172.32.63.67:2181
    >
    >
    >
    > When I hit connect I see the following error.Though the cluster is up and
    > running and ZK is also good.
    >
    >
    >
    > *ERROR: An error occurred while trying to make a connection to *
    >
    > *the database:  *
    >
    >
    >
    > *JDBC URL: *
    >
    > *jdbc:drill:zk=172.32.63.64:2181
    > <http://172.32.63.64:2181>,172.32.63.65:2181
    > <http://172.32.63.65:2181>,172.32.63.67:2181/sidra-drillbit
    > <http://172.32.63.67:2181/sidra-drillbit> *
    >
    >
    >
    > *Failure in connecting to Drill: *
    >
    > *oadd.org.apache.drill.exec.rpc.RpcException: Failure setting up *
    >
    > *ZK for client.*
    >
    >
    >
    >
    >
    >
    >
    > [image: cid:image001.png@01D3B9E9.23323D90]
    >
    > *Tushar Bhalchandra Pathare*
    >
    > Bigdata,GPFS,CSXF – Research Department
    >
    > *t. *+974 4003 7443
    >
    > *m.* +974 74793547
    >
    > PO BOX 26999 Doha, Qatar
    >
    > sidra.org
    > <https://urldefense.proofpoint.com/v2/url?u=http-3A__www.sidra.org_&d=DwMGaQ&c=cskdkSMqhcnjZxdQVpwTXg&r=H5JEl9vb-mBIjic10QAbDD2vkUUKAxjO6wZO322RtdI&m=xCohfm7_vub0ExT6cMTEbB4WbjdIEPLdaXqXAOANq4A&s=kqudpk5v3cRasIbaMG8kwLBXafZ87VEhutJj7vxwhS4&e=>
    >
    >
    > Disclaimer: This email and its attachments may be confidential and are
    > intended solely for the use of the individual to whom it is addressed. If
    > you are not the intended recipient, any reading, printing, storage,
    > disclosure, copying or any other action taken in respect of this e-mail is
    > prohibited and may be unlawful. If you are not the intended recipient,
    > please notify the sender immediately by using the reply function and then
    > permanently delete what you have received. Any views or opinions expressed
    > are solely those of the author and do not necessarily represent those of
    > Sidra Medical and Research Center.
    >


Disclaimer: This email and its attachments may be confidential and are intended solely for the use of the individual to whom it is addressed. If you are not the intended recipient, any reading, printing, storage, disclosure, copying or any other action taken in respect of this e-mail is prohibited and may be unlawful. If you are not the intended recipient, please notify the sender immediately by using the reply function and then permanently delete what you have received. Any views or opinions expressed are solely those of the author and do not necessarily represent those of Sidra Medical and Research Center.

Re: Drill connection using jdbc

Posted by Tushar Pathare <tp...@sidra.org>.
Is it necessary because I thought it is optional including the cluster ID


Tushar Bhalchandra Pathare
Bigdata,GPFS,CSXF – Research Department
t. +974 4003 7443
m. +974 74793547
PO BOX 26999 Doha, Qatar
sidra.org <http://www.sidra.org/>


On 1/9/19, 10:39 AM, "Arjun kr" <ar...@outlook.com> wrote:

    Are you missing drill zk directory in connection url?
    By default, it's value is drill.

    jdbc:drill:zk=<zk name>[:<port>][,<zk name2>[:<port>]...
    <directory>/<cluster ID>;[schema=<storage plugin>]


    https://drill.apache.org/docs/using-the-<https://drill.apache.org/docs/using-the-jdbc-driver/>jdbc<https://drill.apache.org/docs/using-the-jdbc-driver/>-driver/<https://drill.apache.org/docs/using-the-jdbc-driver/>

    Thanks,

    Arjun

    Get Outlook for Android<https://aka.ms/ghei36>

    ________________________________
    From: Khurram Faraaz <kf...@mapr.com>
    Sent: Tuesday, January 8, 2019 11:17:58 PM
    To: user@drill.apache.org
    Subject: Re: Drill connection using jdbc

    Hi Tushar,

    This example works just fine for me, you may want to use the template

    import org.apache.log4j.Logger;

    import java.sql.Connection;
    import java.sql.ResultSet;
    import java.sql.SQLException;
    import java.sql.Statement;
    import java.sql.Types;
    import java.sql.*;
    import java.io.*;
    import java.lang.*;
    import java.util.*;
    import java.util.Scanner;

    public class TestQuery {

    public static void main(String s[]) throws Exception {

        Connection conn = null;
        PreparedStatement prdstmnt = null;
        try {
                // Please replace test1302-145 with your hostname, name of host
    where Drillbit is up and running
                final String URL_STRING =
    "jdbc:drill:schema=dfs.tmp;drillbit=test1302-145";
                Class.forName("org.apache.drill.jdbc.Driver").newInstance();

                // Please replace username and password with your username and
    password
                conn = DriverManager.getConnection(URL_STRING,"mapr","mapr");
                prdstmnt = conn.prepareStatement("SELECT * FROM
    cp.`employee.json`");
                prdstmnt.executeQuery();
                prdstmnt.close();
        } catch (Exception e) {
           System.out.println(e.getMessage());
           e.printStackTrace();
        } finally {
            if(conn != null)
                try { conn.close(); } catch(SQLException sqlexcpn){
    sqlexcpn.printStackTrace(); }
            if(prdstmnt != null)
                try { prdstmnt.close(); } catch(SQLException sqlexcpn){
    sqlexcpn.printStackTrace(); }
            }
        }
    }

    Regards,
    Khurram

    On Tue, Jan 8, 2019 at 11:10 PM Tushar Pathare <tp...@sidra.org> wrote:

    > Hello Team,
    >
    >                     We have installed drill 1.12.0 and trying to connect
    > using a client to the drill cluster
    >
    > Our config for connection is
    >
    >
    >
    > Drill class is : org.apache.drill.jdbc.Driver
    >
    > Driver location is
    > /Users/tpathare/Downloads/apache-drill-1.12.0/jars/jdbc-driver/drill-jdbc-all-1.12.0.jar
    >
    > Jdbc url is : jdbc:drill:zk=172.32.63.64:2181,172.32.63.65:2181,
    > 172.32.63.67:2181
    >
    >
    >
    > When I hit connect I see the following error.Though the cluster is up and
    > running and ZK is also good.
    >
    >
    >
    > *ERROR: An error occurred while trying to make a connection to *
    >
    > *the database:  *
    >
    >
    >
    > *JDBC URL: *
    >
    > *jdbc:drill:zk=172.32.63.64:2181
    > <http://172.32.63.64:2181>,172.32.63.65:2181
    > <http://172.32.63.65:2181>,172.32.63.67:2181/sidra-drillbit
    > <http://172.32.63.67:2181/sidra-drillbit> *
    >
    >
    >
    > *Failure in connecting to Drill: *
    >
    > *oadd.org.apache.drill.exec.rpc.RpcException: Failure setting up *
    >
    > *ZK for client.*
    >
    >
    >
    >
    >
    >
    >
    > [image: cid:image001.png@01D3B9E9.23323D90]
    >
    > *Tushar Bhalchandra Pathare*
    >
    > Bigdata,GPFS,CSXF – Research Department
    >
    > *t. *+974 4003 7443
    >
    > *m.* +974 74793547
    >
    > PO BOX 26999 Doha, Qatar
    >
    > sidra.org
    > <https://urldefense.proofpoint.com/v2/url?u=http-3A__www.sidra.org_&d=DwMGaQ&c=cskdkSMqhcnjZxdQVpwTXg&r=H5JEl9vb-mBIjic10QAbDD2vkUUKAxjO6wZO322RtdI&m=xCohfm7_vub0ExT6cMTEbB4WbjdIEPLdaXqXAOANq4A&s=kqudpk5v3cRasIbaMG8kwLBXafZ87VEhutJj7vxwhS4&e=>
    >
    >
    > Disclaimer: This email and its attachments may be confidential and are
    > intended solely for the use of the individual to whom it is addressed. If
    > you are not the intended recipient, any reading, printing, storage,
    > disclosure, copying or any other action taken in respect of this e-mail is
    > prohibited and may be unlawful. If you are not the intended recipient,
    > please notify the sender immediately by using the reply function and then
    > permanently delete what you have received. Any views or opinions expressed
    > are solely those of the author and do not necessarily represent those of
    > Sidra Medical and Research Center.
    >


Disclaimer: This email and its attachments may be confidential and are intended solely for the use of the individual to whom it is addressed. If you are not the intended recipient, any reading, printing, storage, disclosure, copying or any other action taken in respect of this e-mail is prohibited and may be unlawful. If you are not the intended recipient, please notify the sender immediately by using the reply function and then permanently delete what you have received. Any views or opinions expressed are solely those of the author and do not necessarily represent those of Sidra Medical and Research Center.

Re: Drill connection using jdbc

Posted by Arjun kr <ar...@outlook.com>.
Are you missing drill zk directory in connection url?
By default, it's value is drill.

jdbc:drill:zk=<zk name>[:<port>][,<zk name2>[:<port>]...
<directory>/<cluster ID>;[schema=<storage plugin>]


https://drill.apache.org/docs/using-the-<https://drill.apache.org/docs/using-the-jdbc-driver/>jdbc<https://drill.apache.org/docs/using-the-jdbc-driver/>-driver/<https://drill.apache.org/docs/using-the-jdbc-driver/>

Thanks,

Arjun

Get Outlook for Android<https://aka.ms/ghei36>

________________________________
From: Khurram Faraaz <kf...@mapr.com>
Sent: Tuesday, January 8, 2019 11:17:58 PM
To: user@drill.apache.org
Subject: Re: Drill connection using jdbc

Hi Tushar,

This example works just fine for me, you may want to use the template

import org.apache.log4j.Logger;

import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.sql.Types;
import java.sql.*;
import java.io.*;
import java.lang.*;
import java.util.*;
import java.util.Scanner;

public class TestQuery {

public static void main(String s[]) throws Exception {

    Connection conn = null;
    PreparedStatement prdstmnt = null;
    try {
            // Please replace test1302-145 with your hostname, name of host
where Drillbit is up and running
            final String URL_STRING =
"jdbc:drill:schema=dfs.tmp;drillbit=test1302-145";
            Class.forName("org.apache.drill.jdbc.Driver").newInstance();

            // Please replace username and password with your username and
password
            conn = DriverManager.getConnection(URL_STRING,"mapr","mapr");
            prdstmnt = conn.prepareStatement("SELECT * FROM
cp.`employee.json`");
            prdstmnt.executeQuery();
            prdstmnt.close();
    } catch (Exception e) {
       System.out.println(e.getMessage());
       e.printStackTrace();
    } finally {
        if(conn != null)
            try { conn.close(); } catch(SQLException sqlexcpn){
sqlexcpn.printStackTrace(); }
        if(prdstmnt != null)
            try { prdstmnt.close(); } catch(SQLException sqlexcpn){
sqlexcpn.printStackTrace(); }
        }
    }
}

Regards,
Khurram

On Tue, Jan 8, 2019 at 11:10 PM Tushar Pathare <tp...@sidra.org> wrote:

> Hello Team,
>
>                     We have installed drill 1.12.0 and trying to connect
> using a client to the drill cluster
>
> Our config for connection is
>
>
>
> Drill class is : org.apache.drill.jdbc.Driver
>
> Driver location is
> /Users/tpathare/Downloads/apache-drill-1.12.0/jars/jdbc-driver/drill-jdbc-all-1.12.0.jar
>
> Jdbc url is : jdbc:drill:zk=172.32.63.64:2181,172.32.63.65:2181,
> 172.32.63.67:2181
>
>
>
> When I hit connect I see the following error.Though the cluster is up and
> running and ZK is also good.
>
>
>
> *ERROR: An error occurred while trying to make a connection to *
>
> *the database:  *
>
>
>
> *JDBC URL: *
>
> *jdbc:drill:zk=172.32.63.64:2181
> <http://172.32.63.64:2181>,172.32.63.65:2181
> <http://172.32.63.65:2181>,172.32.63.67:2181/sidra-drillbit
> <http://172.32.63.67:2181/sidra-drillbit> *
>
>
>
> *Failure in connecting to Drill: *
>
> *oadd.org.apache.drill.exec.rpc.RpcException: Failure setting up *
>
> *ZK for client.*
>
>
>
>
>
>
>
> [image: cid:image001.png@01D3B9E9.23323D90]
>
> *Tushar Bhalchandra Pathare*
>
> Bigdata,GPFS,CSXF – Research Department
>
> *t. *+974 4003 7443
>
> *m.* +974 74793547
>
> PO BOX 26999 Doha, Qatar
>
> sidra.org
> <https://urldefense.proofpoint.com/v2/url?u=http-3A__www.sidra.org_&d=DwMGaQ&c=cskdkSMqhcnjZxdQVpwTXg&r=H5JEl9vb-mBIjic10QAbDD2vkUUKAxjO6wZO322RtdI&m=xCohfm7_vub0ExT6cMTEbB4WbjdIEPLdaXqXAOANq4A&s=kqudpk5v3cRasIbaMG8kwLBXafZ87VEhutJj7vxwhS4&e=>
>
>
> Disclaimer: This email and its attachments may be confidential and are
> intended solely for the use of the individual to whom it is addressed. If
> you are not the intended recipient, any reading, printing, storage,
> disclosure, copying or any other action taken in respect of this e-mail is
> prohibited and may be unlawful. If you are not the intended recipient,
> please notify the sender immediately by using the reply function and then
> permanently delete what you have received. Any views or opinions expressed
> are solely those of the author and do not necessarily represent those of
> Sidra Medical and Research Center.
>

Re: Drill connection using jdbc

Posted by Khurram Faraaz <kf...@mapr.com>.
Hi Tushar,

This example works just fine for me, you may want to use the template

import org.apache.log4j.Logger;

import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.sql.Types;
import java.sql.*;
import java.io.*;
import java.lang.*;
import java.util.*;
import java.util.Scanner;

public class TestQuery {

public static void main(String s[]) throws Exception {

    Connection conn = null;
    PreparedStatement prdstmnt = null;
    try {
            // Please replace test1302-145 with your hostname, name of host
where Drillbit is up and running
            final String URL_STRING =
"jdbc:drill:schema=dfs.tmp;drillbit=test1302-145";
            Class.forName("org.apache.drill.jdbc.Driver").newInstance();

            // Please replace username and password with your username and
password
            conn = DriverManager.getConnection(URL_STRING,"mapr","mapr");
            prdstmnt = conn.prepareStatement("SELECT * FROM
cp.`employee.json`");
            prdstmnt.executeQuery();
            prdstmnt.close();
    } catch (Exception e) {
       System.out.println(e.getMessage());
       e.printStackTrace();
    } finally {
        if(conn != null)
            try { conn.close(); } catch(SQLException sqlexcpn){
sqlexcpn.printStackTrace(); }
        if(prdstmnt != null)
            try { prdstmnt.close(); } catch(SQLException sqlexcpn){
sqlexcpn.printStackTrace(); }
        }
    }
}

Regards,
Khurram

On Tue, Jan 8, 2019 at 11:10 PM Tushar Pathare <tp...@sidra.org> wrote:

> Hello Team,
>
>                     We have installed drill 1.12.0 and trying to connect
> using a client to the drill cluster
>
> Our config for connection is
>
>
>
> Drill class is : org.apache.drill.jdbc.Driver
>
> Driver location is
> /Users/tpathare/Downloads/apache-drill-1.12.0/jars/jdbc-driver/drill-jdbc-all-1.12.0.jar
>
> Jdbc url is : jdbc:drill:zk=172.32.63.64:2181,172.32.63.65:2181,
> 172.32.63.67:2181
>
>
>
> When I hit connect I see the following error.Though the cluster is up and
> running and ZK is also good.
>
>
>
> *ERROR: An error occurred while trying to make a connection to *
>
> *the database:  *
>
>
>
> *JDBC URL: *
>
> *jdbc:drill:zk=172.32.63.64:2181
> <http://172.32.63.64:2181>,172.32.63.65:2181
> <http://172.32.63.65:2181>,172.32.63.67:2181/sidra-drillbit
> <http://172.32.63.67:2181/sidra-drillbit> *
>
>
>
> *Failure in connecting to Drill: *
>
> *oadd.org.apache.drill.exec.rpc.RpcException: Failure setting up *
>
> *ZK for client.*
>
>
>
>
>
>
>
> [image: cid:image001.png@01D3B9E9.23323D90]
>
> *Tushar Bhalchandra Pathare*
>
> Bigdata,GPFS,CSXF – Research Department
>
> *t. *+974 4003 7443
>
> *m.* +974 74793547
>
> PO BOX 26999 Doha, Qatar
>
> sidra.org
> <https://urldefense.proofpoint.com/v2/url?u=http-3A__www.sidra.org_&d=DwMGaQ&c=cskdkSMqhcnjZxdQVpwTXg&r=H5JEl9vb-mBIjic10QAbDD2vkUUKAxjO6wZO322RtdI&m=xCohfm7_vub0ExT6cMTEbB4WbjdIEPLdaXqXAOANq4A&s=kqudpk5v3cRasIbaMG8kwLBXafZ87VEhutJj7vxwhS4&e=>
>
>
> Disclaimer: This email and its attachments may be confidential and are
> intended solely for the use of the individual to whom it is addressed. If
> you are not the intended recipient, any reading, printing, storage,
> disclosure, copying or any other action taken in respect of this e-mail is
> prohibited and may be unlawful. If you are not the intended recipient,
> please notify the sender immediately by using the reply function and then
> permanently delete what you have received. Any views or opinions expressed
> are solely those of the author and do not necessarily represent those of
> Sidra Medical and Research Center.
>