title: DataNode is not starting on hadoop multinode cluster
body: <p>I removed contents from hadoop tmp directory,  dropped current folder from namenode directory, formatted namenode but got an exception: <strong>org.apache.hadoop.http.HttpServer2: HttpServer.start() threw a non Bind IOException java.net.BindException: Port in use: localhost:0</strong>.</p>
  
  <p>My configuration is as follows:</p>
  
  <p>core-site.xml</p>
  
  <pre><code>&lt;configuration&gt;
      &lt;property&gt;        
          &lt;name&gt;fs.default.name&lt;/name&gt;         
          &lt;value&gt;hdfs://master:9000/&lt;/value&gt;         
          &lt;description&gt;NameNode URI&lt;/description&gt;     
      &lt;/property&gt;
  &lt;/configuration&gt;
  </code></pre>
  
  <p><strong>hdfs-site.xml</strong></p>
  
  <pre><code>&lt;configuration&gt;
      &lt;property&gt;         
          &lt;name&gt;dfs.namenode.name.dir&lt;/name&gt;         
          &lt;value&gt;file:///home/hduser/hdfs/namenode&lt;/value&gt;        
          &lt;description&gt;NameNode directory for namespace and transaction logs storage.&lt;/description&gt;     
      &lt;/property&gt;
      &lt;property&gt;         
          &lt;name&gt;dfs.datanode.data.dir&lt;/name&gt;         
          &lt;value&gt;file:///home/hduser/hdfs/datanode&lt;/value&gt;        
          &lt;description&gt;DataNode directory&lt;/description&gt;
      &lt;/property&gt;           
      &lt;property&gt;         
          &lt;name&gt;dfs.replication&lt;/name&gt;         
          &lt;value&gt;2&lt;/value&gt;     
      &lt;/property&gt;     
  &lt;/configuration&gt;
  </code></pre>
  
  <p><strong>mapred-site.xml</strong></p>
  
  <pre><code>&lt;configuration&gt;
      &lt;property&gt;
          &lt;name&gt;mapreduce.framework.name&lt;/name&gt;
          &lt;value&gt;yarn&lt;/value&gt;
      &lt;/property&gt;
      &lt;property&gt;
              &lt;name&gt;mapreduce.jobhistory.address&lt;/name&gt;
              &lt;value&gt;master:10020&lt;/value&gt;
      &lt;/property&gt;
  &lt;/configuration&gt;
  </code></pre>
  
  <p><strong>yarn-site.xml</strong></p>
  
  <pre><code>&lt;configuration&gt;
      &lt;property&gt;
          &lt;name&gt;yarn.nodemanager.aux-services&lt;/name&gt;
          &lt;value&gt;mapreduce_shuffle&lt;/value&gt;
      &lt;/property&gt;
      &lt;property&gt;
          &lt;name&gt;yarn.nodemanager.aux-services.mapreduce.shuffle.class&lt;/name&gt;
          &lt;value&gt;org.apache.hadoop.mapred.ShuffleHandler&lt;/value&gt;
      &lt;/property&gt;
      &lt;property&gt;
          &lt;name&gt;yarn.resourcemanager.resource-tracker.address&lt;/name&gt;
          &lt;value&gt;master:8025&lt;/value&gt;
      &lt;/property&gt;
      &lt;property&gt;
          &lt;name&gt;yarn.resourcemanager.scheduler.address&lt;/name&gt;
          &lt;value&gt;master:8030&lt;/value&gt;
      &lt;/property&gt;
      &lt;property&gt;
          &lt;name&gt;yarn.resourcemanager.address&lt;/name&gt;
          &lt;value&gt;master:8050&lt;/value&gt;
      &lt;/property&gt;
  &lt;/configuration&gt;
  </code></pre>
  
  <p><strong>data node log</strong></p>
  
  <pre><code>2017-01-20 16:27:21,927 INFO org.apache.hadoop.hdfs.server.datanode.DataNode: registered UNIX signal handlers for [TERM, HUP, INT]
  2017-01-20 16:27:23,346 INFO org.apache.hadoop.metrics2.impl.MetricsConfig: loaded properties from hadoop-metrics2.properties
  2017-01-20 16:27:23,444 INFO org.apache.hadoop.metrics2.impl.MetricsSystemImpl: Scheduled snapshot period at 10 second(s).
  2017-01-20 16:27:23,444 INFO org.apache.hadoop.metrics2.impl.MetricsSystemImpl: DataNode metrics system started
  2017-01-20 16:27:23,448 INFO org.apache.hadoop.hdfs.server.datanode.BlockScanner: Initialized block scanner with targetBytesPerSec 1048576
  2017-01-20 16:27:23,450 INFO org.apache.hadoop.hdfs.server.datanode.DataNode: Configured hostname is master
  2017-01-20 16:27:23,461 INFO org.apache.hadoop.hdfs.server.datanode.DataNode: Starting DataNode with maxLockedMemory = 0
  2017-01-20 16:27:23,491 INFO org.apache.hadoop.hdfs.server.datanode.DataNode: Opened streaming server at /0.0.0.0:50010
  2017-01-20 16:27:23,493 INFO org.apache.hadoop.hdfs.server.datanode.DataNode: Balancing bandwith is 1048576 bytes/s
  2017-01-20 16:27:23,493 INFO org.apache.hadoop.hdfs.server.datanode.DataNode: Number threads for balancing is 5
  2017-01-20 16:27:23,650 INFO org.mortbay.log: Logging to org.slf4j.impl.Log4jLoggerAdapter(org.mortbay.log) via org.mortbay.log.Slf4jLog
  2017-01-20 16:27:23,663 INFO org.apache.hadoop.security.authentication.server.AuthenticationFilter: Unable to initialize FileSignerSecretProvider, falling back to use random secrets.
  2017-01-20 16:27:23,673 INFO org.apache.hadoop.http.HttpRequestLog: Http request log for http.requests.datanode is not defined
  2017-01-20 16:27:23,677 INFO org.apache.hadoop.http.HttpServer2: Added global filter 'safety' (class=org.apache.hadoop.http.HttpServer2$QuotingInputFilter)
  2017-01-20 16:27:23,689 INFO org.apache.hadoop.http.HttpServer2: Added filter static_user_filter (class=org.apache.hadoop.http.lib.StaticUserWebFilter$StaticUserFilter) to context datanode
  2017-01-20 16:27:23,690 INFO org.apache.hadoop.http.HttpServer2: Added filter static_user_filter (class=org.apache.hadoop.http.lib.StaticUserWebFilter$StaticUserFilter) to context static
  2017-01-20 16:27:23,690 INFO org.apache.hadoop.http.HttpServer2: Added filter static_user_filter (class=org.apache.hadoop.http.lib.StaticUserWebFilter$StaticUserFilter) to context logs
  2017-01-20 16:27:23,716 INFO org.apache.hadoop.http.HttpServer2: HttpServer.start() threw a non Bind IOException
  java.net.BindException: Port in use: localhost:0
      at org.apache.hadoop.http.HttpServer2.openListeners(HttpServer2.java:919)
      at org.apache.hadoop.http.HttpServer2.start(HttpServer2.java:856)
      at org.apache.hadoop.hdfs.server.datanode.web.DatanodeHttpServer.&lt;init&gt;(DatanodeHttpServer.java:104)
      at org.apache.hadoop.hdfs.server.datanode.DataNode.startInfoServer(DataNode.java:760)
      at org.apache.hadoop.hdfs.server.datanode.DataNode.startDataNode(DataNode.java:1112)
      at org.apache.hadoop.hdfs.server.datanode.DataNode.&lt;init&gt;(DataNode.java:429)
      at org.apache.hadoop.hdfs.server.datanode.DataNode.makeInstance(DataNode.java:2374)
      at org.apache.hadoop.hdfs.server.datanode.DataNode.instantiateDataNode(DataNode.java:2261)
      at org.apache.hadoop.hdfs.server.datanode.DataNode.createDataNode(DataNode.java:2308)
      at org.apache.hadoop.hdfs.server.datanode.DataNode.secureMain(DataNode.java:2485)
      at org.apache.hadoop.hdfs.server.datanode.DataNode.main(DataNode.java:2509)
  Caused by: java.net.BindException: Cannot assign requested address
      at sun.nio.ch.Net.bind0(Native Method)
      at sun.nio.ch.Net.bind(Net.java:433)
      at sun.nio.ch.Net.bind(Net.java:425)
      at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:223)
      at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74)
      at org.mortbay.jetty.nio.SelectChannelConnector.open(SelectChannelConnector.java:216)
      at org.apache.hadoop.http.HttpServer2.openListeners(HttpServer2.java:914)
      ... 10 more
  2017-01-20 16:27:23,727 INFO org.apache.hadoop.hdfs.server.datanode.DataNode: Shutdown complete.
  2017-01-20 16:27:23,728 FATAL org.apache.hadoop.hdfs.server.datanode.DataNode: Exception in secureMain
  java.net.BindException: Port in use: localhost:0
      at org.apache.hadoop.http.HttpServer2.openListeners(HttpServer2.java:919)
      at org.apache.hadoop.http.HttpServer2.start(HttpServer2.java:856)
      at org.apache.hadoop.hdfs.server.datanode.web.DatanodeHttpServer.&lt;init&gt;(DatanodeHttpServer.java:104)
      at org.apache.hadoop.hdfs.server.datanode.DataNode.startInfoServer(DataNode.java:760)
      at org.apache.hadoop.hdfs.server.datanode.DataNode.startDataNode(DataNode.java:1112)
      at org.apache.hadoop.hdfs.server.datanode.DataNode.&lt;init&gt;(DataNode.java:429)
      at org.apache.hadoop.hdfs.server.datanode.DataNode.makeInstance(DataNode.java:2374)
      at org.apache.hadoop.hdfs.server.datanode.DataNode.instantiateDataNode(DataNode.java:2261)
      at org.apache.hadoop.hdfs.server.datanode.DataNode.createDataNode(DataNode.java:2308)
      at org.apache.hadoop.hdfs.server.datanode.DataNode.secureMain(DataNode.java:2485)
      at org.apache.hadoop.hdfs.server.datanode.DataNode.main(DataNode.java:2509)
  Caused by: java.net.BindException: Cannot assign requested address
      at sun.nio.ch.Net.bind0(Native Method)
      at sun.nio.ch.Net.bind(Net.java:433)
      at sun.nio.ch.Net.bind(Net.java:425)
      at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:223)
      at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74)
      at org.mortbay.jetty.nio.SelectChannelConnector.open(SelectChannelConnector.java:216)
      at org.apache.hadoop.http.HttpServer2.openListeners(HttpServer2.java:914)
      ... 10 more
  2017-01-20 16:27:23,730 INFO org.apache.hadoop.util.ExitUtil: Exiting with status 1
  2017-01-20 16:27:23,735 INFO org.apache.hadoop.hdfs.server.datanode.DataNode: SHUTDOWN_MSG: 
  /************************************************************
  SHUTDOWN_MSG: Shutting down DataNode at master/10.0.1.1
  ************************************************************/ 
  </code></pre>
  
  <p>Any help would be highly appreciated.</p>