title: Error executing hdfs namenode -format
body: <p>I am new to hadoop, hdfs.. I have do the next steps:</p>
  
  <p>I have started zookeeper in the three namenodes:</p>
  
  <pre><code>*vagrant@172:~$ zkServer.sh start
  </code></pre>
  
  <p>I can see the status:</p>
  
  <pre><code>*vagrant@172:~$ zkServer.sh status
  </code></pre>
  
  <p>Result Status:</p>
  
  <pre><code>JMX enabled by default
      Using config: /opt/zookeeper-3.4.6/bin/../conf/zoo.cfg
      Mode: follower
  </code></pre>
  
  <p>with jps command only appear jps and sometimes appear quaroom too:</p>
  
  <pre><code>*vagrant@172:~$ jps
      2237 Jps
  </code></pre>
  
  <p>I run the next command too.</p>
  
  <pre><code>* vagrant@172:~$ hdfs zkfc -formatZK
  </code></pre>
  
  <p>And when I execute the next, it failed:</p>
  
  <pre><code>vagrant@172:~$ hdfs namenode -format
  
  
   15/12/02 10:54:34 WARN client.QuorumJournalManager: Waited 59880 ms (timeout=60000 ms) for a response for hasSomeData. No responses yet.
  15/12/02 10:54:34 WARN namenode.NameNode: Encountered exception during format: 
  java.io.IOException: Timed out waiting for response from loggers
      at org.apache.hadoop.hdfs.qjournal.client.QuorumJournalManager.hasSomeData(QuorumJournalManager.java:228)
      at org.apache.hadoop.hdfs.server.common.Storage.confirmFormat(Storage.java:899)
      at org.apache.hadoop.hdfs.server.namenode.FSImage.confirmFormat(FSImage.java:171)
      at org.apache.hadoop.hdfs.server.namenode.NameNode.format(NameNode.java:940)
      at org.apache.hadoop.hdfs.server.namenode.NameNode.createNameNode(NameNode.java:1382)
      at org.apache.hadoop.hdfs.server.namenode.NameNode.main(NameNode.java:1507)
  15/12/02 10:54:37 FATAL namenode.NameNode: Failed to start namenode.
  java.io.IOException: Timed out waiting for response from loggers
      at org.apache.hadoop.hdfs.qjournal.client.QuorumJournalManager.hasSomeData(QuorumJournalManager.java:228)
      at org.apache.hadoop.hdfs.server.common.Storage.confirmFormat(Storage.java:899)
      at org.apache.hadoop.hdfs.server.namenode.FSImage.confirmFormat(FSImage.java:171)
      at org.apache.hadoop.hdfs.server.namenode.NameNode.format(NameNode.java:940)
      at org.apache.hadoop.hdfs.server.namenode.NameNode.createNameNode(NameNode.java:1382)
      at org.apache.hadoop.hdfs.server.namenode.NameNode.main(NameNode.java:1507)
  15/12/02 10:54:38 INFO util.ExitUtil: Exiting with status 1
  15/12/02 10:54:39 INFO namenode.NameNode: SHUTDOWN_MSG: 
  /************************************************************
  SHUTDOWN_MSG: Shutting down NameNode at localhost/127.0.0.1
  ************************************************************/
  </code></pre>
  
  <p>Then, if I run:</p>
  
  <pre><code>*vagrant@172:~$ hdfs namenode -bootstrapStandby
  </code></pre>
  
  <p>I have the next error:</p>
  
  <pre><code>15/12/02 10:58:45 FATAL namenode.NameNode: Failed to start namenode.
  java.io.IOException: java.lang.IllegalArgumentException: Does not contain a valid host:port authority: :0
      at org.apache.hadoop.hdfs.server.namenode.ha.BootstrapStandby.run(BootstrapStandby.java:425)
      at org.apache.hadoop.hdfs.server.namenode.NameNode.createNameNode(NameNode.java:1407)
      at org.apache.hadoop.hdfs.server.namenode.NameNode.main(NameNode.java:1507)
  Caused by: java.lang.IllegalArgumentException: Does not contain a valid host:port authority: :0
      at org.apache.hadoop.net.NetUtils.createSocketAddr(NetUtils.java:212)
      at org.apache.hadoop.net.NetUtils.createSocketAddr(NetUtils.java:164)
      at org.apache.hadoop.net.NetUtils.createSocketAddr(NetUtils.java:153)
      at org.apache.hadoop.hdfs.DFSUtil.substituteForWildcardAddress(DFSUtil.java:1171)
      at org.apache.hadoop.hdfs.DFSUtil.getInfoServerWithDefaultHost(DFSUtil.java:1138)
      at org.apache.hadoop.hdfs.server.namenode.ha.BootstrapStandby.parseConfAndFindOtherNN(BootstrapStandby.java:397)
      at org.apache.hadoop.hdfs.server.namenode.ha.BootstrapStandby.run(BootstrapStandby.java:103)
      at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:70)
      at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:84)
      at org.apache.hadoop.hdfs.server.namenode.ha.BootstrapStandby.run(BootstrapStandby.java:420)
      ... 2 more
  15/12/02 10:58:46 INFO util.ExitUtil: Exiting with status 1
  15/12/02 10:58:46 INFO namenode.NameNode: SHUTDOWN_MSG: 
  /************************************************************
  SHUTDOWN_MSG: Shutting down NameNode at localhost/127.0.0.1
  ************************************************************/
  </code></pre>
  
  <p>Any help for this error would be a great help for me.</p>
  
  <p>My configuration are the next:</p>
  
  <h1>bashrc</h1>
  
  <pre><code>###JAVA CONFIGURATION###
  JAVA_HOME=/usr/lib/jvm/java-8-oracle
  export PATH=$PATH:$JAVA_HOME/bin
  
  ###HADOOP CONFIGURATION###
  HADOOP_PREFIX=/opt/hadoop-2.6.2/
  export PATH=$PATH:$HADOOP_PREFIX/bin:$HADOOP_PREFIX/sbin
  
  ###ZOOKEPER###
  export PATH=$PATH:/opt/zookeeper-3.4.6/bin
  </code></pre>
  
  <h1>hdfs-site.xml</h1>
  
  <pre><code>&lt;configuration&gt;
   &lt;property&gt;
    &lt;name&gt;dfs.replication&lt;/name&gt;
    &lt;value&gt;2&lt;/value&gt;
   &lt;/property&gt;
   &lt;property&gt;
    &lt;name&gt;dfs.name.dir&lt;/name&gt;
    &lt;value&gt;file:///hdfs/name&lt;/value&gt;
   &lt;/property&gt;
   &lt;property&gt;
    &lt;name&gt;dfs.data.dir&lt;/name&gt;
    &lt;value&gt;file:///hdfs/data&lt;/value&gt;
   &lt;/property&gt;
   &lt;property&gt;
    &lt;name&gt;dfs.permissions&lt;/name&gt;
    &lt;value&gt;false&lt;/value&gt;
   &lt;/property&gt;
   &lt;property&gt;
    &lt;name&gt;dfs.nameservices&lt;/name&gt;
    &lt;value&gt;auto-ha&lt;/value&gt;
   &lt;/property&gt;
   &lt;property&gt;
    &lt;name&gt;dfs.ha.namenodes.auto-ha&lt;/name&gt;
    &lt;value&gt;nn01,nn02&lt;/value&gt;
   &lt;/property&gt;
   &lt;property&gt;
    &lt;name&gt;dfs.namenode.rpc-address.auto-ha.nn01&lt;/name&gt;
    &lt;value&gt;172.16.8.191:8020&lt;/value&gt;
   &lt;/property&gt;
   &lt;property&gt;
    &lt;name&gt;dfs.namenode.http-address.auto-ha.nn01&lt;/name&gt;
    &lt;value&gt;172.16.8.191:50070&lt;/value&gt;
   &lt;/property&gt;
   &lt;property&gt;
    &lt;name&gt;dfs.namenode.rpc-address.auto-ha.nn02&lt;/name&gt;
    &lt;value&gt;172.16.8.192:8020&lt;/value&gt;
   &lt;/property&gt;
   &lt;property&gt;
    &lt;name&gt;dfs.namenode.http-address.auto-ha.nn02&lt;/name&gt;
    &lt;value&gt;172.16.8.192:50070&lt;/value&gt;
   &lt;/property&gt;
   &lt;property&gt;
    &lt;name&gt;dfs.namenode.shared.edits.dir&lt;/name&gt;
    &lt;value&gt;qjournal://172.16.8.191:8485;172.16.8.192:8485;172.16.8.193:8485/auto-ha&lt;/value&gt;
   &lt;/property&gt;
   &lt;property&gt;
    &lt;name&gt;dfs.journalnode.edits.dir&lt;/name&gt;
    &lt;value&gt;/hdfs/journalnode&lt;/value&gt;
   &lt;/property&gt;
   &lt;property&gt;
    &lt;name&gt;dfs.ha.fencing.methods&lt;/name&gt;
    &lt;value&gt;sshfence&lt;/value&gt;
   &lt;/property&gt;
   &lt;property&gt;
    &lt;name&gt;dfs.ha.fencing.ssh.private-key-files&lt;/name&gt;
    &lt;value&gt;/home/vagrant/.ssh/id_rsa&lt;/value&gt;
   &lt;/property&gt;
   &lt;property&gt;
    &lt;name&gt;dfs.ha.automatic-failover.enabled.auto-ha&lt;/name&gt;
    &lt;value&gt;true&lt;/value&gt;
   &lt;/property&gt;
   &lt;property&gt;
     &lt;name&gt;ha.zookeeper.quorum&lt;/name&gt;
     &lt;value&gt;172.16.8.191:2181,172.16.8.192:2181,172.16.8.193:2181&lt;/value&gt;
   &lt;/property&gt;
  &lt;/configuration&gt;
  </code></pre>
  
  <h1>core-site.xml</h1>
  
  <pre><code> &lt;configuration&gt;
  &lt;property&gt;
    &lt;name&gt;fs.default.name&lt;/name&gt;
    &lt;value&gt;hdfs://auto-ha&lt;/value&gt;
  &lt;/property&gt;
  &lt;/configuration&gt;
  </code></pre>
  
  <h1>zoo.cfg</h1>
  
  <pre><code> tickTime=2000
  
          dataDir=/opt/ZooData
  
          clientPort=2181
  
          initLimit=5
          syncLimit=2
          server.1=172.16.8.191:2888:3888
          server.2=172.16.8.192:2888:3888
          server.3=172.16.8.193:2888:3888
  </code></pre>