Error while starting Druid [v0.8.1] java.net.BindException: Address already in use

Hi,

I am new to Druid.

I was trying to setup Druid on Google Cloud.

I followed this document as a reference http://druid.io/docs/latest/tutorials/tutorial-the-druid-cluster.html

I was setting up Druid on a single node hadoop cluster (cloudera) - so I can skip the zookeeper installation step

As per the documentation I was able to

  • Start the Coordinator node
  • Start the historical node
  • Start the Broker ndoe
    However when I was trying to start the real time node, it gave me the below error.

Then I found out I had multiple versions of java on my server so I removed the duplicate and currently running on java-1.8.0-openjdk.x86_64

It didn’t resolve the issue,

So, I thought of starting the example server directly run_example_server.sh, But that gave the same below error.

How do I resolve it?

2015-09-20T17:36:46,044 WARN [main] org.eclipse.jetty.util.component.AbstractLifeCycle - FAILED ServerConnector@7df28f1{HTTP/1.1}{0.0.0.0:8084}: java.net.BindException: Address already in use

java.net.BindException: Address already in use

    at sun.nio.ch.Net.bind0(Native Method) ~[?:1.8.0_51]

    at sun.nio.ch.Net.bind(Net.java:437) ~[?:1.8.0_51]

    at sun.nio.ch.Net.bind(Net.java:429) ~[?:1.8.0_51]

    at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:223) ~[?:1.8.0_51]

    at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74) ~[?:1.8.0_51]

    at org.eclipse.jetty.server.ServerConnector.open(ServerConnector.java:321) ~[jetty-server-9.2.5.v20141112.jar:9.2.5.v20141112]

    at org.eclipse.jetty.server.AbstractNetworkConnector.doStart(AbstractNetworkConnector.java:80) ~[jetty-server-9.2.5.v20141112.jar:9.2.5.v20141112]

    at org.eclipse.jetty.server.ServerConnector.doStart(ServerConnector.java:236) ~[jetty-server-9.2.5.v20141112.jar:9.2.5.v20141112]

    at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68) [jetty-util-9.2.5.v20141112.jar:9.2.5.v20141112]

    at org.eclipse.jetty.server.Server.doStart(Server.java:366) [jetty-server-9.2.5.v20141112.jar:9.2.5.v20141112]

    at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68) [jetty-util-9.2.5.v20141112.jar:9.2.5.v20141112]

    at io.druid.server.initialization.jetty.JettyServerModule$1.start(JettyServerModule.java:128) [druid-server-0.8.1.jar:0.8.1]

    at com.metamx.common.lifecycle.Lifecycle.start(Lifecycle.java:250) [java-util-0.27.0.jar:?]

    at io.druid.guice.LifecycleModule$2.start(LifecycleModule.java:136) [druid-api-0.3.9.jar:0.8.1]

    at io.druid.cli.GuiceRunnable.initLifecycle(GuiceRunnable.java:71) [druid-services-0.8.1.jar:0.8.1]

    at io.druid.cli.ServerRunnable.run(ServerRunnable.java:38) [druid-services-0.8.1.jar:0.8.1]

    at io.druid.cli.Main.main(Main.java:91) [druid-services-0.8.1.jar:0.8.1]

2015-09-20T17:36:46,045 WARN [main] org.eclipse.jetty.util.component.AbstractLifeCycle - FAILED org.eclipse.jetty.server.Server@4087c7fc: java.net.BindException: Address already in use

