Categories
Programming Random

Apache Drill: Error Starting Drill in Embedded Mode

I’ve been checking out Apache Drill and everything was fine, until today. I tried running Drill in embedded mode, per usual, when I ran into the following exception:

Error: Failure in connecting to Drill: org.apache.drill.exec.rpc.RpcException: CONNECTION : io.netty.channel.ConnectTimeoutException: connection timed out: /192.168.21.62:31010 (state=,code=0)

java.sql.SQLException: Failure in connecting to Drill: org.apache.drill.exec.rpc.RpcException: CONNECTION : io.netty.channel.ConnectTimeoutException: connection timed out: /192.168.21.62:31010

at org.apache.drill.jdbc.impl.DrillConnectionImpl.<init>(DrillConnectionImpl.java:159)

at org.apache.drill.jdbc.impl.DrillJdbc41Factory.newDrillConnection(DrillJdbc41Factory.java:64)

at org.apache.drill.jdbc.impl.DrillFactory.newConnection(DrillFactory.java:69)

at net.hydromatic.avatica.UnregisteredDriver.connect(UnregisteredDriver.java:126)

at org.apache.drill.jdbc.Driver.connect(Driver.java:72)

at sqlline.DatabaseConnection.connect(DatabaseConnection.java:167)

at sqlline.DatabaseConnection.getConnection(DatabaseConnection.java:213)

at sqlline.Commands.connect(Commands.java:1083)

at sqlline.Commands.connect(Commands.java:1015)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.lang.reflect.Method.invoke(Method.java:606)

at sqlline.ReflectiveCommandHandler.execute(ReflectiveCommandHandler.java:36)

at sqlline.SqlLine.dispatch(SqlLine.java:742)

at sqlline.SqlLine.initArgs(SqlLine.java:528)

at sqlline.SqlLine.begin(SqlLine.java:596)

at sqlline.SqlLine.start(SqlLine.java:375)

at sqlline.SqlLine.main(SqlLine.java:268)

Caused by: org.apache.drill.exec.rpc.RpcException: CONNECTION : io.netty.channel.ConnectTimeoutException: connection timed out: /192.168.21.62:31010

at org.apache.drill.exec.client.DrillClient$FutureHandler.connectionFailed(DrillClient.java:448)

at org.apache.drill.exec.rpc.BasicClient$ConnectionMultiListener$ConnectionHandler.operationComplete(BasicClient.java:237)

at org.apache.drill.exec.rpc.BasicClient$ConnectionMultiListener$ConnectionHandler.operationComplete(BasicClient.java:200)

at io.netty.util.concurrent.DefaultPromise.notifyListener0(DefaultPromise.java:680)

at io.netty.util.concurrent.DefaultPromise.notifyListeners0(DefaultPromise.java:603)

at io.netty.util.concurrent.DefaultPromise.notifyListeners(DefaultPromise.java:563)

at io.netty.util.concurrent.DefaultPromise.tryFailure(DefaultPromise.java:424)

at io.netty.channel.nio.AbstractNioChannel$AbstractNioUnsafe$1.run(AbstractNioChannel.java:214)

at io.netty.util.concurrent.PromiseTask$RunnableAdapter.call(PromiseTask.java:38)

at io.netty.util.concurrent.ScheduledFutureTask.run(ScheduledFutureTask.java:120)

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: io.netty.channel.ConnectTimeoutException: connection timed out: /192.168.21.62:31010

at io.netty.util.concurrent.AbstractFuture.get(AbstractFuture.java:47)

at org.apache.drill.exec.rpc.BasicClient$ConnectionMultiListener$ConnectionHandler.operationComplete(BasicClient.java:213)

... 12 more

Caused by: io.netty.channel.ConnectTimeoutException: connection timed out: /192.168.21.62:31010

at io.netty.channel.nio.AbstractNioChannel$AbstractNioUnsafe$1.run(AbstractNioChannel.java:212)

... 6 more

INFO: Initiating Jersey application, version Jersey: 2.8 2014-04-29 01:25:26...

Error: Failure in starting embedded Drillbit: java.net.BindException: Address already in use (state=,code=0)

java.sql.SQLException: Failure in starting embedded Drillbit: java.net.BindException: Address already in use

at org.apache.drill.jdbc.impl.DrillConnectionImpl.<init>(DrillConnectionImpl.java:127)

at org.apache.drill.jdbc.impl.DrillJdbc41Factory.newDrillConnection(DrillJdbc41Factory.java:64)

at org.apache.drill.jdbc.impl.DrillFactory.newConnection(DrillFactory.java:69)

at net.hydromatic.avatica.UnregisteredDriver.connect(UnregisteredDriver.java:126)

at org.apache.drill.jdbc.Driver.connect(Driver.java:72)

