钻取JDBC zookeeper超时错误

时间:2016-01-26 13:51:30

标签: hadoop jdbc apache-zookeeper apache-drill

通过jdbc IF执行Drill查询的代码运行无错误:

//val hdpConf = new Configuration()
//val fs = FileSystem.get(hdpConf)
runDrillJdbc()

但是,如果我取消注释行创建 fs实例,则在创建连接DriverManager.getConnection(jdbcUri)时代码会出现以下错误:

16/01/26 08:41:10 ERROR ConnectionState: Connection timed out for connection string (xx:xx) and timeout (5000) / elapsed (5325)
oadd.org.apache.curator.CuratorConnectionLossException: KeeperErrorCode = ConnectionLoss
    at oadd.org.apache.curator.ConnectionState.checkTimeouts(ConnectionState.java:198)
    at oadd.org.apache.curator.ConnectionState.getZooKeeper(ConnectionState.java:88)
    at oadd.org.apache.curator.CuratorZookeeperClient.getZooKeeper(CuratorZookeeperClient.java:115)
    at oadd.org.apache.curator.utils.EnsurePath$InitialHelper$1.call(EnsurePath.java:148)
    at oadd.org.apache.curator.RetryLoop.callWithRetry(RetryLoop.java:107)
    at oadd.org.apache.curator.utils.EnsurePath$InitialHelper.ensure(EnsurePath.java:140)
    at oadd.org.apache.curator.utils.EnsurePath.ensure(EnsurePath.java:99)
    at oadd.org.apache.curator.framework.imps.NamespaceImpl.fixForNamespace(NamespaceImpl.java:74)
    at oadd.org.apache.curator.framework.imps.NamespaceImpl.newNamespaceAwareEnsurePath(NamespaceImpl.java:87)
    at oadd.org.apache.curator.framework.imps.CuratorFrameworkImpl.newNamespaceAwareEnsurePath(CuratorFrameworkImpl.java:468)
    at oadd.org.apache.curator.framework.recipes.cache.PathChildrenCache.<init>(PathChildrenCache.java:223)
    at oadd.org.apache.curator.framework.recipes.cache.PathChildrenCache.<init>(PathChildrenCache.java:182)
    at oadd.org.apache.curator.x.discovery.details.ServiceCacheImpl.<init>(ServiceCacheImpl.java:65)
    at oadd.org.apache.curator.x.discovery.details.ServiceCacheBuilderImpl.build(ServiceCacheBuilderImpl.java:47)
    at oadd.org.apache.drill.exec.coord.zk.ZKClusterCoordinator.<init>(ZKClusterCoordinator.java:104)
    at oadd.org.apache.drill.exec.client.DrillClient.connect(DrillClient.java:185)
    at org.apache.drill.jdbc.impl.DrillConnectionImpl.<init>(DrillConnectionImpl.java:134)
    at org.apache.drill.jdbc.impl.DrillJdbc41Factory.newDrillConnection(DrillJdbc41Factory.java:66)
    at org.apache.drill.jdbc.impl.DrillFactory.newConnection(DrillFactory.java:69)
    at oadd.net.hydromatic.avatica.UnregisteredDriver.connect(UnregisteredDriver.java:126)
    at org.apache.drill.jdbc.Driver.connect(Driver.java:72)
    at java.sql.DriverManager.getConnection(DriverManager.java:664)
    at java.sql.DriverManager.getConnection(DriverManager.java:270)
    ...

注意,我隐藏了zk uri,因为它与特定情况无关。

1 个答案:

答案 0 :(得分:0)

Standart发行版中的钻取JDBC与MapR分发版不完全兼容。从MapR站点下载JDBC并设置guava库解决问题。