title: Hadoop Pseudo-Distributed Operation error: Protocol message tag had invalid wire type
body: <p>I am setting up a <code>Hadoop 2.6.0</code> Single Node Cluster. I follow the <a href="https://hadoop.apache.org/docs/stable/hadoop-project-dist/hadoop-common/SingleCluster.html" rel="nofollow">hadoop-common/SingleCluster documentation</a>. I work on <code>Ubuntu 14.04</code>. So far I have managed to run Standalone Operation successfully. </p>
  
  <p>I face an error when trying to perform <strong>Pseudo-Distributed Operation</strong>. I managed to start NameNode daemon and DataNode daemon. <strong>jps</strong> oputut:</p>
  
  <pre><code>martakarass@marta-komputer:/usr/local/hadoop$ jps
  4963 SecondaryNameNode
  4785 DataNode
  8400 Jps
  martakarass@marta-komputer:/usr/local/hadoop$ 
  </code></pre>
  
  <p>But when I try to make the HDFS directories required to execute MapReduce jobs, I receive the following error:</p>
  
  <pre><code>martakarass@marta-komputer:/usr/local/hadoop$ bin/hdfs dfs -mkdir /user
  15/05/01 20:36:00 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
  mkdir: Failed on local exception: com.google.protobuf.InvalidProtocolBufferException: Protocol message tag had invalid wire type.; Host Details : local host is: "marta-komputer/127.0.0.1"; destination host is: "localhost":9000; 
  martakarass@marta-komputer:/usr/local/hadoop$ 
  </code></pre>
  
  <p>(I believe I can ignore the <code>WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform...</code> warning at this point.)</p>
  
  <hr>
  
  <p>When it comes to <code>Hadoop</code> config files, I changed only the files mentioned in the documentation. I have: </p>
  
  <p><strong>etc/hadoop/core-site.xml</strong>:</p>
  
  <pre><code>&lt;configuration&gt;
      &lt;property&gt;
          &lt;name&gt;fs.defaultFS&lt;/name&gt;
          &lt;value&gt;hdfs://localhost:9000&lt;/value&gt;
      &lt;/property&gt;
  &lt;/configuration&gt;
  </code></pre>
  
  <p><strong>etc/hadoop/hdfs-site.xml</strong>:</p>
  
  <pre><code>&lt;configuration&gt;
      &lt;property&gt;
          &lt;name&gt;dfs.replication&lt;/name&gt;
          &lt;value&gt;1&lt;/value&gt;
      &lt;/property&gt;
  &lt;/configuration&gt;
  </code></pre>
  
  <p>I managed to connect to localhost:</p>
  
  <pre><code>martakarass@marta-komputer:~$ ssh localhost
  martakarass@localhost's password: 
  Welcome to Ubuntu 14.04.1 LTS (GNU/Linux 3.13.0-45-generic x86_64)
  
   * Documentation:  https://help.ubuntu.com/
  
  Last login: Fri May  1 20:28:58 2015 from localhost
  </code></pre>
  
  <p>I formatted the filesystem:</p>
  
  <pre><code>martakarass@marta-komputer:/usr/local/hadoop$  bin/hdfs namenode -format
  15/05/01 20:30:21 INFO namenode.NameNode: STARTUP_MSG: 
  /************************************************************
  STARTUP_MSG: Starting NameNode
  STARTUP_MSG:   host = marta-komputer/127.0.0.1
  STARTUP_MSG:   args = [-format]
  STARTUP_MSG:   version = 2.6.0
  (...)
  15/05/01 20:30:24 INFO namenode.NameNode: SHUTDOWN_MSG: 
  /************************************************************
  SHUTDOWN_MSG: Shutting down NameNode at marta-komputer/127.0.0.1
  ************************************************************/
  </code></pre>
  
  <p><strong>/etc/hosts</strong>:</p>
  
  <pre><code>127.0.0.1       localhost
  127.0.0.1       marta-komputer
  
  # The following lines are desirable for IPv6 capable hosts
  ::1     ip6-localhost ip6-loopback
  fe00::0 ip6-localnet
  ff00::0 ip6-mcastprefix
  ff02::1 ip6-allnodes
  ff02::2 ip6-allrouters
  </code></pre>
  
  <p><strong>etc/hostname</strong>:</p>
  
  <pre><code>marta-komputer
  </code></pre>