at sqlline.DatabaseConnection.connect(DatabaseConnection.java:167)

at sqlline.DatabaseConnection.getConnection(DatabaseConnection.java:213)

at sqlline.Commands.close(Commands.java:925)

at sqlline.Commands.quit(Commands.java:889)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.lang.reflect.Method.invoke(Method.java:606)

at sqlline.ReflectiveCommandHandler.execute(ReflectiveCommandHandler.java:36)

at sqlline.SqlLine.dispatch(SqlLine.java:742)

at sqlline.SqlLine.begin(SqlLine.java:621)

at sqlline.SqlLine.start(SqlLine.java:375)

at sqlline.SqlLine.main(SqlLine.java:268)

Caused by: java.net.BindException: Address already in use

at sun.nio.ch.Net.bind0(Native Method)

at sun.nio.ch.Net.bind(Net.java:444)

at sun.nio.ch.Net.bind(Net.java:436)

at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:214)

at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74)

at org.eclipse.jetty.server.ServerConnector.open(ServerConnector.java:279)

at org.eclipse.jetty.server.AbstractNetworkConnector.doStart(AbstractNetworkConnector.java:80)

at org.eclipse.jetty.server.ServerConnector.doStart(ServerConnector.java:218)

at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)

at org.eclipse.jetty.server.Server.doStart(Server.java:337)

at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)

at org.apache.drill.exec.server.rest.WebServer.start(WebServer.java:130)

at org.apache.drill.exec.server.Drillbit.run(Drillbit.java:217)

at org.apache.drill.jdbc.impl.DrillConnectionImpl.<init>(DrillConnectionImpl.java:118)

... 17 more

Feb 18, 2016 12:58:03 PM org.glassfish.jersey.server.ApplicationHandler initialize

INFO: Initiating Jersey application, version Jersey: 2.8 2014-04-29 01:25:26...

Error: Failure in starting embedded Drillbit: java.net.BindException: Address already in use (state=,code=0)

java.sql.SQLException: Failure in starting embedded Drillbit: java.net.BindException: Address already in use

at org.apache.drill.jdbc.impl.DrillConnectionImpl.<init>(DrillConnectionImpl.java:127)

at org.apache.drill.jdbc.impl.DrillJdbc41Factory.newDrillConnection(DrillJdbc41Factory.java:64)

at org.apache.drill.jdbc.impl.DrillFactory.newConnection(DrillFactory.java:69)

at net.hydromatic.avatica.UnregisteredDriver.connect(UnregisteredDriver.java:126)

at org.apache.drill.jdbc.Driver.connect(Driver.java:72)

at sqlline.DatabaseConnection.connect(DatabaseConnection.java:167)

at sqlline.DatabaseConnection.getConnection(DatabaseConnection.java:213)

at sqlline.Commands.close(Commands.java:925)

at sqlline.Commands.closeall(Commands.java:899)

at sqlline.SqlLine.begin(SqlLine.java:649)

at sqlline.SqlLine.start(SqlLine.java:375)

at sqlline.SqlLine.main(SqlLine.java:268)

Caused by: java.net.BindException: Address already in use

at sun.nio.ch.Net.bind0(Native Method)

at sun.nio.ch.Net.bind(Net.java:444)

at sun.nio.ch.Net.bind(Net.java:436)

at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:214)

at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74)

at org.eclipse.jetty.server.ServerConnector.open(ServerConnector.java:279)

at org.eclipse.jetty.server.AbstractNetworkConnector.doStart(AbstractNetworkConnector.java:80)

at org.eclipse.jetty.server.ServerConnector.doStart(ServerConnector.java:218)

at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)

at org.eclipse.jetty.server.Server.doStart(Server.java:337)

at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)

at org.apache.drill.exec.server.rest.WebServer.start(WebServer.java:130)

at org.apache.drill.exec.server.Drillbit.run(Drillbit.java:217)

at org.apache.drill.jdbc.impl.DrillConnectionImpl.<init>(DrillConnectionImpl.java:118)

... 11 more

Well, OK then. I tried Googling the exception, fully expecting this to happen to others, but Google didn’t have an answer either. So I searched for an answer in Apache Drill’s documentation (https://drill.apache.org/docs/troubleshooting/#error-starting-drill-in-embedded-mode):

Error Starting Drill in Embedded Mode

Symptom: java.net.BindException: Address already in use Solution: You can only run one Drillbit per node in embedded or distributed mode using default settings. You need to either change ports used by Drillbit or stop one Drillbit before starting another.

This didn’t provide me with an answer either, so I was pretty much on my own. I carefully re-read the exception, and it appeared to me that it was trying to connect using an IP address that wasn’t local to my machine.

So I turned off my wi-fi, ran drill-embedded, and it ran fine.

OK.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s