Apache Drill JDBC无法在Windowns 10上使用所有默认值

时间:2017-11-21 05:18:26

标签: java jdbc apache-drill

我在使JDBC连接工作时遇到问题。非常感谢你的帮助。

  1. 在Windows 10 Pro,ODBC驱动程序上安装Drill,启动并运行 本地节点(如 https://drill.apache.org/docs/drill-in-10-minutes/
  2. 可以使用ODBC从Drill Explorer连接和查询。
  3. 钻壳:

    Drill Shell

    JDBC:

    JDBC

    别名:

    Alias

    但是当我尝试从(https://drill.apache.org/docs/using-jdbc-with-squirrel-on-windows/)中的SQuirreL连接时,它无效。 我使用/jars/jdbc-driver/drill-jdbc-all-.jar进行JDBC连接。

    java.io.IOException: Failure to connect to the zookeeper cluster service within the allotted time of 10000 milliseconds.
    at oadd.org.apache.drill.exec.coord.zk.ZKClusterCoordinator.start(ZKClusterCoordinator.java:123)
    at oadd.org.apache.drill.exec.client.DrillClient.connect(DrillClient.java:327)
    at org.apache.drill.jdbc.impl.DrillConnectionImpl.<init>(DrillConnectionImpl.java:158)
    at org.apache.drill.jdbc.impl.DrillJdbc41Factory.newDrillConnection(DrillJdbc41Factory.java:72)
    at org.apache.drill.jdbc.impl.DrillFactory.newConnection(DrillFactory.java:69)
    at oadd.org.apache.calcite.avatica.UnregisteredDriver.connect(UnregisteredDriver.java:143)
    at org.apache.drill.jdbc.Driver.connect(Driver.java:72)
    at net.sourceforge.squirrel_sql.fw.sql.SQLDriverManager.getConnection(SQLDriverManager.java:133)
    at net.sourceforge.squirrel_sql.client.mainframe.action.OpenConnectionCommand.executeConnect(OpenConnectionCommand.java:167)
    at net.sourceforge.squirrel_sql.client.mainframe.action.OpenConnectionCommand.access$000(OpenConnectionCommand.java:45)
    at net.sourceforge.squirrel_sql.client.mainframe.action.OpenConnectionCommand$1.run(OpenConnectionCommand.java:104)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)
    

2 个答案:

答案 0 :(得分:0)

我认为你不能使用ZooKeeper“本地”,因为你是通过JDBC来自“外部”源。尝试将其更改为“localhost”或您的主机名。

答案 1 :(得分:0)

最后,这篇文章有助于解决我的问题。 Apache Drill - connection to Drill in Embedded Mode [java]

通过使用,jdbc:drill:drillbit = 192.xxx.xxx.xxx,当钻取运行时,我可以成功连接..