java.net.BindException: Address already in use

    at sun.nio.ch.Net.bind0(Native Method) ~[?:1.8.0_51]

    at sun.nio.ch.Net.bind(Net.java:437) ~[?:1.8.0_51]

    at sun.nio.ch.Net.bind(Net.java:429) ~[?:1.8.0_51]

    at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:223) ~[?:1.8.0_51]

    at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74) ~[?:1.8.0_51]

    at org.eclipse.jetty.server.ServerConnector.open(ServerConnector.java:321) ~[jetty-server-9.2.5.v20141112.jar:9.2.5.v20141112]

    at org.eclipse.jetty.server.AbstractNetworkConnector.doStart(AbstractNetworkConnector.java:80) ~[jetty-server-9.2.5.v20141112.jar:9.2.5.v20141112]

    at org.eclipse.jetty.server.ServerConnector.doStart(ServerConnector.java:236) ~[jetty-server-9.2.5.v20141112.jar:9.2.5.v20141112]

    at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68) [jetty-util-9.2.5.v20141112.jar:9.2.5.v20141112]

    at org.eclipse.jetty.server.Server.doStart(Server.java:366) ~[jetty-server-9.2.5.v20141112.jar:9.2.5.v20141112]

    at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68) [jetty-util-9.2.5.v20141112.jar:9.2.5.v20141112]

    at io.druid.server.initialization.jetty.JettyServerModule$1.start(JettyServerModule.java:128) [druid-server-0.8.1.jar:0.8.1]

    at com.metamx.common.lifecycle.Lifecycle.start(Lifecycle.java:250) [java-util-0.27.0.jar:?]

    at io.druid.guice.LifecycleModule$2.start(LifecycleModule.java:136) [druid-api-0.3.9.jar:0.8.1]

    at io.druid.cli.GuiceRunnable.initLifecycle(GuiceRunnable.java:71) [druid-services-0.8.1.jar:0.8.1]

    at io.druid.cli.ServerRunnable.run(ServerRunnable.java:38) [druid-services-0.8.1.jar:0.8.1]

    at io.druid.cli.Main.main(Main.java:91) [druid-services-0.8.1.jar:0.8.1]

2015-09-20T17:36:46,045 ERROR [main] io.druid.cli.CliRealtime - Error when starting up. Failing

java.net.BindException: Address already in use

    at sun.nio.ch.Net.bind0(Native Method) ~[?:1.8.0_51]

    at sun.nio.ch.Net.bind(Net.java:437) ~[?:1.8.0_51]

    at sun.nio.ch.Net.bind(Net.java:429) ~[?:1.8.0_51]

    at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:223) ~[?:1.8.0_51]

    at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74) ~[?:1.8.0_51]

    at org.eclipse.jetty.server.ServerConnector.open(ServerConnector.java:321) ~[jetty-server-9.2.5.v20141112.jar:9.2.5.v20141112]

    at org.eclipse.jetty.server.AbstractNetworkConnector.doStart(AbstractNetworkConnector.java:80) ~[jetty-server-9.2.5.v20141112.jar:9.2.5.v20141112]

    at org.eclipse.jetty.server.ServerConnector.doStart(ServerConnector.java:236) ~[jetty-server-9.2.5.v20141112.jar:9.2.5.v20141112]

    at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68) ~[jetty-util-9.2.5.v20141112.jar:9.2.5.v20141112]

    at org.eclipse.jetty.server.Server.doStart(Server.java:366) ~[jetty-server-9.2.5.v20141112.jar:9.2.5.v20141112]

    at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68) ~[jetty-util-9.2.5.v20141112.jar:9.2.5.v20141112]

    at io.druid.server.initialization.jetty.JettyServerModule$1.start(JettyServerModule.java:128) ~[druid-server-0.8.1.jar:0.8.1]

    at com.metamx.common.lifecycle.Lifecycle.start(Lifecycle.java:250) ~[java-util-0.27.0.jar:?]

    at io.druid.guice.LifecycleModule$2.start(LifecycleModule.java:136) ~[druid-api-0.3.9.jar:0.8.1]

    at io.druid.cli.GuiceRunnable.initLifecycle(GuiceRunnable.java:71) [druid-services-0.8.1.jar:0.8.1]

    at io.druid.cli.ServerRunnable.run(ServerRunnable.java:38) [druid-services-0.8.1.jar:0.8.1]

    at io.druid.cli.Main.main(Main.java:91) [druid-services-0.8.1.jar:0.8.1]

Hi Rahul,
It seems some other process is using the port 8084.

you can either kill the process running on this port of switch druid to run on another port which is free.

Hey Nishant,

Yes that worked. Thanks a lot!

Regards,
Rahul Kumar