title: hadoop hdfs formatting gets error failed for Block pool
body: <p>After formatting my hdfs, I get the following errors:</p>
  
  <pre><code>2015-05-28 21:41:57,544 WARN org.apache.hadoop.hdfs.server.common.Storage: java.io.IOException: Incompatible clusterIDs in /usr/local/hadoop/dfs/datanode: namenode clusterID = CID-e77ee39a-ab4a-4de1-b1a4-9d4da78b83e8; datanode clusterID = CID-6c250e90-658c-4363-9346-972330ff8bf9
  2015-05-28 21:41:57,545 FATAL org.apache.hadoop.hdfs.server.datanode.DataNode: Initialization failed for Block pool &lt;registering&gt; (Datanode Uuid unassigned) service to localhost/127.0.0.1:9000. Exiting. 
  java.io.IOException: All specified directories are failed to load.
      at.. org.apache.hadoop.hdfs.server.datanode.DataStorage.recoverTransitionRead(DataStorage.java:477)
      at org.apache.hadoop.hdfs.server.datanode.DataNode.initStorage(DataNode.java:1387)
      at org.apache.hadoop.hdfs.server.datanode.DataNode.initBlockPool(DataNode.java:1352)
      at org.apache.hadoop.hdfs.server.datanode.BPOfferService.verifyAndSetNamespaceInfo(BPOfferService.java:316)
      at org.apache.hadoop.hdfs.server.datanode.BPServiceActor.connectToNNAndHandshake(BPServiceActor.java:228)
      at org.apache.hadoop.hdfs.server.datanode.BPServiceActor.run(BPServiceActor.java:852)
      at java.lang.Thread.run(Thread.java:745)
  ...blah...
  SHUTDOWN_MSG: 
  /************************************************************
  SHUTDOWN_MSG: Shutting down DataNode at der-Inspiron-3521/127.0.1.1
  ************************************************************/
  </code></pre>
  
  <p>Here are the steps that I did:</p>
  
  <pre><code> sbin/stop-dfs.sh
   hdfs namenode -format
   sbin/start-dfs.sh
  </code></pre>
  
  <p>For your information: my core-site.xml has the temp dir as follows:</p>
  
  <pre><code>&lt;property&gt;
        &lt;name&gt;hadoop.tmp.dir&lt;/name&gt;
       &lt;value&gt;/usr/local/hadoop&lt;/value&gt;
        &lt;description&gt;A base for other temporary directories.    
  &lt;/description&gt;
   &lt;/property&gt;
  </code></pre>
  
  <p>and my hdfs-site.xml as the namenode and datanode as follows:</p>
  
  <pre><code> &lt;property&gt;
       &lt;name&gt;dfs.namenode.name.dir&lt;/name&gt;  
       &lt;value&gt;file:/usr/local/hadoop/dfs/namenode&lt;/value&gt;
    &lt;/property&gt;
  
  
  
   &lt;property&gt; 
          &lt;name&gt;dfs.datanode.data.dir&lt;/name&gt;
          &lt;value&gt;file:/usr/local/hadoop/dfs/datanode&lt;/value&gt;
      &lt;/property&gt;
  </code></pre>
  
  <hr>
  
  <p>Update:
  I have gotten a bit further with the issue but still I am getting the same type of error. I was able to run the <code>hdfs dfs -format</code> and change the version <b> as advised</b>. After that I used the <code>hdfs dfs -ls and hdfs dfs -mkdir to create /user/der</code> wher der is my log in name. However when I ran the my
   pig file, I take mkDirs and chmod errors in my pig file.
   Here are the permissions for my datanode and namenode:</p>
  
  <pre><code>drwx------ 3 der  der  4096 May 29 08:13 datanode
  drwxrwxrwx 4 root root 4096 May 28 11:34 name
  drwxrwxr-x 3 der  der  4096 May 29 08:13 namenode
  drwxrwxr-x 3 der  der  4096 May 29 08:13 namesecondary
  drwxr-xr-x 2 root root 4096 May 28 11:46 ww
  </code></pre>
  
  <p>It seems datanode only has permissions for owner and group but not user.</p>
  
  <p>Here is my pig script error:</p>
  
  <pre><code>2015-05-29 08:37:27,152 [JobControl] INFO  org.apache.hadoop.mapreduce.lib.jobcontrol.ControlledJob - PigLatin:totalmiles.pig got an error while submitting 
  ENOENT: No such file or directory
      at org.apache.hadoop.io.nativeio.NativeIO$POSIX.chmodImpl(Native Method)
      at org.apache.hadoop.io.nativeio.NativeIO$POSIX.chmod(NativeIO.java:230)
      at org.apache.hadoop.fs.RawLocalFileSystem.setPermission(RawLocalFileSystem.java:724)
      at org.apache.hadoop.fs.FilterFileSystem.setPermission(FilterFileSystem.java:502)
      at org.apache.hadoop.fs.FileSystem.mkdirs(FileSystem.java:600)
      at org.apache.hadoop.mapreduce.JobResourceUploader.uploadFiles(JobResourceUploader.java:94)
      at org.apache.hadoop.mapreduce.JobSubmitter.copyAndConfigureFiles(JobSubmitter.java:98)
      at org.apache.hadoop.mapreduce.JobSubmitter.submitJobInternal(JobSubmitter.java:193)
      at org.apache.hadoop.mapreduce.Job$10.run(Job.java:1290)
      at org.apache.hadoop.mapreduce.Job$10.run(Job.java:1287)
      at java.security.AccessController.doPrivileged(Native Method)
      at javax.security.auth.Subject.doAs(Subject.java:415)
      at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1657)
      at org.apache.hadoop.mapreduce.Job.submit(Job.java:1287)
      at org.apache.hadoop.mapreduce.lib.jobcontrol.ControlledJob.submit(ControlledJob.java:335)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl
  </code></pre>
  
  <p>Here is my pig script:</p>
  
  <pre><code>records = LOAD '1987.csv' USING PigStorage(',') AS
          (Year, Month, DayofMonth, DayOfWeek, 
           DepTime, CRSDepTime, ArrTime, CRSArrTime, 
           UniqueCarrier, FlightNum, TailNum,ActualElapsedTime,
           CRSElapsedTime,AirTime,ArrDelay, DepDelay, 
           Origin, Dest,  Distance:int, TaxIn, 
           TaxiOut, Cancelled,CancellationCode,  Diverted, 
           CarrierDelay, WeatherDelay, NASDelay, SecurityDelay,
           lateAircraftDelay);
  milage_recs= GROUP records ALL;
  tot_miles = FOREACH milage_recs GENERATE SUM(records.Distance);
  STORE tot_miles INTO 'totalmiles4';
  </code></pre>
  
  <p>Update:
  By the way I used chmod go+rw on datanode (after I stopped the namenode server and datanode server). That did not work as well.</p>
  
  <hr>
  
  <p>Update May 30:
  A bit more details.
   I changed the parent directory of the pig script in my pig script to this:</p>
  
  <pre><code>records = LOAD '/user/der/1987.csv' USING PigStorage(',') AS
  </code></pre>
  
  <p>I have the same error. On the client side, here's the error. The only difference is that there is not hdfs:// prefix to the failed input read.</p>
  
  <pre><code>Failed to read data from "/user/der/1987.csv"
  
  Output(s):
  Failed to produce result in "hdfs://localhost:9000/user/der/totalmiles4"
  </code></pre>
  
  <p>On the server side here is the namenode log just at the moment I get the invalid file request from my pig script. The log (using tail -f) scrolled. This indicates that the server is accepting request for the pig command. </p>
  
  <pre><code>          2015-05-30 07:01:28,140 INFO BlockStateChange: BLOCK* addStoredBlock: blockMap updated: 127.0.0.1:50010 is added to 
          blk_1073741885_1061{UCState=UNDER_CONSTRUCTION, 
      truncateBlock=null,
   primaryNodeIndex=-1, replicas=[ReplicaUC[[DISK]DS-c84e0e37-2726-44da-af3e-67167c1010d1:NORMAL:127.0.0.1:50010|RBW]]}
       size 0
  
              2015-05-30 07:01:28,148 INFO org.apache.hadoop.hdfs.StateChange: DIR* completeFile:
       /tmp/temp-11418443/tmp85697770/automaton-1.11-8.jar 
  is closed by DFSClient_NONMAPREDUCE_-1939565577_1
  </code></pre>
  
  <p>I am just have to get the source code of the pig script and check the extact hdfs commands it issues. I think there is someone wrong with the hadoop hdfs services that I configured.</p>