drill-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jingguo Yao (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (DRILL-3075) Connecting to Drill via JDBC fails with UnresolvedAddressException when URL contains ZK info
Date Thu, 05 May 2016 07:30:12 GMT

    [ https://issues.apache.org/jira/browse/DRILL-3075?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15272015#comment-15272015
] 

Jingguo Yao commented on DRILL-3075:
------------------------------------

If the url contains `zk` parameter, host names and port numbers for drillbit servers are retrieved
from Zookeeper. You can check whether you can connect to these  drillbit servers with the
information from Zookeeper.

> Connecting to Drill via JDBC fails with UnresolvedAddressException when URL contains
ZK info
> --------------------------------------------------------------------------------------------
>
>                 Key: DRILL-3075
>                 URL: https://issues.apache.org/jira/browse/DRILL-3075
>             Project: Apache Drill
>          Issue Type: Bug
>          Components: Client - JDBC
>    Affects Versions: 1.0.0
>            Reporter: Abhishek Girish
>             Fix For: Future
>
>
> Connecting to Drill via JDBC fails if the URL contains the ZK host:port:
> {code}
>         ...
>         String schema = "dfs.tmp";
>         String zookeepers = "10.10.103.32:5181/drill/drillbits1"; 
>         String url = "jdbc:drill:schema="+schema+";zk="+zookeepers;
>         
>         Connection conn = null;
>         Statement stmt = null;
>        
>         String query = "select * from dfs.tpch100.customer limit 1";
>       
>         try{
>             
>             Class.forName("org.apache.drill.jdbc.Driver");
>             conn = DriverManager.getConnection(url,"root","root");
>             
>             stmt = conn.createStatement(); 
>            ...
> {code} 
> The following code fails to connect to Drill with the following error:
> {code}
> java.sql.SQLException: Failure while attempting to connect to Drill: CONNECTION : java.nio.channels.UnresolvedAddressException
> 	at org.apache.drill.jdbc.DrillConnectionImpl.<init>(DrillConnectionImpl.java:123)
> 	at org.apache.drill.jdbc.DrillJdbc41Factory$DrillJdbc41Connection.<init>(DrillJdbc41Factory.java:97)
> 	at org.apache.drill.jdbc.DrillJdbc41Factory.newDrillConnection(DrillJdbc41Factory.java:60)
> 	at org.apache.drill.jdbc.DrillJdbc41Factory.newDrillConnection(DrillJdbc41Factory.java:46)
> 	at org.apache.drill.jdbc.DrillFactory.newConnection(DrillFactory.java:54)
> 	at net.hydromatic.avatica.UnregisteredDriver.connect(UnregisteredDriver.java:126)
> 	at java.sql.DriverManager.getConnection(DriverManager.java:571)
> 	at java.sql.DriverManager.getConnection(DriverManager.java:215)
> 	at drill.DrillJDBC.main(DrillJDBC.java:39)
> Caused by: org.apache.drill.exec.rpc.RpcException: CONNECTION : java.nio.channels.UnresolvedAddressException
> 	at org.apache.drill.exec.client.DrillClient$FutureHandler.connectionFailed(DrillClient.java:414)
> 	at org.apache.drill.exec.rpc.BasicClient$ConnectionMultiListener$ConnectionHandler.operationComplete(BasicClient.java:209)
> 	at org.apache.drill.exec.rpc.BasicClient$ConnectionMultiListener$ConnectionHandler.operationComplete(BasicClient.java:193)
> 	at io.netty.util.concurrent.DefaultPromise.notifyListener0(DefaultPromise.java:680)
> 	at io.netty.util.concurrent.DefaultPromise.notifyListeners(DefaultPromise.java:567)
> 	at io.netty.util.concurrent.DefaultPromise.tryFailure(DefaultPromise.java:424)
> 	at io.netty.channel.nio.AbstractNioChannel$AbstractNioUnsafe.connect(AbstractNioChannel.java:235)
> 	at io.netty.channel.DefaultChannelPipeline$HeadContext.connect(DefaultChannelPipeline.java:1089)
> 	at io.netty.channel.AbstractChannelHandlerContext.invokeConnect(AbstractChannelHandlerContext.java:543)
> 	at io.netty.channel.AbstractChannelHandlerContext.connect(AbstractChannelHandlerContext.java:528)
> 	at io.netty.channel.ChannelOutboundHandlerAdapter.connect(ChannelOutboundHandlerAdapter.java:47)
> 	at io.netty.channel.AbstractChannelHandlerContext.invokeConnect(AbstractChannelHandlerContext.java:543)
> 	at io.netty.channel.AbstractChannelHandlerContext.connect(AbstractChannelHandlerContext.java:528)
> 	at io.netty.channel.ChannelDuplexHandler.connect(ChannelDuplexHandler.java:50)
> 	at io.netty.channel.AbstractChannelHandlerContext.invokeConnect(AbstractChannelHandlerContext.java:543)
> 	at io.netty.channel.AbstractChannelHandlerContext.connect(AbstractChannelHandlerContext.java:528)
> 	at io.netty.channel.AbstractChannelHandlerContext.connect(AbstractChannelHandlerContext.java:510)
> 	at io.netty.channel.DefaultChannelPipeline.connect(DefaultChannelPipeline.java:909)
> 	at io.netty.channel.AbstractChannel.connect(AbstractChannel.java:203)
> 	at io.netty.bootstrap.Bootstrap$2.run(Bootstrap.java:165)
> 	at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:357)
> 	at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:357)
> 	at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:111)
> 	at java.lang.Thread.run(Thread.java:745)
> Caused by: java.util.concurrent.ExecutionException: java.nio.channels.UnresolvedAddressException
> 	at io.netty.util.concurrent.AbstractFuture.get(AbstractFuture.java:37)
> 	at org.apache.drill.exec.rpc.BasicClient$ConnectionMultiListener$ConnectionHandler.operationComplete(BasicClient.java:199)
> 	... 22 more
> Caused by: java.nio.channels.UnresolvedAddressException
> 	at sun.nio.ch.Net.checkAddress(Net.java:127)
> 	at sun.nio.ch.SocketChannelImpl.connect(SocketChannelImpl.java:644)
> 	at io.netty.channel.socket.nio.NioSocketChannel.doConnect(NioSocketChannel.java:209)
> 	at io.netty.channel.nio.AbstractNioChannel$AbstractNioUnsafe.connect(AbstractNioChannel.java:199)
> 	... 17 more
> {code}
> Can connect when the URL is changed from 
> {code}
> String url = "jdbc:drill:schema="+schema+";zk=10.10.103.32:5181/drill/drillbits1";
> to
> String url = "jdbc:drill:schema="+schema+";drillbit=10.10.103.32";
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message